@bigbinary/neeto-molecules 1.1.16 → 1.1.17
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/AutoSaveInput.js +658 -0
- package/dist/AutoSaveInput.js.map +1 -0
- package/dist/Breadcrumbs.js +38 -0
- package/dist/Breadcrumbs.js.map +1 -0
- package/dist/BrowserSupport.js +418 -0
- package/dist/BrowserSupport.js.map +1 -0
- package/dist/Builder.js +662 -0
- package/dist/Builder.js.map +1 -0
- package/dist/CalendarView.js +538 -0
- package/dist/CalendarView.js.map +1 -0
- package/dist/Codeblock.js +236 -0
- package/dist/Codeblock.js.map +1 -0
- package/dist/{Columns/index.js → Columns.js} +130 -13
- package/dist/Columns.js.map +1 -0
- package/dist/{ConfirmationModal/index.js → ConfirmationModal.js} +20 -8
- package/dist/ConfirmationModal.js.map +1 -0
- package/dist/Container.js +1211 -0
- package/dist/Container.js.map +1 -0
- package/dist/CopyToClipboardButton.js +209 -0
- package/dist/CopyToClipboardButton.js.map +1 -0
- package/dist/CustomDomain.js +688 -0
- package/dist/CustomDomain.js.map +1 -0
- package/dist/CustomDomainDashboard.js +2283 -0
- package/dist/CustomDomainDashboard.js.map +1 -0
- package/dist/{DateFormat/index.js → DateFormat.js} +25 -8
- package/dist/DateFormat.js.map +1 -0
- package/dist/DateRangeFilter.js +229 -0
- package/dist/DateRangeFilter.js.map +1 -0
- package/dist/DynamicVariables.js +183 -0
- package/dist/DynamicVariables.js.map +1 -0
- package/dist/EmailForm.js +2291 -0
- package/dist/EmailForm.js.map +1 -0
- package/dist/EmailPreview.js +1353 -0
- package/dist/EmailPreview.js.map +1 -0
- package/dist/{ErrorPage/constants.js → ErrorPage.js} +137 -36
- package/dist/ErrorPage.js.map +1 -0
- package/dist/Header.js +122 -0
- package/dist/Header.js.map +1 -0
- package/dist/IconPicker.js +313 -0
- package/dist/IconPicker.js.map +1 -0
- package/dist/ImageWithFallback.js +181 -0
- package/dist/ImageWithFallback.js.map +1 -0
- package/dist/IntegrationCard.js +343 -0
- package/dist/IntegrationCard.js.map +1 -0
- package/dist/IntegrationDisconnectAlert.js +80 -0
- package/dist/IntegrationDisconnectAlert.js.map +1 -0
- package/dist/{IntegrationWalkthroughModal/index.js → IntegrationWalkthroughModal.js} +8 -6
- package/dist/IntegrationWalkthroughModal.js.map +1 -0
- package/dist/IpRestriction.js +857 -0
- package/dist/IpRestriction.js.map +1 -0
- package/dist/KeyboardShortcuts.js +359 -0
- package/dist/KeyboardShortcuts.js.map +1 -0
- package/dist/LoginPage.js +593 -0
- package/dist/LoginPage.js.map +1 -0
- package/dist/MenuBar.js +1461 -0
- package/dist/MenuBar.js.map +1 -0
- package/dist/Metadata.js +206 -0
- package/dist/Metadata.js.map +1 -0
- package/dist/{MoreDropdown/index.js → MoreDropdown.js} +102 -9
- package/dist/MoreDropdown.js.map +1 -0
- package/dist/NavigationHeader.js +690 -0
- package/dist/NavigationHeader.js.map +1 -0
- package/dist/NeetoWidget.js +1333 -0
- package/dist/NeetoWidget.js.map +1 -0
- package/dist/PageLoader.js +134 -0
- package/dist/PageLoader.js.map +1 -0
- package/dist/PhoneNumber.js +365 -0
- package/dist/PhoneNumber.js.map +1 -0
- package/dist/PublishBlock.js +158 -0
- package/dist/PublishBlock.js.map +1 -0
- package/dist/Rename.js +450 -0
- package/dist/Rename.js.map +1 -0
- package/dist/ResponsiveDevicePicker.js +194 -0
- package/dist/ResponsiveDevicePicker.js.map +1 -0
- package/dist/Schedule.js +1046 -0
- package/dist/Schedule.js.map +1 -0
- package/dist/Scrollable.js +122 -0
- package/dist/Scrollable.js.map +1 -0
- package/dist/Search.js +151 -0
- package/dist/Search.js.map +1 -0
- package/dist/Security.js +1835 -0
- package/dist/Security.js.map +1 -0
- package/dist/SendToFields.js +601 -0
- package/dist/SendToFields.js.map +1 -0
- package/dist/Settings.js +435 -0
- package/dist/Settings.js.map +1 -0
- package/dist/ShareViaEmail.js +2277 -0
- package/dist/ShareViaEmail.js.map +1 -0
- package/dist/ShareViaLink.js +628 -0
- package/dist/ShareViaLink.js.map +1 -0
- package/dist/Sidebar.js +972 -0
- package/dist/Sidebar.js.map +1 -0
- package/dist/SubHeader.js +216 -0
- package/dist/SubHeader.js.map +1 -0
- package/dist/{TableWrapper/index.js → TableWrapper.js} +6 -3
- package/dist/TableWrapper.js.map +1 -0
- package/dist/ThemeSidebar.js +1984 -0
- package/dist/ThemeSidebar.js.map +1 -0
- package/dist/TimeFormat.js +47 -0
- package/dist/TimeFormat.js.map +1 -0
- package/dist/TimezoneMismatchModal.js +168 -0
- package/dist/TimezoneMismatchModal.js.map +1 -0
- package/dist/ToggleFeatureCard.js +323 -0
- package/dist/ToggleFeatureCard.js.map +1 -0
- package/package.json +22 -13
- package/dist/AutoSaveInput/autosaveinput.scss +0 -15
- package/dist/AutoSaveInput/constants.js +0 -13
- package/dist/AutoSaveInput/index.js +0 -124
- package/dist/AutoSaveInput/utils.js +0 -10
- package/dist/Breadcrumbs/breadcrumbs.scss +0 -33
- package/dist/Breadcrumbs/index.js +0 -31
- package/dist/BrowserSupport/Callout.js +0 -15
- package/dist/BrowserSupport/ContactUs.js +0 -21
- package/dist/BrowserSupport/DownloadLink.js +0 -17
- package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +0 -17
- package/dist/BrowserSupport/UnknownBrowser.js +0 -13
- package/dist/BrowserSupport/UnsupportedBrowser.js +0 -24
- package/dist/BrowserSupport/UnsupportedBrowserMessage.js +0 -22
- package/dist/BrowserSupport/UnsupportedBrowserVersion.js +0 -27
- package/dist/BrowserSupport/UnsupportedVersionMessage.js +0 -30
- package/dist/BrowserSupport/browsersupport.scss +0 -71
- package/dist/BrowserSupport/constants.js +0 -63
- package/dist/BrowserSupport/index.js +0 -58
- package/dist/BrowserSupport/utils.js +0 -32
- package/dist/Builder/Body.js +0 -9
- package/dist/Builder/ElementsPanel/ElementsList/Element.js +0 -27
- package/dist/Builder/ElementsPanel/ElementsList/Section.js +0 -28
- package/dist/Builder/ElementsPanel/ElementsList/TitleBar.js +0 -28
- package/dist/Builder/ElementsPanel/ElementsList/index.js +0 -63
- package/dist/Builder/ElementsPanel/SelectedElementsList/SelectedElement.js +0 -73
- package/dist/Builder/ElementsPanel/SelectedElementsList/TitleBar.js +0 -50
- package/dist/Builder/ElementsPanel/SelectedElementsList/index.js +0 -91
- package/dist/Builder/ElementsPanel/index.js +0 -70
- package/dist/Builder/PropertiesPanel/EmptyProperty.js +0 -21
- package/dist/Builder/PropertiesPanel/Skeleton.js +0 -24
- package/dist/Builder/PropertiesPanel/index.js +0 -12
- package/dist/Builder/index.js +0 -3
- package/dist/Builder/styles.scss +0 -84
- package/dist/CalendarView/CustomDatePicker.js +0 -87
- package/dist/CalendarView/Header.js +0 -53
- package/dist/CalendarView/constants.js +0 -19
- package/dist/CalendarView/index.js +0 -83
- package/dist/CalendarView/utils.js +0 -50
- package/dist/Codeblock/index.js +0 -30
- package/dist/Columns/utils.js +0 -20
- package/dist/ConfirmationModal/constants.js +0 -3
- package/dist/ConfirmationModal/utils.js +0 -6
- package/dist/Container/container.scss +0 -21
- package/dist/Container/index.js +0 -23
- package/dist/CopyToClipboardButton/constants.js +0 -13
- package/dist/CopyToClipboardButton/copyToClipboard.scss +0 -22
- package/dist/CopyToClipboardButton/index.js +0 -59
- package/dist/CustomDomain/index.js +0 -98
- package/dist/CustomDomainDashboard/DeleteAlert.js +0 -28
- package/dist/CustomDomainDashboard/Header.js +0 -32
- package/dist/CustomDomainDashboard/Manage/Record.js +0 -42
- package/dist/CustomDomainDashboard/Manage/StatusInfo.js +0 -21
- package/dist/CustomDomainDashboard/Manage/TagBlock.js +0 -36
- package/dist/CustomDomainDashboard/Manage/constants.js +0 -4
- package/dist/CustomDomainDashboard/Manage/index.js +0 -125
- package/dist/CustomDomainDashboard/Manage/utils.js +0 -8
- package/dist/CustomDomainDashboard/api.js +0 -35
- package/dist/CustomDomainDashboard/constants.js +0 -2
- package/dist/CustomDomainDashboard/index.js +0 -118
- package/dist/CustomDomainDashboard/useCustomDomainApi.js +0 -71
- package/dist/CustomDomainDashboard/utils.js +0 -84
- package/dist/DateRangeFilter/index.js +0 -60
- package/dist/DateRangeFilter/utils.js +0 -113
- package/dist/DynamicVariables/dynamic-variables.scss +0 -34
- package/dist/DynamicVariables/index.js +0 -59
- package/dist/DynamicVariables/utils.js +0 -37
- package/dist/EmailForm/EmailForm.js +0 -98
- package/dist/EmailForm/EmailFormProvider.js +0 -45
- package/dist/EmailForm/EmailPreview.js +0 -129
- package/dist/EmailForm/ReplyToField.js +0 -55
- package/dist/EmailForm/SendToField.js +0 -28
- package/dist/EmailForm/SubjectField.js +0 -64
- package/dist/EmailForm/constants.js +0 -33
- package/dist/EmailForm/contexts/EmailForm.js +0 -7
- package/dist/EmailForm/index.js +0 -4
- package/dist/EmailForm/utils.js +0 -10
- package/dist/EmailPreview/index.js +0 -2
- package/dist/ErrorPage/index.js +0 -78
- package/dist/Header/Breadcrumbs.js +0 -31
- package/dist/Header/Dropdown.js +0 -12
- package/dist/Header/constants.js +0 -6
- package/dist/Header/header.scss +0 -121
- package/dist/Header/index.js +0 -61
- package/dist/IconPicker/Icon.js +0 -34
- package/dist/IconPicker/NoResults.js +0 -12
- package/dist/IconPicker/constants.js +0 -8
- package/dist/IconPicker/icon-picker.scss +0 -1
- package/dist/IconPicker/index.js +0 -164
- package/dist/ImageWithFallback/ImagePlaceholder.js +0 -16
- package/dist/ImageWithFallback/index.js +0 -31
- package/dist/IntegrationCard/Dropdown.js +0 -45
- package/dist/IntegrationCard/Status.js +0 -25
- package/dist/IntegrationCard/index.js +0 -128
- package/dist/IntegrationDisconnectAlert/index.js +0 -36
- package/dist/IpRestriction/AllowedIpRanges.js +0 -75
- package/dist/IpRestriction/CurrentIp.js +0 -26
- package/dist/IpRestriction/FormRow.js +0 -84
- package/dist/IpRestriction/Row.js +0 -91
- package/dist/IpRestriction/apis/allowed_ip_ranges.js +0 -28
- package/dist/IpRestriction/apis/current_ip.js +0 -11
- package/dist/IpRestriction/apis/ip_restriction.js +0 -16
- package/dist/IpRestriction/constants.js +0 -20
- package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +0 -34
- package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +0 -10
- package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +0 -18
- package/dist/IpRestriction/index.js +0 -102
- package/dist/IpRestriction/utils.js +0 -85
- package/dist/KeyboardShortcuts/Pane/HotKey.js +0 -44
- package/dist/KeyboardShortcuts/Pane/HotKeyList.js +0 -42
- package/dist/KeyboardShortcuts/Pane/constants.js +0 -25
- package/dist/KeyboardShortcuts/Pane/index.js +0 -61
- package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +0 -5
- package/dist/KeyboardShortcuts/Pane/utils.js +0 -66
- package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +0 -31
- package/dist/KeyboardShortcuts/index.js +0 -9
- package/dist/LoginPage/Form.js +0 -57
- package/dist/LoginPage/constants.js +0 -12
- package/dist/LoginPage/index.js +0 -103
- package/dist/MenuBar/AddNew.js +0 -25
- package/dist/MenuBar/Block.js +0 -60
- package/dist/MenuBar/Item.js +0 -32
- package/dist/MenuBar/Search.js +0 -39
- package/dist/MenuBar/SubTitle.js +0 -23
- package/dist/MenuBar/index.js +0 -46
- package/dist/MenuBar/menubar.scss +0 -154
- package/dist/Metadata/Block.js +0 -30
- package/dist/Metadata/DetailsBlock.js +0 -86
- package/dist/Metadata/constants.js +0 -9
- package/dist/Metadata/index.js +0 -29
- package/dist/Metadata/metadata.scss +0 -15
- package/dist/MoreDropdown/constants.js +0 -25
- package/dist/NavigationHeader/LeftBlock.js +0 -32
- package/dist/NavigationHeader/Navigation.js +0 -24
- package/dist/NavigationHeader/RightBlock.js +0 -68
- package/dist/NavigationHeader/constants.js +0 -11
- package/dist/NavigationHeader/index.js +0 -19
- package/dist/NavigationHeader/navigation-header.scss +0 -3
- package/dist/NeetoWidget/CodeBlock.js +0 -57
- package/dist/NeetoWidget/CodeSnippet.js +0 -119
- package/dist/NeetoWidget/EmbedCode.js +0 -281
- package/dist/NeetoWidget/Main.js +0 -19
- package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +0 -25
- package/dist/NeetoWidget/SelectionSwitches/index.js +0 -44
- package/dist/NeetoWidget/SyntaxHighlighter.js +0 -17
- package/dist/NeetoWidget/api.js +0 -20
- package/dist/NeetoWidget/constants.js +0 -62
- package/dist/NeetoWidget/hooks/useForceUpdate.js +0 -14
- package/dist/NeetoWidget/index.js +0 -7
- package/dist/NeetoWidget/mutations.js +0 -9
- package/dist/NeetoWidget/queries.js +0 -32
- package/dist/NeetoWidget/utils.js +0 -83
- package/dist/PageLoader/index.js +0 -81
- package/dist/PageLoader/page-loader.scss +0 -95
- package/dist/PhoneNumber/CountryPicker/SingleValue.js +0 -21
- package/dist/PhoneNumber/CountryPicker/constants.js +0 -26
- package/dist/PhoneNumber/CountryPicker/index.js +0 -59
- package/dist/PhoneNumber/FormikPhoneNumberInput.js +0 -21
- package/dist/PhoneNumber/PhoneNumber.js +0 -30
- package/dist/PhoneNumber/PhoneNumberInput.js +0 -79
- package/dist/PhoneNumber/index.js +0 -5
- package/dist/PhoneNumber/utils.js +0 -55
- package/dist/PublishBlock/AlertBlock.js +0 -14
- package/dist/PublishBlock/index.js +0 -100
- package/dist/PublishBlock/publish-block.scss +0 -25
- package/dist/Rename/DummySpan.js +0 -21
- package/dist/Rename/constants.js +0 -1
- package/dist/Rename/index.js +0 -191
- package/dist/Rename/rename.scss +0 -69
- package/dist/Rename/utils.js +0 -10
- package/dist/ResponsiveDevicePicker/constants.js +0 -19
- package/dist/ResponsiveDevicePicker/index.js +0 -36
- package/dist/Schedule/DisplayAvailability.js +0 -58
- package/dist/Schedule/Fields.js +0 -43
- package/dist/Schedule/Form/ScheduleRow.js +0 -125
- package/dist/Schedule/Form/constants.js +0 -20
- package/dist/Schedule/Form/index.js +0 -144
- package/dist/Schedule/Form/utils.js +0 -63
- package/dist/Schedule/Header.js +0 -76
- package/dist/Schedule/ScheduleContext.js +0 -8
- package/dist/Schedule/constants.js +0 -8
- package/dist/Schedule/dayjsExtended/constants.js +0 -1
- package/dist/Schedule/dayjsExtended/index.js +0 -14
- package/dist/Schedule/dayjsExtended/range.js +0 -73
- package/dist/Schedule/index.js +0 -80
- package/dist/Schedule/utils.js +0 -152
- package/dist/Scrollable/constants.js +0 -8
- package/dist/Scrollable/index.js +0 -26
- package/dist/Scrollable/scrollable.scss +0 -32
- package/dist/Search/index.js +0 -52
- package/dist/Security/AllowedKeywords/Add.js +0 -38
- package/dist/Security/AllowedKeywords/index.js +0 -38
- package/dist/Security/PasswordBlock.js +0 -31
- package/dist/Security/RadioBlock.js +0 -38
- package/dist/Security/api.js +0 -12
- package/dist/Security/constants.js +0 -58
- package/dist/Security/index.js +0 -68
- package/dist/Security/useSecurityApi.js +0 -22
- package/dist/Security/utils.js +0 -31
- package/dist/SendToFields/FilePicker.js +0 -34
- package/dist/SendToFields/constants.js +0 -6
- package/dist/SendToFields/index.js +0 -102
- package/dist/SendToFields/utils.js +0 -54
- package/dist/Settings/Category.js +0 -30
- package/dist/Settings/Item.js +0 -38
- package/dist/Settings/index.js +0 -37
- package/dist/Settings/utils.js +0 -4
- package/dist/ShareViaEmail/EmailBodyEditor.js +0 -22
- package/dist/ShareViaEmail/FilePicker.js +0 -43
- package/dist/ShareViaEmail/Form.js +0 -105
- package/dist/ShareViaEmail/FormikDatePicker.js +0 -24
- package/dist/ShareViaEmail/constants.js +0 -14
- package/dist/ShareViaEmail/index.js +0 -92
- package/dist/ShareViaEmail/utils.js +0 -72
- package/dist/ShareViaLink/EditURL.js +0 -74
- package/dist/ShareViaLink/Link.js +0 -105
- package/dist/ShareViaLink/QRCode.js +0 -41
- package/dist/ShareViaLink/RegenerateURL.js +0 -47
- package/dist/ShareViaLink/SocialMedia.js +0 -52
- package/dist/ShareViaLink/constants.js +0 -25
- package/dist/ShareViaLink/edit-url.scss +0 -8
- package/dist/ShareViaLink/index.js +0 -46
- package/dist/ShareViaLink/utils.js +0 -47
- package/dist/Sidebar/AppSwitcher/AppLink.js +0 -45
- package/dist/Sidebar/AppSwitcher/Backdrop.js +0 -13
- package/dist/Sidebar/AppSwitcher/Body.js +0 -65
- package/dist/Sidebar/AppSwitcher/Portal.js +0 -27
- package/dist/Sidebar/AppSwitcher/appswitcher.scss +0 -164
- package/dist/Sidebar/AppSwitcher/index.js +0 -47
- package/dist/Sidebar/AppSwitcher/utils.js +0 -25
- package/dist/Sidebar/Chevron.js +0 -14
- package/dist/Sidebar/FeaturedTooltip.js +0 -19
- package/dist/Sidebar/Footer/AppSwitcherButton.js +0 -48
- package/dist/Sidebar/Footer/ProfileButton.js +0 -30
- package/dist/Sidebar/Footer/index.js +0 -56
- package/dist/Sidebar/Footer/utils.js +0 -39
- package/dist/Sidebar/Header.js +0 -33
- package/dist/Sidebar/HelpSection/HelpSectionMenu.js +0 -52
- package/dist/Sidebar/HelpSection/index.js +0 -32
- package/dist/Sidebar/Links.js +0 -112
- package/dist/Sidebar/NavIconWrapper.js +0 -20
- package/dist/Sidebar/ProfileSection/LinkSection.js +0 -36
- package/dist/Sidebar/ProfileSection/ProfileMenu.js +0 -48
- package/dist/Sidebar/ProfileSection/index.js +0 -42
- package/dist/Sidebar/constants.js +0 -40
- package/dist/Sidebar/index.js +0 -94
- package/dist/Sidebar/sidebar.scss +0 -379
- package/dist/Sidebar/utils.js +0 -18
- package/dist/SubHeader/RightBlock/Columns.js +0 -35
- package/dist/SubHeader/RightBlock/Download.js +0 -28
- package/dist/SubHeader/RightBlock/Filter.js +0 -31
- package/dist/SubHeader/RightBlock/index.js +0 -21
- package/dist/SubHeader/RightBlock/utils.js +0 -13
- package/dist/SubHeader/index.js +0 -28
- package/dist/SubHeader/subheader.scss +0 -78
- package/dist/ThemeSidebar/Customize/Logo.js +0 -39
- package/dist/ThemeSidebar/Customize/Properties.js +0 -170
- package/dist/ThemeSidebar/Customize/index.js +0 -66
- package/dist/ThemeSidebar/Themes/ThemeCard.js +0 -135
- package/dist/ThemeSidebar/Themes/index.js +0 -110
- package/dist/ThemeSidebar/TitleBar.js +0 -62
- package/dist/ThemeSidebar/constants.js +0 -127
- package/dist/ThemeSidebar/fields/AlignmentBlock.js +0 -50
- package/dist/ThemeSidebar/fields/Card.js +0 -19
- package/dist/ThemeSidebar/fields/ColorBlock.js +0 -19
- package/dist/ThemeSidebar/fields/FontPickerBlock.js +0 -35
- package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +0 -67
- package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +0 -22
- package/dist/ThemeSidebar/fields/ImageBlock/index.js +0 -55
- package/dist/ThemeSidebar/fields/SelectBlock.js +0 -24
- package/dist/ThemeSidebar/fields/SliderBlock.js +0 -30
- package/dist/ThemeSidebar/fields/SwitchBlock.js +0 -17
- package/dist/ThemeSidebar/fields/TextBlock.js +0 -13
- package/dist/ThemeSidebar/fields/slider.scss +0 -199
- package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +0 -149
- package/dist/ThemeSidebar/index.js +0 -118
- package/dist/ThemeSidebar/themeSidebar.scss +0 -45
- package/dist/ThemeSidebar/utils.js +0 -169
- package/dist/TimeFormat/index.js +0 -3
- package/dist/TimezoneMismatchModal/apis/time_zone.js +0 -9
- package/dist/TimezoneMismatchModal/index.js +0 -83
- package/dist/TimezoneMismatchModal/useTimeZoneApi.js +0 -10
- package/dist/TimezoneMismatchModal/utils.js +0 -12
- package/dist/ToggleFeatureCard/ToolTipSwitch.js +0 -31
- package/dist/ToggleFeatureCard/constants.js +0 -5
- package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +0 -11
- package/dist/ToggleFeatureCard/index.js +0 -148
- package/dist/ToggleFeatureCard/toggleFeatureCard.scss +0 -4
package/dist/Schedule/utils.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
import { ianaTimezoneToHumanReadable } from "@bigbinary/neeto-time-zones";
|
|
6
|
-
import dayjs from "dayjs";
|
|
7
|
-
import i18next from "i18next";
|
|
8
|
-
import { findIndexBy } from "@bigbinary/neeto-commons-frontend/pure";
|
|
9
|
-
import { timeFormat } from "@bigbinary/neeto-commons-frontend/utils";
|
|
10
|
-
import * as yup from "yup";
|
|
11
|
-
import dayjsExtended from "./dayjsExtended";
|
|
12
|
-
import { SLOT_TIME_FORMAT } from "./Form/constants";
|
|
13
|
-
yup.addMethod(yup.array, "ensureSlotsCantOverlap", function () {
|
|
14
|
-
return this.test("ensureSlotsCantOverlap", function (periods) {
|
|
15
|
-
var _checkForOverlapBetwe = checkForOverlapBetweenPeriods(periods),
|
|
16
|
-
isOverlapping = _checkForOverlapBetwe.exists,
|
|
17
|
-
range1 = _checkForOverlapBetwe.range1,
|
|
18
|
-
range2 = _checkForOverlapBetwe.range2;
|
|
19
|
-
if (!isOverlapping) return true;
|
|
20
|
-
var _findIndicesOfOverlap = findIndicesOfOverlappingRangesInPeriods({
|
|
21
|
-
range1: range1,
|
|
22
|
-
range2: range2,
|
|
23
|
-
periods: periods
|
|
24
|
-
}),
|
|
25
|
-
firstIndex = _findIndicesOfOverlap.firstIndex,
|
|
26
|
-
secondIndex = _findIndicesOfOverlap.secondIndex;
|
|
27
|
-
var firstError = this.createError({
|
|
28
|
-
path: "".concat(this.path, "[").concat(firstIndex, "]"),
|
|
29
|
-
message: i18next.t("neetoMolecules.schedule.errors.period.overlap", {
|
|
30
|
-
start: timeFormat.time(range2.startDate),
|
|
31
|
-
end: timeFormat.time(range2.endDate)
|
|
32
|
-
})
|
|
33
|
-
});
|
|
34
|
-
var secondError = this.createError({
|
|
35
|
-
path: "".concat(this.path, "[").concat(secondIndex, "]"),
|
|
36
|
-
message: i18next.t("neetoMolecules.schedule.errors.period.overlap", {
|
|
37
|
-
start: timeFormat.time(range1.startDate),
|
|
38
|
-
end: timeFormat.time(range1.endDate)
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
return new yup.ValidationError([firstError, secondError]);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
var isFromAndToSame = function isFromAndToSame(startTime, endTime) {
|
|
45
|
-
if (!startTime || !endTime) return true;
|
|
46
|
-
return dayjs(startTime, SLOT_TIME_FORMAT).isSame(dayjs(endTime, SLOT_TIME_FORMAT));
|
|
47
|
-
};
|
|
48
|
-
export var getScheduleValidationSchema = function getScheduleValidationSchema() {
|
|
49
|
-
return yup.object().shape({
|
|
50
|
-
wdays: yup.array().of(yup.object().shape({
|
|
51
|
-
periods: yup.array().of(yup.object().shape({
|
|
52
|
-
startTime: yup.string().required(i18next.t("neetoMolecules.schedule.errors.period.startTime")),
|
|
53
|
-
endTime: yup.string().required(i18next.t("neetoMolecules.schedule.errors.period.endTime")).test("ensureToTimeNotBehindFromTime", i18next.t("neetoMolecules.schedule.errors.period.isBehind"), function (value) {
|
|
54
|
-
var startTime = this.parent.startTime;
|
|
55
|
-
if (isFromAndToSame(value, startTime)) return true;
|
|
56
|
-
return isTimeBehind(startTime, value);
|
|
57
|
-
})
|
|
58
|
-
}).test("ensureTimeNotSame", i18next.t("neetoMolecules.schedule.errors.period.sameTime"), function (value) {
|
|
59
|
-
var startTime = value.startTime,
|
|
60
|
-
endTime = value.endTime;
|
|
61
|
-
return !isFromAndToSame(startTime, endTime);
|
|
62
|
-
})).ensureSlotsCantOverlap()
|
|
63
|
-
}))
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
export var getUserTimeZone = function getUserTimeZone() {
|
|
67
|
-
var _window$globalProps;
|
|
68
|
-
return (_window$globalProps = window.globalProps) === null || _window$globalProps === void 0 ? void 0 : _window$globalProps.user.timeZone;
|
|
69
|
-
};
|
|
70
|
-
export var getTimeZoneAndTime = function getTimeZoneAndTime() {
|
|
71
|
-
var timeZone = getUserTimeZone();
|
|
72
|
-
var humanReadableTimezone = ianaTimezoneToHumanReadable(timeZone);
|
|
73
|
-
return "".concat(humanReadableTimezone, ": ").concat(dayjs().tz(timeZone).format(SLOT_TIME_FORMAT));
|
|
74
|
-
};
|
|
75
|
-
export var isTimeBehind = function isTimeBehind(timeA, timeB) {
|
|
76
|
-
return dayjs(timeA, SLOT_TIME_FORMAT).isBefore(dayjs(timeB, SLOT_TIME_FORMAT));
|
|
77
|
-
};
|
|
78
|
-
export var sortPeriodsByKey = function sortPeriodsByKey(_ref) {
|
|
79
|
-
var periods = _ref.periods,
|
|
80
|
-
key = _ref.key,
|
|
81
|
-
_ref$order = _ref.order,
|
|
82
|
-
order = _ref$order === void 0 ? "desc" : _ref$order;
|
|
83
|
-
return periods.slice().sort(function (periodA, periodB) {
|
|
84
|
-
var isPeriodBehind = isTimeBehind(periodA[key], periodB[key]);
|
|
85
|
-
if (order === "desc") return isPeriodBehind ? 1 : -1;
|
|
86
|
-
return isPeriodBehind ? -1 : 1;
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Check for overlapping between entered periods
|
|
92
|
-
* @typedef {Object} Slots
|
|
93
|
-
* @property {Array<{startTime:string, endTime: string}>} periods - startTime and endTime
|
|
94
|
-
* @param {Slots} periods - changed time periods
|
|
95
|
-
* @return {{exists: boolean, range1: DayjsRange | null, range2:DayjsRange | null }} - overlapped ranges if exists
|
|
96
|
-
*/
|
|
97
|
-
export var checkForOverlapBetweenPeriods = function checkForOverlapBetweenPeriods(periods) {
|
|
98
|
-
var response = {
|
|
99
|
-
exists: false,
|
|
100
|
-
range1: null,
|
|
101
|
-
range2: null
|
|
102
|
-
};
|
|
103
|
-
if (!(periods !== null && periods !== void 0 && periods.length)) return response;
|
|
104
|
-
var slotsSortedByStartTime = sortPeriodsByKey({
|
|
105
|
-
periods: periods,
|
|
106
|
-
key: "startTime"
|
|
107
|
-
});
|
|
108
|
-
var _iterator = _createForOfIteratorHelper(slotsSortedByStartTime.slice(0, -1).entries()),
|
|
109
|
-
_step;
|
|
110
|
-
try {
|
|
111
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
112
|
-
var _step$value = _slicedToArray(_step.value, 2),
|
|
113
|
-
index = _step$value[0],
|
|
114
|
-
value = _step$value[1];
|
|
115
|
-
var seg1 = value;
|
|
116
|
-
var seg2 = slotsSortedByStartTime[index + 1];
|
|
117
|
-
var range1 = dayjsExtended.range(dayjsExtended(seg1.startTime, SLOT_TIME_FORMAT), dayjsExtended(seg1.endTime, SLOT_TIME_FORMAT));
|
|
118
|
-
var range2 = dayjsExtended.range(dayjsExtended(seg2.startTime, SLOT_TIME_FORMAT), dayjsExtended(seg2.endTime, SLOT_TIME_FORMAT));
|
|
119
|
-
if (range1.isOverlap(range2)) {
|
|
120
|
-
response = {
|
|
121
|
-
exists: true,
|
|
122
|
-
range1: range1,
|
|
123
|
-
range2: range2
|
|
124
|
-
};
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
} catch (err) {
|
|
129
|
-
_iterator.e(err);
|
|
130
|
-
} finally {
|
|
131
|
-
_iterator.f();
|
|
132
|
-
}
|
|
133
|
-
return response;
|
|
134
|
-
};
|
|
135
|
-
export var findIndicesOfOverlappingRangesInPeriods = function findIndicesOfOverlappingRangesInPeriods(_ref2) {
|
|
136
|
-
var range1 = _ref2.range1,
|
|
137
|
-
range2 = _ref2.range2,
|
|
138
|
-
periods = _ref2.periods;
|
|
139
|
-
var firstIndex = findIndexBy({
|
|
140
|
-
startTime: range1.startDate.format(SLOT_TIME_FORMAT)
|
|
141
|
-
}, periods);
|
|
142
|
-
var secondIndex = periods.findIndex(function (slot, index) {
|
|
143
|
-
return index > firstIndex && slot.startTime === range2.startDate.format(SLOT_TIME_FORMAT);
|
|
144
|
-
});
|
|
145
|
-
return {
|
|
146
|
-
firstIndex: firstIndex,
|
|
147
|
-
secondIndex: secondIndex
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
export var checkIfTwoTimeZonesAreSame = function checkIfTwoTimeZonesAreSame(timeZone1, timeZone2) {
|
|
151
|
-
return dayjs().tz(timeZone1).format("Z") === dayjs().tz(timeZone2).format("Z");
|
|
152
|
-
};
|
package/dist/Scrollable/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "className", "size"];
|
|
5
|
-
import React from "react";
|
|
6
|
-
import classnames from "classnames";
|
|
7
|
-
import { SIZES } from "./constants";
|
|
8
|
-
import "./scrollable.scss";
|
|
9
|
-
var Scrollable = function Scrollable(_ref) {
|
|
10
|
-
var children = _ref.children,
|
|
11
|
-
_ref$className = _ref.className,
|
|
12
|
-
className = _ref$className === void 0 ? "" : _ref$className,
|
|
13
|
-
_ref$size = _ref.size,
|
|
14
|
-
size = _ref$size === void 0 ? "small" : _ref$size,
|
|
15
|
-
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
17
|
-
className: classnames(["neeto-molecules-scrollable", _defineProperty({
|
|
18
|
-
"neeto-molecules-scrollable--nano": size === SIZES.nano,
|
|
19
|
-
"neeto-molecules-scrollable--small": size === SIZES.small,
|
|
20
|
-
"neeto-molecules-scrollable--medium": size === SIZES.medium,
|
|
21
|
-
"neeto-molecules-scrollable--large": size === SIZES.large,
|
|
22
|
-
"neeto-molecules-scrollable--viewport": size === SIZES.viewport
|
|
23
|
-
}, className, className)])
|
|
24
|
-
}, otherProps), children);
|
|
25
|
-
};
|
|
26
|
-
export default Scrollable;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.neeto-molecules-scrollable {
|
|
2
|
-
flex-grow: 1;
|
|
3
|
-
overflow-y: auto;
|
|
4
|
-
|
|
5
|
-
&.neeto-molecules-scrollable--nano {
|
|
6
|
-
height: calc(
|
|
7
|
-
100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) -
|
|
8
|
-
var(--neeto-molecules-sub-header-height) -
|
|
9
|
-
var(--neeto-molecules-sub-header-bottom-margin)
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&.neeto-molecules-scrollable--small {
|
|
14
|
-
height: calc(
|
|
15
|
-
100vh - var(--neeto-molecules-main-header-height) -
|
|
16
|
-
var(--neeto-molecules-sub-header-height) -
|
|
17
|
-
var(--neeto-molecules-sub-header-bottom-margin)
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.neeto-molecules-scrollable--medium {
|
|
22
|
-
height: calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.neeto-molecules-scrollable--large {
|
|
26
|
-
height: calc(100vh - var(--neeto-molecules-main-header-height));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&.neeto-molecules-scrollable--viewport {
|
|
30
|
-
height: 100vh;
|
|
31
|
-
}
|
|
32
|
-
}
|
package/dist/Search/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["value", "debounceTime", "onChange", "onSearch"];
|
|
5
|
-
import React, { useEffect, useState } from "react";
|
|
6
|
-
import { useDebounce } from "@bigbinary/neeto-commons-frontend/react-utils";
|
|
7
|
-
import { Search as NeetoUISearchIcon } from "@bigbinary/neeto-icons";
|
|
8
|
-
import { Input } from "@bigbinary/neetoui";
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
|
-
var Search = function Search(_ref) {
|
|
11
|
-
var _ref$value = _ref.value,
|
|
12
|
-
value = _ref$value === void 0 ? "" : _ref$value,
|
|
13
|
-
_ref$debounceTime = _ref.debounceTime,
|
|
14
|
-
debounceTime = _ref$debounceTime === void 0 ? 300 : _ref$debounceTime,
|
|
15
|
-
onChange = _ref.onChange,
|
|
16
|
-
onSearch = _ref.onSearch,
|
|
17
|
-
inputProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
|
-
var _useTranslation = useTranslation(),
|
|
19
|
-
t = _useTranslation.t;
|
|
20
|
-
var _useState = useState(value),
|
|
21
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
-
internalValue = _useState2[0],
|
|
23
|
-
setInternalValue = _useState2[1];
|
|
24
|
-
var _useState3 = useState(),
|
|
25
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
|
-
untrimmedValue = _useState4[0],
|
|
27
|
-
setUntrimmedValue = _useState4[1];
|
|
28
|
-
useEffect(function () {
|
|
29
|
-
if (untrimmedValue && untrimmedValue.includes(value)) {
|
|
30
|
-
setInternalValue(untrimmedValue);
|
|
31
|
-
} else {
|
|
32
|
-
setInternalValue(value);
|
|
33
|
-
}
|
|
34
|
-
}, [value]);
|
|
35
|
-
var debouncedValue = useDebounce(internalValue, debounceTime);
|
|
36
|
-
useEffect(function () {
|
|
37
|
-
onSearch === null || onSearch === void 0 ? void 0 : onSearch(debouncedValue.trim());
|
|
38
|
-
}, [debouncedValue, onSearch]);
|
|
39
|
-
var handleOnChange = function handleOnChange(e) {
|
|
40
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
41
|
-
setInternalValue(e.target.value);
|
|
42
|
-
setUntrimmedValue(e.target.value);
|
|
43
|
-
};
|
|
44
|
-
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
45
|
-
placeholder: t("neetoMolecules.common.actions.search"),
|
|
46
|
-
prefix: /*#__PURE__*/React.createElement(NeetoUISearchIcon, null),
|
|
47
|
-
type: "search",
|
|
48
|
-
value: internalValue,
|
|
49
|
-
onChange: handleOnChange
|
|
50
|
-
}, inputProps));
|
|
51
|
-
};
|
|
52
|
-
export default Search;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import { useFormikContext } from "formik";
|
|
4
|
-
import { Delete } from "@bigbinary/neeto-icons";
|
|
5
|
-
import { Button } from "@bigbinary/neetoui";
|
|
6
|
-
import { Input } from "@bigbinary/neetoui/formik";
|
|
7
|
-
import { remove } from "ramda";
|
|
8
|
-
import { useTranslation } from "react-i18next";
|
|
9
|
-
var Add = function Add() {
|
|
10
|
-
var _useTranslation = useTranslation(),
|
|
11
|
-
t = _useTranslation.t;
|
|
12
|
-
var _useFormikContext = useFormikContext(),
|
|
13
|
-
setFieldValue = _useFormikContext.setFieldValue,
|
|
14
|
-
allowedKeywords = _useFormikContext.values.allowedKeywords;
|
|
15
|
-
var removeKeyword = function removeKeyword(index) {
|
|
16
|
-
return setFieldValue("allowedKeywords", remove(index, 1, allowedKeywords));
|
|
17
|
-
};
|
|
18
|
-
if (!allowedKeywords) return null;
|
|
19
|
-
return allowedKeywords.map(function (_, index) {
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: classNames("flex w-full items-start justify-between gap-x-2"),
|
|
22
|
-
key: index
|
|
23
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
24
|
-
autoFocus: true,
|
|
25
|
-
"data-cy": "keyword-input-field-".concat(index),
|
|
26
|
-
name: "allowedKeywords[".concat(index, "]"),
|
|
27
|
-
placeholder: t("neetoMolecules.security.placeholders.enterKeyword")
|
|
28
|
-
}), /*#__PURE__*/React.createElement(Button, {
|
|
29
|
-
"data-cy": "keyword-remove-button-".concat(index),
|
|
30
|
-
icon: Delete,
|
|
31
|
-
style: "text",
|
|
32
|
-
onClick: function onClick() {
|
|
33
|
-
return removeKeyword(index);
|
|
34
|
-
}
|
|
35
|
-
}));
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
export default Add;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { ErrorMessage, useFormikContext } from "formik";
|
|
4
|
-
import { globalProps } from "@bigbinary/neeto-commons-frontend/initializers";
|
|
5
|
-
import { Button, Label } from "@bigbinary/neetoui";
|
|
6
|
-
import { isEmpty } from "ramda";
|
|
7
|
-
import { useTranslation } from "react-i18next";
|
|
8
|
-
import Add from "./Add";
|
|
9
|
-
import { OTP_ENABLED, APP_NAME } from "../constants";
|
|
10
|
-
var AllowedKeywords = function AllowedKeywords() {
|
|
11
|
-
var _useTranslation = useTranslation(),
|
|
12
|
-
t = _useTranslation.t;
|
|
13
|
-
var _useFormikContext = useFormikContext(),
|
|
14
|
-
setFieldValue = _useFormikContext.setFieldValue,
|
|
15
|
-
_useFormikContext$val = _useFormikContext.values,
|
|
16
|
-
allowedKeywords = _useFormikContext$val.allowedKeywords,
|
|
17
|
-
authKind = _useFormikContext$val.authKind;
|
|
18
|
-
if (authKind !== OTP_ENABLED) return null;
|
|
19
|
-
var appName = APP_NAME[globalProps.appName];
|
|
20
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: "flex-col space-y-2 py-2"
|
|
22
|
-
}, appName && /*#__PURE__*/React.createElement(Label, null, t("neetoMolecules.security.labels.keywordForm.".concat(appName))), /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: "neeto-ui-bg-pastel-blue neeto-ui-rounded-sm w-full space-y-4 p-6"
|
|
24
|
-
}, /*#__PURE__*/React.createElement(Add, null), /*#__PURE__*/React.createElement(Button, {
|
|
25
|
-
"data-cy": "add-allowed-keyword-button",
|
|
26
|
-
"data-testid": "add-allowed-keyword-button",
|
|
27
|
-
label: t("neetoMolecules.security.labels.addKeyWord"),
|
|
28
|
-
style: "link",
|
|
29
|
-
onClick: function onClick() {
|
|
30
|
-
return setFieldValue("allowedKeywords", [].concat(_toConsumableArray(allowedKeywords), [""]));
|
|
31
|
-
}
|
|
32
|
-
})), isEmpty(allowedKeywords) && /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
33
|
-
className: "neeto-ui-text-error-600",
|
|
34
|
-
component: "div",
|
|
35
|
-
name: "allowedKeywords"
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
export default AllowedKeywords;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useFormikContext } from "formik";
|
|
3
|
-
import { Input } from "@bigbinary/neetoui/formik";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { PASSWORD_ENABLED } from "./constants";
|
|
6
|
-
var Password = function Password() {
|
|
7
|
-
var _useTranslation = useTranslation(),
|
|
8
|
-
t = _useTranslation.t;
|
|
9
|
-
var _useFormikContext = useFormikContext(),
|
|
10
|
-
authKind = _useFormikContext.values.authKind,
|
|
11
|
-
getFieldProps = _useFormikContext.getFieldProps;
|
|
12
|
-
if (authKind !== PASSWORD_ENABLED) return null;
|
|
13
|
-
var _getFieldProps = getFieldProps("password"),
|
|
14
|
-
onPasswordChange = _getFieldProps.onChange;
|
|
15
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className: "space-y-4 pb-2"
|
|
17
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
18
|
-
autoFocus: true,
|
|
19
|
-
unlimitedChars: true,
|
|
20
|
-
className: "w-7/12",
|
|
21
|
-
"data-testid": "password-block",
|
|
22
|
-
label: t("neetoMolecules.security.labels.password"),
|
|
23
|
-
name: "password",
|
|
24
|
-
placeholder: t("neetoMolecules.security.placeholders.enterPassword"),
|
|
25
|
-
onChange: function onChange(e) {
|
|
26
|
-
e.target.value = e.target.value.trim();
|
|
27
|
-
onPasswordChange(e);
|
|
28
|
-
}
|
|
29
|
-
}));
|
|
30
|
-
};
|
|
31
|
-
export default Password;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { useFormikContext } from "formik";
|
|
4
|
-
import { Radio } from "@bigbinary/neetoui/formik";
|
|
5
|
-
import { OTP_ENABLED } from "./constants";
|
|
6
|
-
var RadioBlock = function RadioBlock(_ref) {
|
|
7
|
-
var radioItems = _ref.radioItems;
|
|
8
|
-
var _useFormikContext = useFormikContext(),
|
|
9
|
-
_useFormikContext$val = _useFormikContext.values.allowedKeywords,
|
|
10
|
-
allowedKeywords = _useFormikContext$val === void 0 ? [] : _useFormikContext$val,
|
|
11
|
-
setFieldValue = _useFormikContext.setFieldValue;
|
|
12
|
-
var handleRadioChange = function handleRadioChange(_ref2) {
|
|
13
|
-
var value = _ref2.event.target.value,
|
|
14
|
-
allowedKeywords = _ref2.allowedKeywords;
|
|
15
|
-
var allowedKeywordsValue = value === OTP_ENABLED ? [].concat(_toConsumableArray(allowedKeywords), [""]) : [];
|
|
16
|
-
setFieldValue("allowedKeywords", allowedKeywordsValue);
|
|
17
|
-
setFieldValue("authKind", value);
|
|
18
|
-
};
|
|
19
|
-
return /*#__PURE__*/React.createElement(Radio, {
|
|
20
|
-
stacked: true,
|
|
21
|
-
name: "authKind",
|
|
22
|
-
onChange: function onChange(event) {
|
|
23
|
-
return handleRadioChange({
|
|
24
|
-
event: event,
|
|
25
|
-
allowedKeywords: allowedKeywords
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}, radioItems.map(function (_ref3) {
|
|
29
|
-
var label = _ref3.label,
|
|
30
|
-
value = _ref3.value;
|
|
31
|
-
return /*#__PURE__*/React.createElement(Radio.Item, {
|
|
32
|
-
key: value,
|
|
33
|
-
label: label,
|
|
34
|
-
value: value
|
|
35
|
-
});
|
|
36
|
-
}));
|
|
37
|
-
};
|
|
38
|
-
export default RadioBlock;
|
package/dist/Security/api.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
var fetch = function fetch(url) {
|
|
3
|
-
return axios.get(url);
|
|
4
|
-
};
|
|
5
|
-
var update = function update(url, payload) {
|
|
6
|
-
return axios.put(url, payload);
|
|
7
|
-
};
|
|
8
|
-
var settingsApi = {
|
|
9
|
-
fetch: fetch,
|
|
10
|
-
update: update
|
|
11
|
-
};
|
|
12
|
-
export default settingsApi;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { t } from "i18next";
|
|
2
|
-
import { identity } from "ramda";
|
|
3
|
-
import * as yup from "yup";
|
|
4
|
-
import { findKeywordDuplicates } from "./utils";
|
|
5
|
-
var NOT_SECURED = "no_auth";
|
|
6
|
-
var SESSION_AUTH = "session_auth";
|
|
7
|
-
yup.addMethod(yup.array, "unique", function (message) {
|
|
8
|
-
var mapper = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;
|
|
9
|
-
return this.test("unique", message, function (list, _ref) {
|
|
10
|
-
var authKind = _ref.parent.authKind;
|
|
11
|
-
return authKind === OTP_ENABLED && (list === null || list === void 0 ? void 0 : list.length) === new Set(list === null || list === void 0 ? void 0 : list.map(mapper)).size ? true : findKeywordDuplicates(list, message, this.createError);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
export var QUERY_KEYS = {
|
|
15
|
-
SETTINGS_LIST: "settings-list",
|
|
16
|
-
GETTING_STARTED: "getting-started",
|
|
17
|
-
INTEGRATION_SETTINGS: "integration_settings",
|
|
18
|
-
THEMES_SETTINGS: "themes_setting"
|
|
19
|
-
};
|
|
20
|
-
export var SETTINGS_STALE_TIME = 900000; // 15 mins
|
|
21
|
-
export var PASSWORD_ENABLED = "basic_auth";
|
|
22
|
-
export var OTP_ENABLED = "otp_auth";
|
|
23
|
-
export var APP_NAME = {
|
|
24
|
-
neetoKB: "KB",
|
|
25
|
-
neetoCourse: "Course"
|
|
26
|
-
};
|
|
27
|
-
export var AUTH_KINDS = [{
|
|
28
|
-
label: t("neetoMolecules.security.labels.notSecured"),
|
|
29
|
-
value: NOT_SECURED
|
|
30
|
-
}, {
|
|
31
|
-
label: t("neetoMolecules.security.labels.passwordEnabled"),
|
|
32
|
-
value: PASSWORD_ENABLED
|
|
33
|
-
}, {
|
|
34
|
-
label: t("neetoMolecules.security.labels.otpEnabled"),
|
|
35
|
-
value: OTP_ENABLED
|
|
36
|
-
}, {
|
|
37
|
-
label: t("neetoMolecules.security.labels.private"),
|
|
38
|
-
value: SESSION_AUTH
|
|
39
|
-
}];
|
|
40
|
-
export var SECURITY_SETTINGS_VALIDATION_SCHEMA = yup.object({
|
|
41
|
-
password: yup.string().when("authKind", {
|
|
42
|
-
is: PASSWORD_ENABLED,
|
|
43
|
-
then: yup.string().required(t("neetoMolecules.security.validation.required", {
|
|
44
|
-
what: t("neetoMolecules.security.labels.password")
|
|
45
|
-
})).min(4, t("neetoMolecules.security.validation.min", {
|
|
46
|
-
entity: t("neetoMolecules.security.labels.password"),
|
|
47
|
-
min: 4
|
|
48
|
-
}))
|
|
49
|
-
}),
|
|
50
|
-
allowedKeywords: yup.array().when("authKind", {
|
|
51
|
-
is: OTP_ENABLED,
|
|
52
|
-
then: yup.array().of(yup.string().trim().required(t("neetoMolecules.security.validation.required", {
|
|
53
|
-
what: t("neetoMolecules.security.labels.keyword")
|
|
54
|
-
}))).unique(t("neetoMolecules.security.placeholders.exists", {
|
|
55
|
-
what: t("neetoMolecules.security.labels.keyword")
|
|
56
|
-
}))
|
|
57
|
-
})
|
|
58
|
-
});
|
package/dist/Security/index.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { toLabelAndValue } from "@bigbinary/neeto-commons-frontend/pure";
|
|
3
|
-
import { Form, ActionBlock } from "@bigbinary/neetoui/formik";
|
|
4
|
-
import Container from "../Container";
|
|
5
|
-
import Header from "../Header";
|
|
6
|
-
import PageLoader from "../PageLoader";
|
|
7
|
-
import Scrollable from "../Scrollable";
|
|
8
|
-
import AllowedKeywords from "./AllowedKeywords";
|
|
9
|
-
import { SECURITY_SETTINGS_VALIDATION_SCHEMA } from "./constants";
|
|
10
|
-
import Password from "./PasswordBlock";
|
|
11
|
-
import RadioBlock from "./RadioBlock";
|
|
12
|
-
import { useFetchSettings, useUpdateSetting } from "./useSecurityApi";
|
|
13
|
-
import { buildSecuritySettings } from "./utils";
|
|
14
|
-
var Security = function Security(_ref) {
|
|
15
|
-
var url = _ref.url,
|
|
16
|
-
breadcrumbs = _ref.breadcrumbs,
|
|
17
|
-
title = _ref.title,
|
|
18
|
-
radioItems = _ref.radioItems;
|
|
19
|
-
var _useFetchSettings = useFetchSettings(url),
|
|
20
|
-
_useFetchSettings$dat = _useFetchSettings.data,
|
|
21
|
-
settings = _useFetchSettings$dat === void 0 ? {} : _useFetchSettings$dat,
|
|
22
|
-
isLoading = _useFetchSettings.isLoading;
|
|
23
|
-
var _useUpdateSetting = useUpdateSetting(url),
|
|
24
|
-
updateSettings = _useUpdateSetting.mutate;
|
|
25
|
-
var handleSubmit = function handleSubmit(values, _ref2) {
|
|
26
|
-
var setSubmitting = _ref2.setSubmitting;
|
|
27
|
-
updateSettings(values, {
|
|
28
|
-
onSettled: function onSettled() {
|
|
29
|
-
return setSubmitting(false);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
if (isLoading) return /*#__PURE__*/React.createElement(PageLoader, null);
|
|
34
|
-
return /*#__PURE__*/React.createElement(Container, {
|
|
35
|
-
isHeaderFixed: true
|
|
36
|
-
}, /*#__PURE__*/React.createElement(Header, {
|
|
37
|
-
"data-cy": "general-settings-heading",
|
|
38
|
-
breadcrumbs: breadcrumbs,
|
|
39
|
-
title: title
|
|
40
|
-
}), /*#__PURE__*/React.createElement(Scrollable, {
|
|
41
|
-
className: "w-full pb-6"
|
|
42
|
-
}, /*#__PURE__*/React.createElement(Form, {
|
|
43
|
-
className: "mx-auto w-full max-w-3xl space-y-6 md:px-0 lg:px-6",
|
|
44
|
-
formikProps: {
|
|
45
|
-
initialValues: buildSecuritySettings(settings),
|
|
46
|
-
validationSchema: SECURITY_SETTINGS_VALIDATION_SCHEMA,
|
|
47
|
-
onSubmit: handleSubmit,
|
|
48
|
-
enableReinitialize: true
|
|
49
|
-
}
|
|
50
|
-
}, function (_ref3) {
|
|
51
|
-
var dirty = _ref3.dirty,
|
|
52
|
-
isSubmitting = _ref3.isSubmitting;
|
|
53
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(RadioBlock, {
|
|
54
|
-
radioItems: radioItems
|
|
55
|
-
}), /*#__PURE__*/React.createElement(Password, null), /*#__PURE__*/React.createElement(AllowedKeywords, null), /*#__PURE__*/React.createElement(ActionBlock, {
|
|
56
|
-
cancelButtonProps: {
|
|
57
|
-
disabled: false,
|
|
58
|
-
className: "ml-3"
|
|
59
|
-
},
|
|
60
|
-
className: "mt-6 w-full justify-start",
|
|
61
|
-
submitButtonProps: {
|
|
62
|
-
loading: isSubmitting,
|
|
63
|
-
disabled: !dirty || isSubmitting
|
|
64
|
-
}
|
|
65
|
-
}));
|
|
66
|
-
})));
|
|
67
|
-
};
|
|
68
|
-
export default Security;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useMutationWithInvalidation } from "@bigbinary/neeto-commons-frontend/react-utils";
|
|
2
|
-
import { useQuery } from "react-query";
|
|
3
|
-
import settingsApi from "./api";
|
|
4
|
-
import { QUERY_KEYS, SETTINGS_STALE_TIME } from "./constants";
|
|
5
|
-
var SETTINGS_LIST = QUERY_KEYS.SETTINGS_LIST,
|
|
6
|
-
GETTING_STARTED = QUERY_KEYS.GETTING_STARTED,
|
|
7
|
-
THEMES_SETTINGS = QUERY_KEYS.THEMES_SETTINGS;
|
|
8
|
-
var useFetchSettings = function useFetchSettings(url) {
|
|
9
|
-
return useQuery(SETTINGS_LIST, function () {
|
|
10
|
-
return settingsApi.fetch(url);
|
|
11
|
-
}, {
|
|
12
|
-
staleTime: SETTINGS_STALE_TIME
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var useUpdateSetting = function useUpdateSetting(url) {
|
|
16
|
-
return useMutationWithInvalidation(function (payload) {
|
|
17
|
-
return settingsApi.update(url, payload);
|
|
18
|
-
}, {
|
|
19
|
-
keysToInvalidate: [SETTINGS_LIST, GETTING_STARTED, THEMES_SETTINGS]
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
export { useFetchSettings, useUpdateSetting };
|
package/dist/Security/utils.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
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; }
|
|
3
|
-
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; }
|
|
4
|
-
import { isEmpty } from "ramda";
|
|
5
|
-
import * as yup from "yup";
|
|
6
|
-
export var buildSecuritySettings = function buildSecuritySettings(settings) {
|
|
7
|
-
return _objectSpread(_objectSpread({}, settings.setting), {}, {
|
|
8
|
-
addEmail: false
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
export var findKeywordDuplicates = function findKeywordDuplicates(list, message, createError) {
|
|
12
|
-
var duplicates = {};
|
|
13
|
-
list === null || list === void 0 ? void 0 : list.forEach(function (value, index) {
|
|
14
|
-
if (duplicates[value]) {
|
|
15
|
-
duplicates[value].push(index);
|
|
16
|
-
} else {
|
|
17
|
-
duplicates[value] = [index];
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
var errors = Object.values(duplicates).map(function (index) {
|
|
21
|
-
return index.length > 1 && new yup.ValidationError(message, list[index.at(-1)], "setting.allowedKeywords[".concat(index.at(-1), "]"));
|
|
22
|
-
});
|
|
23
|
-
if (isEmpty(errors)) {
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
return createError({
|
|
27
|
-
message: function message() {
|
|
28
|
-
return errors;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React, { useRef } from "react";
|
|
2
|
-
var FilePicker = function FilePicker(_ref) {
|
|
3
|
-
var _ref$types = _ref.types,
|
|
4
|
-
types = _ref$types === void 0 ? [] : _ref$types,
|
|
5
|
-
onChange = _ref.onChange,
|
|
6
|
-
children = _ref.children;
|
|
7
|
-
var inputRef = useRef();
|
|
8
|
-
var accept = types.reduce(function (acc, ext) {
|
|
9
|
-
return "".concat(acc, ", ").concat(ext);
|
|
10
|
-
}, "");
|
|
11
|
-
var handleInputChange = function handleInputChange(_ref2) {
|
|
12
|
-
var target = _ref2.target;
|
|
13
|
-
if (!target.files) return;
|
|
14
|
-
onChange(target.files);
|
|
15
|
-
|
|
16
|
-
// This will trigger handleClick when same file is uploaded again.
|
|
17
|
-
inputRef.current.value = "";
|
|
18
|
-
handleClick();
|
|
19
|
-
};
|
|
20
|
-
var handleClick = function handleClick() {
|
|
21
|
-
if (!inputRef.current) return;
|
|
22
|
-
inputRef.current.click();
|
|
23
|
-
};
|
|
24
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
onClick: handleClick
|
|
26
|
-
}, children), /*#__PURE__*/React.createElement("input", {
|
|
27
|
-
accept: accept,
|
|
28
|
-
className: "hidden",
|
|
29
|
-
ref: inputRef,
|
|
30
|
-
type: "file",
|
|
31
|
-
onChange: handleInputChange
|
|
32
|
-
}));
|
|
33
|
-
};
|
|
34
|
-
export default FilePicker;
|