@zohodesk/dot 1.7.19 → 1.7.20-exp.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +11 -1
- package/assets/Appearance/light/mode/Dot_LightMode.module.css +11 -1
- package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +11 -1
- package/es/ActionButton/ActionButton.js +6 -6
- package/es/ActionButton/ActionButton.module.css +1 -1
- package/es/AlphabeticList/AlphabeticList.js +1 -1
- package/es/AlphabeticList/AlphabeticList.module.css +1 -1
- package/es/Attachment/Attachment.js +7 -4
- package/es/Attachment/__tests__/Attachment.spec.js +24 -0
- package/es/Attachment/__tests__/__snapshots__/Attachment.spec.js.snap +105 -0
- package/es/AttachmentViewer/AttachmentViewer.js +5 -5
- package/es/AttachmentViewer/AttachmentViewer.module.css +1 -1
- package/es/AudioPlayer/AudioPlayer.js +580 -0
- package/es/AudioPlayer/AudioPlayer.module.css +146 -0
- package/es/AudioPlayer/Timer/Timer.js +67 -0
- package/es/AudioPlayer/Timer/Timer.module.css +5 -0
- package/es/AudioPlayer/Timer/__tests__/Timer.spec.js +20 -0
- package/es/AudioPlayer/Timer/__tests__/__snapshots__/Timer.spec.js.snap +14 -0
- package/es/AudioPlayer/Timer/propTypes/defaultProps.js +4 -0
- package/es/AudioPlayer/Timer/propTypes/propTypes.js +11 -0
- package/es/AudioPlayer/__tests__/AudioPlayer.spec.js +192 -0
- package/es/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1995 -0
- package/es/AudioPlayer/propTypes/defaultProps.js +14 -0
- package/es/AudioPlayer/propTypes/propTypes.js +33 -0
- package/es/AudioPlayer/utils/utils.js +24 -0
- package/es/ChannelIcon/ChannelIcon.js +1 -1
- package/es/DotProvider/hooks/useDotProvider.js +1 -0
- package/es/Drawer/Drawer.js +6 -6
- package/es/Drawer/Drawer.module.css +1 -1
- package/es/FlipCard/FlipCard.js +3 -3
- package/es/FormAction/FormAction.js +1 -1
- package/es/FreezeLayer/FreezeLayer.js +3 -3
- package/es/Hooks/Dragger/useDragger.js +52 -33
- package/es/IconButton/IconButton.js +3 -3
- package/es/ImportantNotes/ImportantNotes.js +1 -1
- package/es/Loader/Loader.js +1 -1
- package/es/MessageBanner/MessageBanner.js +1 -1
- package/es/NewStar/NewStar.js +1 -1
- package/es/Onboarding/Onboarding.js +3 -3
- package/es/Separator/Separator.js +1 -1
- package/es/ToastMessage/ToastMessage.js +4 -4
- package/es/Upload/Upload.js +1 -1
- package/es/VideoLookup/VideoLookup.js +1 -1
- package/es/alert/AlertHeader/AlertHeader.js +1 -1
- package/es/alert/AlertLookup/AlertLookup.js +1 -1
- package/es/avatar/AvatarClose/AvatarClose.js +1 -1
- package/es/avatar/AvatarCollision/AvatarCollision.js +1 -1
- package/es/avatar/AvatarIcon/AvatarIcon.js +2 -2
- package/es/avatar/AvatarStatus/AvatarStatus.js +1 -1
- package/es/avatar/AvatarThread/AvatarThread.js +1 -1
- package/es/avatar/AvatarUser/AvatarUser.js +1 -1
- package/es/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
- package/es/deprecated/FreezeLayer/FreezeLayer.js +3 -3
- package/es/deprecated/SelectDropdown/SelectDropdown.js +7 -7
- package/es/dot_layer.module.css +1 -0
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +14 -14
- package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +1 -1
- package/es/emptystate/EditionPage/EditionPage.css +2 -2
- package/es/emptystate/EditionPage/EditionPage.js +1 -1
- package/es/errorstate/Inconvenience/Inconvenience.js +3 -3
- package/es/errorstate/NoRequestFound/NoRequestFound.js +3 -3
- package/es/errorstate/PermissionPlay/PermissionPlay.js +3 -3
- package/es/errorstate/PermissionPlay/PermissionPlay.module.css +1 -1
- package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +3 -3
- package/es/errorstate/UnableToProcess/UnableToProcess.js +3 -3
- package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -3
- package/es/errorstate/WillBack/WillBack.js +3 -3
- package/es/form/fields/CheckBoxField/CheckBoxField.js +3 -3
- package/es/form/fields/CurrencyField/CurrencyField.js +3 -3
- package/es/form/fields/DateField/DateField.js +3 -3
- package/es/form/fields/FieldContainer/FieldContainer.js +1 -1
- package/es/form/fields/Fields.module.css +4 -0
- package/es/form/fields/MultiSelectField/MultiSelectField.js +3 -3
- package/es/form/fields/PhoneField/PhoneField.js +3 -2
- package/es/form/fields/PhoneField/__tests__/__snapshots__/PhoneField.spec.js.snap +1 -1
- package/es/form/fields/RadioField/RadioField.js +2 -2
- package/es/form/fields/SelectField/SelectField.js +3 -3
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +11 -11
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +3 -3
- package/es/form/fields/TextBoxField/TextBoxField.js +3 -3
- package/es/form/fields/TextEditor/TextEditor.js +3 -2
- package/es/form/fields/TextEditor/TextEditor.module.css +2 -2
- package/es/form/fields/TextEditorField/TextEditorField.js +1 -1
- package/es/form/fields/TextEditorWrapper/TextEditorWrapper.js +2 -2
- package/es/form/fields/TextareaField/TextareaField.js +3 -3
- package/es/form/fields/ValidationMessage/ValidationMessage.js +2 -2
- package/es/form/fields/ValidationMessage/ValidationMessage.module.css +1 -0
- package/es/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
- package/es/layout/SetupDetailLayout/SetupDetailLayout.module.css +1 -1
- package/es/layout/SubtabLayout/SubtabLayout.js +2 -2
- package/es/list/Comment/Comment.js +1 -1
- package/es/list/Icons/AddNewIcon.js +1 -1
- package/es/list/Icons/CompleteIcon.js +1 -1
- package/es/list/Icons/DeleteIcon.js +1 -1
- package/es/list/Icons/EditIcon.js +1 -1
- package/es/list/Icons/ReadUnreadIcon.js +1 -1
- package/es/list/Icons/SmartIcon.js +1 -1
- package/es/list/ListLayout/ListLayout.js +1 -1
- package/es/list/ListStencils/ListStencils.js +1 -1
- package/es/list/SecondaryText/AccountName.js +1 -1
- package/es/list/SecondaryText/ContactName.js +1 -1
- package/es/list/SecondaryText/SecondaryText.module.css +8 -8
- package/es/list/SecondryPanel/SecondryPanel.js +2 -2
- package/es/list/Subject/Subject.module.css +3 -3
- package/es/list/Thread/Thread.js +1 -1
- package/es/list/status/StatusDropdown/StatusDropdown.js +10 -10
- package/es/list/status/StatusListItem/StatusListItem.js +2 -2
- package/es/lookup/EmptyPage/EmptyPage.js +4 -4
- package/es/lookup/EmptyPage/LookupEmptyPage.module.css +4 -2
- package/es/lookup/Lookup/Lookup.js +1 -1
- package/es/lookup/Section/Section.js +1 -1
- package/es/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
- package/es/lookup/header/Search/Search.js +3 -3
- package/es/lookup/header/TicketHeader/TicketHeader.js +1 -1
- package/es/lookup/header/Title/LookupTitle.module.css +7 -3
- package/es/lookup/header/ViewDropDown/ViewDropDown.js +9 -9
- package/es/lookup/header/ViewDropDown/ViewDropDown.module.css +13 -2
- package/es/setup/header/Button/Button.js +1 -1
- package/es/setup/header/Link/Link.js +1 -1
- package/es/setup/header/Search/Search.js +1 -1
- package/es/setup/header/Search/Search.module.css +1 -1
- package/es/setup/table/Table/Table.js +1 -1
- package/es/setup/table/TableBody/TableBody.js +1 -1
- package/es/setup/table/TableData/TableData.js +1 -1
- package/es/setup/table/TableHead/TableHead.js +1 -1
- package/es/setup/table/TableRow/TableRow.js +1 -1
- package/es/svg/PlusIcon.js +1 -1
- package/es/svg/SnippetIcon.js +1 -1
- package/es/svg/TemplateIcon.js +1 -1
- package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +2 -2
- package/es/v1/emptystate/EditionPage/EditionPage.js +1 -1
- package/es/v1/errorstate/Inconvenience/Inconvenience.js +1 -1
- package/es/v1/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +1 -1
- package/es/v1/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +1 -1
- package/es/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +1 -1
- package/es/v1/errorstate/UrlNotFound/UrlNotFound.js +1 -1
- package/es/v1/errorstate/WillBeRightBack/WillBeRightBack.js +1 -1
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -2
- package/es/v1/form/fields/TextEditor/TextEditor.js +2 -1
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
- package/es/v1/lookup/EmptyPage/EmptyPage.js +4 -4
- package/es/v1/lookup/header/ViewDropDown/ViewDropDown.js +1 -1
- package/es/v1/notification/DesktopNotification/DesktopNotification.js +1 -1
- package/es/v1/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +1 -1
- package/es/v1/svg/PlusIcon.js +1 -1
- package/es/v1/svg/SnippetIcon.js +1 -1
- package/es/v1/svg/TemplateIcon.js +1 -1
- package/es/version2/AlertClose/AlertClose.js +1 -1
- package/es/version2/GlobalNotification/GlobalNotification.js +1 -1
- package/es/version2/GlobalNotification/GlobalNotification.module.css +3 -2
- package/es/version2/errorstate/Inconvenience/Inconvenience.js +3 -3
- package/es/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +3 -3
- package/es/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +3 -3
- package/es/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -3
- package/es/version2/errorstate/UrlNotFound/UrlNotFound.js +3 -3
- package/es/version2/errorstate/V2_ErrorStates.module.css +1 -1
- package/es/version2/errorstate/WillBeRightBack/WillBeRightBack.js +3 -3
- package/es/version2/lookup/AlertHeader/AlertHeader.js +1 -1
- package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +9 -3
- package/es/version2/lookup/AlertLookup/AlertLookup.js +3 -3
- package/es/version2/lookup/alertLookupCommonNew.module.css +1 -1
- package/es/version2/notification/DesktopNotification/DesktopNotification.js +4 -4
- package/es/version2/notification/DesktopNotification/DesktopNotification.module.css +4 -3
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +2 -2
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +1 -0
- package/lib/ActionButton/ActionButton.js +6 -6
- package/lib/ActionButton/ActionButton.module.css +1 -1
- package/lib/AlphabeticList/AlphabeticList.js +1 -1
- package/lib/AlphabeticList/AlphabeticList.module.css +1 -1
- package/lib/Attachment/Attachment.js +7 -4
- package/lib/Attachment/__tests__/Attachment.spec.js +24 -0
- package/lib/Attachment/__tests__/__snapshots__/Attachment.spec.js.snap +105 -0
- package/lib/AttachmentViewer/AttachmentViewer.js +5 -5
- package/lib/AttachmentViewer/AttachmentViewer.module.css +1 -1
- package/lib/AudioPlayer/AudioPlayer.js +662 -0
- package/lib/AudioPlayer/AudioPlayer.module.css +146 -0
- package/lib/AudioPlayer/Timer/Timer.js +117 -0
- package/lib/AudioPlayer/Timer/Timer.module.css +5 -0
- package/lib/AudioPlayer/Timer/__tests__/Timer.spec.js +26 -0
- package/lib/AudioPlayer/Timer/__tests__/__snapshots__/Timer.spec.js.snap +14 -0
- package/lib/AudioPlayer/Timer/propTypes/defaultProps.js +11 -0
- package/lib/AudioPlayer/Timer/propTypes/propTypes.js +22 -0
- package/lib/AudioPlayer/__tests__/AudioPlayer.spec.js +210 -0
- package/lib/AudioPlayer/__tests__/__snapshots__/AudioPlayer.spec.js.snap +1995 -0
- package/lib/AudioPlayer/propTypes/defaultProps.js +24 -0
- package/lib/AudioPlayer/propTypes/propTypes.js +44 -0
- package/lib/AudioPlayer/utils/utils.js +33 -0
- package/lib/ChannelIcon/ChannelIcon.js +1 -1
- package/lib/DotProvider/hooks/useDotProvider.js +2 -0
- package/lib/Drawer/Drawer.js +6 -6
- package/lib/Drawer/Drawer.module.css +1 -1
- package/lib/FlipCard/FlipCard.js +3 -3
- package/lib/FormAction/FormAction.js +1 -1
- package/lib/FreezeLayer/FreezeLayer.js +3 -3
- package/lib/Hooks/Dragger/useDragger.js +51 -28
- package/lib/IconButton/IconButton.js +3 -3
- package/lib/ImportantNotes/ImportantNotes.js +1 -1
- package/lib/Loader/Loader.js +1 -1
- package/lib/MessageBanner/MessageBanner.js +1 -1
- package/lib/NewStar/NewStar.js +1 -1
- package/lib/Onboarding/Onboarding.js +3 -3
- package/lib/Separator/Separator.js +1 -1
- package/lib/ToastMessage/ToastMessage.js +4 -4
- package/lib/Upload/Upload.js +1 -1
- package/lib/VideoLookup/VideoLookup.js +1 -1
- package/lib/alert/AlertHeader/AlertHeader.js +1 -1
- package/lib/alert/AlertLookup/AlertLookup.js +1 -1
- package/lib/avatar/AvatarClose/AvatarClose.js +1 -1
- package/lib/avatar/AvatarCollision/AvatarCollision.js +1 -1
- package/lib/avatar/AvatarIcon/AvatarIcon.js +2 -2
- package/lib/avatar/AvatarStatus/AvatarStatus.js +1 -1
- package/lib/avatar/AvatarThread/AvatarThread.js +1 -1
- package/lib/avatar/AvatarUser/AvatarUser.js +1 -1
- package/lib/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
- package/lib/deprecated/FreezeLayer/FreezeLayer.js +3 -3
- package/lib/deprecated/SelectDropdown/SelectDropdown.js +7 -7
- package/lib/dot_layer.module.css +1 -0
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +14 -14
- package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +1 -1
- package/lib/emptystate/EditionPage/EditionPage.css +2 -2
- package/lib/emptystate/EditionPage/EditionPage.js +1 -1
- package/lib/errorstate/Inconvenience/Inconvenience.js +3 -3
- package/lib/errorstate/NoRequestFound/NoRequestFound.js +3 -3
- package/lib/errorstate/PermissionPlay/PermissionPlay.js +3 -3
- package/lib/errorstate/PermissionPlay/PermissionPlay.module.css +1 -1
- package/lib/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +3 -3
- package/lib/errorstate/UnableToProcess/UnableToProcess.js +3 -3
- package/lib/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -3
- package/lib/errorstate/WillBack/WillBack.js +3 -3
- package/lib/form/fields/CheckBoxField/CheckBoxField.js +3 -3
- package/lib/form/fields/CurrencyField/CurrencyField.js +3 -3
- package/lib/form/fields/DateField/DateField.js +3 -3
- package/lib/form/fields/FieldContainer/FieldContainer.js +1 -1
- package/lib/form/fields/Fields.module.css +4 -0
- package/lib/form/fields/MultiSelectField/MultiSelectField.js +3 -3
- package/lib/form/fields/PhoneField/PhoneField.js +3 -2
- package/lib/form/fields/PhoneField/__tests__/__snapshots__/PhoneField.spec.js.snap +1 -1
- package/lib/form/fields/RadioField/RadioField.js +2 -2
- package/lib/form/fields/SelectField/SelectField.js +3 -3
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +11 -11
- package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +3 -3
- package/lib/form/fields/TextBoxField/TextBoxField.js +3 -3
- package/lib/form/fields/TextEditor/TextEditor.js +2 -2
- package/lib/form/fields/TextEditor/TextEditor.module.css +2 -2
- package/lib/form/fields/TextEditorField/TextEditorField.js +1 -1
- package/lib/form/fields/TextEditorWrapper/TextEditorWrapper.js +2 -2
- package/lib/form/fields/TextareaField/TextareaField.js +3 -3
- package/lib/form/fields/ValidationMessage/ValidationMessage.js +2 -2
- package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +1 -0
- package/lib/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
- package/lib/layout/SetupDetailLayout/SetupDetailLayout.module.css +1 -1
- package/lib/layout/SubtabLayout/SubtabLayout.js +2 -2
- package/lib/list/Comment/Comment.js +1 -1
- package/lib/list/Icons/AddNewIcon.js +1 -1
- package/lib/list/Icons/CompleteIcon.js +1 -1
- package/lib/list/Icons/DeleteIcon.js +1 -1
- package/lib/list/Icons/EditIcon.js +1 -1
- package/lib/list/Icons/ReadUnreadIcon.js +1 -1
- package/lib/list/Icons/SmartIcon.js +1 -1
- package/lib/list/ListLayout/ListLayout.js +1 -1
- package/lib/list/ListStencils/ListStencils.js +1 -1
- package/lib/list/SecondaryText/AccountName.js +1 -1
- package/lib/list/SecondaryText/ContactName.js +1 -1
- package/lib/list/SecondaryText/SecondaryText.module.css +8 -8
- package/lib/list/SecondryPanel/SecondryPanel.js +2 -2
- package/lib/list/Subject/Subject.module.css +3 -3
- package/lib/list/Thread/Thread.js +1 -1
- package/lib/list/status/StatusDropdown/StatusDropdown.js +10 -10
- package/lib/list/status/StatusListItem/StatusListItem.js +2 -2
- package/lib/lookup/EmptyPage/EmptyPage.js +4 -4
- package/lib/lookup/EmptyPage/LookupEmptyPage.module.css +4 -2
- package/lib/lookup/Lookup/Lookup.js +1 -1
- package/lib/lookup/Section/Section.js +1 -1
- package/lib/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
- package/lib/lookup/header/Search/Search.js +3 -3
- package/lib/lookup/header/TicketHeader/TicketHeader.js +1 -1
- package/lib/lookup/header/Title/LookupTitle.module.css +7 -3
- package/lib/lookup/header/ViewDropDown/ViewDropDown.js +9 -9
- package/lib/lookup/header/ViewDropDown/ViewDropDown.module.css +13 -2
- package/lib/setup/header/Button/Button.js +1 -1
- package/lib/setup/header/Link/Link.js +1 -1
- package/lib/setup/header/Search/Search.js +1 -1
- package/lib/setup/header/Search/Search.module.css +1 -1
- package/lib/setup/table/Table/Table.js +1 -1
- package/lib/setup/table/TableBody/TableBody.js +1 -1
- package/lib/setup/table/TableData/TableData.js +1 -1
- package/lib/setup/table/TableHead/TableHead.js +1 -1
- package/lib/setup/table/TableRow/TableRow.js +1 -1
- package/lib/svg/PlusIcon.js +1 -1
- package/lib/svg/SnippetIcon.js +1 -1
- package/lib/svg/TemplateIcon.js +1 -1
- package/lib/v1/dropdown/ToggleDropDown/ToggleDropDown.js +2 -2
- package/lib/v1/emptystate/EditionPage/EditionPage.js +1 -1
- package/lib/v1/errorstate/Inconvenience/Inconvenience.js +1 -1
- package/lib/v1/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +1 -1
- package/lib/v1/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +1 -1
- package/lib/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +1 -1
- package/lib/v1/errorstate/UrlNotFound/UrlNotFound.js +1 -1
- package/lib/v1/errorstate/WillBeRightBack/WillBeRightBack.js +1 -1
- package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -2
- package/lib/v1/form/fields/TextEditor/TextEditor.js +1 -1
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
- package/lib/v1/lookup/EmptyPage/EmptyPage.js +4 -4
- package/lib/v1/lookup/header/ViewDropDown/ViewDropDown.js +1 -1
- package/lib/v1/notification/DesktopNotification/DesktopNotification.js +1 -1
- package/lib/v1/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +1 -1
- package/lib/v1/svg/PlusIcon.js +1 -1
- package/lib/v1/svg/SnippetIcon.js +1 -1
- package/lib/v1/svg/TemplateIcon.js +1 -1
- package/lib/version2/AlertClose/AlertClose.js +1 -1
- package/lib/version2/GlobalNotification/GlobalNotification.js +1 -1
- package/lib/version2/GlobalNotification/GlobalNotification.module.css +3 -2
- package/lib/version2/errorstate/Inconvenience/Inconvenience.js +3 -3
- package/lib/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +3 -3
- package/lib/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +3 -3
- package/lib/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -3
- package/lib/version2/errorstate/UrlNotFound/UrlNotFound.js +3 -3
- package/lib/version2/errorstate/V2_ErrorStates.module.css +1 -1
- package/lib/version2/errorstate/WillBeRightBack/WillBeRightBack.js +3 -3
- package/lib/version2/lookup/AlertHeader/AlertHeader.js +1 -1
- package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +9 -3
- package/lib/version2/lookup/AlertLookup/AlertLookup.js +3 -3
- package/lib/version2/lookup/alertLookupCommonNew.module.css +1 -1
- package/lib/version2/notification/DesktopNotification/DesktopNotification.js +4 -4
- package/lib/version2/notification/DesktopNotification/DesktopNotification.module.css +4 -3
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +2 -2
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +1 -0
- package/package.json +23 -14
- package/.cli/MissedPropType_Keys.html +0 -101
- package/.cli/PropLessFiles.html +0 -101
- package/.cli/PropUnificationExcludeFilesArray.js +0 -345
- package/.cli/PropValidationExcludeFilesArray.js +0 -8
- package/.cli/ThemeValidationExcludeFiles.js +0 -1
- package/.cli/UnValidatedFiles.html +0 -101
- package/.cli/propValidation_report.html +0 -182
- package/.cli/stringContains.js +0 -1
- package/css_error.log +0 -1
- package/images/audio_thumbnail.png +0 -0
- package/install.md +0 -12
- package/postPublish.js +0 -8
- package/prePublish.js +0 -70
- package/propValidationArg.json +0 -12
- package/react-cli.config.js +0 -24
- package/result.json +0 -1
- package/unittest/index.html +0 -37
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
height: var(--zd_size30) ;
|
|
3
|
+
background: var(--zdt_audioplayer_default_bg);
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dragtag {
|
|
8
|
+
margin: 0 var(--zd_size10) ;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.audioHid {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.pauseIcon {
|
|
16
|
+
font-size: var(--zd_font_size13) ;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.iconColor {
|
|
20
|
+
color: var(--zdt_audioplayer_line_text);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.downloadIcon {
|
|
24
|
+
font-size: var(--zd_font_size11) ;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
[dir=ltr] .timerBox {
|
|
28
|
+
margin-left: var(--zd_size6) ;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[dir=rtl] .timerBox {
|
|
32
|
+
margin-right: var(--zd_size6) ;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.rightBox,
|
|
36
|
+
.closeBox {
|
|
37
|
+
height: 100% ;
|
|
38
|
+
width: var(--zd_size36) ;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[dir=ltr] .boxLeftRadius {
|
|
42
|
+
border-top-left-radius: 4px;
|
|
43
|
+
border-bottom-left-radius: 4px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[dir=rtl] .boxLeftRadius {
|
|
47
|
+
border-top-right-radius: 4px;
|
|
48
|
+
border-bottom-right-radius: 4px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[dir=ltr] .boxRightRadius {
|
|
52
|
+
border-top-right-radius: 4px;
|
|
53
|
+
border-bottom-right-radius: 4px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
[dir=rtl] .boxRightRadius {
|
|
57
|
+
border-top-left-radius: 4px;
|
|
58
|
+
border-bottom-left-radius: 4px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.closeBox, .rightBox, .cursor {
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.downloadBox:hover, .downloadBox:focus, .closeBox:hover, .closeBox:focus {
|
|
66
|
+
background-color: var(--zdt_audioplayer_input_bg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.downloadBox:hover .downloadIcon,
|
|
70
|
+
.closeBox:hover .pauseIcon {
|
|
71
|
+
color: var(--zdt_audioplayer_pauseicon_text);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.line {
|
|
75
|
+
color: var(--zdt_audioplayer_line_text);
|
|
76
|
+
font-size: var(--zd_font_size13) ;
|
|
77
|
+
font-weight: var(--zd-fw-semibold);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.disable {
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
opacity: 0.4;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Audio Range styles */
|
|
86
|
+
|
|
87
|
+
input::-moz-focus-inner, input::-moz-focus-outer {
|
|
88
|
+
border: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.audioRangeContainer {
|
|
92
|
+
position: relative;
|
|
93
|
+
background-color: var(--zdt_audioplayer_input_bg);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.audioRangeContainer,
|
|
97
|
+
.input,
|
|
98
|
+
.loading {
|
|
99
|
+
height: var(--zd_size3) ;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.audioRangeContainer, .input, .loading {
|
|
103
|
+
border-radius: 4px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.loading {
|
|
107
|
+
width: 0% ;
|
|
108
|
+
height: 100% ;
|
|
109
|
+
position: absolute;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
background-color: var(--zdt_audioplayer_loading_bg);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* CHROME */
|
|
115
|
+
.input {
|
|
116
|
+
-webkit-appearance: none;
|
|
117
|
+
outline: none;
|
|
118
|
+
background-color: var(--zdt_audioplayer_input_bg);
|
|
119
|
+
margin: 0 ;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.input::-webkit-slider-thumb {
|
|
123
|
+
-webkit-appearance: none;
|
|
124
|
+
width: var(--zd_size7) ;
|
|
125
|
+
height: var(--zd_size7) ;
|
|
126
|
+
border-radius: 50%;
|
|
127
|
+
background-color: var(--zdt_audioplayer_loading_bg);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* FIREFOX */
|
|
131
|
+
.input::-moz-range-thumb {
|
|
132
|
+
height: var(--zd_size7) ;
|
|
133
|
+
width: var(--zd_size7) ;
|
|
134
|
+
border: none;
|
|
135
|
+
border-radius: 50%;
|
|
136
|
+
background-color: var(--zdt_audioplayer_loading_bg);
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.input::-moz-range-track {
|
|
141
|
+
height: var(--zd_size3) ;
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
border-radius: 4px;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* End of audio range styles */
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = require("./propTypes/propTypes");
|
|
13
|
+
|
|
14
|
+
var _defaultProps = require("./propTypes/defaultProps");
|
|
15
|
+
|
|
16
|
+
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
17
|
+
|
|
18
|
+
var _utils = require("../utils/utils");
|
|
19
|
+
|
|
20
|
+
var _TimerModule = _interopRequireDefault(require("./Timer.module.css"));
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
+
|
|
24
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
+
|
|
26
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
27
|
+
|
|
28
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
|
+
|
|
30
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
|
+
|
|
32
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
+
|
|
34
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
|
+
|
|
36
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
37
|
+
|
|
38
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
+
|
|
40
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
+
|
|
42
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
+
|
|
44
|
+
var Timer = /*#__PURE__*/function (_React$Component) {
|
|
45
|
+
_inherits(Timer, _React$Component);
|
|
46
|
+
|
|
47
|
+
var _super = _createSuper(Timer);
|
|
48
|
+
|
|
49
|
+
function Timer(props) {
|
|
50
|
+
var _this;
|
|
51
|
+
|
|
52
|
+
_classCallCheck(this, Timer);
|
|
53
|
+
|
|
54
|
+
_this = _super.call(this, props);
|
|
55
|
+
_this.constructTimer = _this.constructTimer.bind(_assertThisInitialized(_this));
|
|
56
|
+
return _this;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
_createClass(Timer, [{
|
|
60
|
+
key: "constructTimer",
|
|
61
|
+
value: function constructTimer() {
|
|
62
|
+
var _this$props = this.props,
|
|
63
|
+
hour = _this$props.hour,
|
|
64
|
+
minute = _this$props.minute,
|
|
65
|
+
second = _this$props.second,
|
|
66
|
+
amPm = _this$props.amPm,
|
|
67
|
+
separator = _this$props.separator,
|
|
68
|
+
timerFormat = _this$props.timerFormat,
|
|
69
|
+
needCharacter = _this$props.needCharacter;
|
|
70
|
+
var timeSeparator = separator == 'space' ? ' ' : ':';
|
|
71
|
+
var timerValue = '';
|
|
72
|
+
var format = timerFormat.toLowerCase().split(':');
|
|
73
|
+
hour = (0, _utils.addLeadingZeros)(hour);
|
|
74
|
+
minute = (0, _utils.addLeadingZeros)(minute);
|
|
75
|
+
second = (0, _utils.addLeadingZeros)(second);
|
|
76
|
+
|
|
77
|
+
if (needCharacter) {
|
|
78
|
+
hour = "".concat(hour, "h");
|
|
79
|
+
minute = "".concat(minute, "m");
|
|
80
|
+
second = "".concat(second, "s");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
format.map(function (type) {
|
|
84
|
+
if (type == 'hh') {
|
|
85
|
+
timerValue += hour;
|
|
86
|
+
} else if (type == 'mm') {
|
|
87
|
+
timerValue += minute;
|
|
88
|
+
} else if (type == 'ss') {
|
|
89
|
+
timerValue += second;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
timerValue += timeSeparator;
|
|
93
|
+
});
|
|
94
|
+
timerValue = timerValue.slice(0, -1);
|
|
95
|
+
amPm && (timerValue = "".concat(timerValue, " ").concat(amPm));
|
|
96
|
+
return timerValue;
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "render",
|
|
100
|
+
value: function render() {
|
|
101
|
+
var dataId = this.props.dataId;
|
|
102
|
+
var timerValue = this.constructTimer();
|
|
103
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
104
|
+
dataId: dataId,
|
|
105
|
+
alignBox: "row",
|
|
106
|
+
className: _TimerModule["default"].container,
|
|
107
|
+
flexible: true
|
|
108
|
+
}, timerValue);
|
|
109
|
+
}
|
|
110
|
+
}]);
|
|
111
|
+
|
|
112
|
+
return Timer;
|
|
113
|
+
}(_react["default"].Component);
|
|
114
|
+
|
|
115
|
+
exports["default"] = Timer;
|
|
116
|
+
Timer.defaultProps = _defaultProps.Timer_defaultProps;
|
|
117
|
+
Timer.propTypes = _propTypes.Timer_propTypes;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _Timer = _interopRequireDefault(require("../Timer"));
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
|
|
11
|
+
var defaultProps = {
|
|
12
|
+
dataId: 'CBTimer'
|
|
13
|
+
};
|
|
14
|
+
describe('Timer test Cases', function () {
|
|
15
|
+
// const {props,renderedDOM} = setup(Timer,Object.assign({},defaultProps))
|
|
16
|
+
// it('Should render Component',()=>{
|
|
17
|
+
// const component = TestUtils.scryRenderedComponentsWithTestid(renderedDOM,'CBTimer');
|
|
18
|
+
// expect(component.length).toBe(1);
|
|
19
|
+
// })
|
|
20
|
+
test('rendering the defult props', function () {
|
|
21
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Timer["default"], defaultProps)),
|
|
22
|
+
asFragment = _render.asFragment;
|
|
23
|
+
|
|
24
|
+
expect(asFragment()).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`Timer test Cases rendering the defult props 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="container flex cover rowdir"
|
|
7
|
+
data-id="CBTimer"
|
|
8
|
+
data-selector-id="container"
|
|
9
|
+
data-test-id="CBTimer"
|
|
10
|
+
>
|
|
11
|
+
undefined:undefined
|
|
12
|
+
</div>
|
|
13
|
+
</DocumentFragment>
|
|
14
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Timer_propTypes = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
+
|
|
12
|
+
var Timer_propTypes = {
|
|
13
|
+
dataId: _propTypes["default"].string,
|
|
14
|
+
amPm: _propTypes["default"].string,
|
|
15
|
+
hour: _propTypes["default"].string,
|
|
16
|
+
minute: _propTypes["default"].string,
|
|
17
|
+
needCharacter: _propTypes["default"].bool,
|
|
18
|
+
second: _propTypes["default"].string,
|
|
19
|
+
separator: _propTypes["default"].oneOf(['space', 'colon']),
|
|
20
|
+
timerFormat: _propTypes["default"].string
|
|
21
|
+
};
|
|
22
|
+
exports.Timer_propTypes = Timer_propTypes;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _AudioPlayer = _interopRequireDefault(require("../AudioPlayer"));
|
|
8
|
+
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
+
|
|
11
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
12
|
+
|
|
13
|
+
var DEFAULT_PROPS = {
|
|
14
|
+
minute: '02',
|
|
15
|
+
second: '03',
|
|
16
|
+
durationInSec: '203',
|
|
17
|
+
src: 'https://ypvnxx00-a.akamaihd.net/downloads/ringtones/files/mp3/yuvanringtone-44640.mp3'
|
|
18
|
+
};
|
|
19
|
+
describe('AudioPlayer - Snapshot', function () {
|
|
20
|
+
test('Render with default props', function () {
|
|
21
|
+
var _render = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], DEFAULT_PROPS)),
|
|
22
|
+
asFragment = _render.asFragment;
|
|
23
|
+
|
|
24
|
+
expect(asFragment()).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
test('Render with customId and testId', function () {
|
|
27
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
28
|
+
customId: "audio-player-customId",
|
|
29
|
+
testId: "audio-player-testId"
|
|
30
|
+
}))),
|
|
31
|
+
asFragment = _render2.asFragment;
|
|
32
|
+
|
|
33
|
+
expect(asFragment()).toMatchSnapshot();
|
|
34
|
+
});
|
|
35
|
+
test('Render with tag attributes', function () {
|
|
36
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
37
|
+
tagAttributes: {
|
|
38
|
+
'data-custom-attr': 'true'
|
|
39
|
+
}
|
|
40
|
+
}))),
|
|
41
|
+
asFragment = _render3.asFragment;
|
|
42
|
+
|
|
43
|
+
expect(asFragment()).toMatchSnapshot();
|
|
44
|
+
});
|
|
45
|
+
test('Render with a11y attributes', function () {
|
|
46
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
47
|
+
a11yAttributes: {
|
|
48
|
+
role: 'region'
|
|
49
|
+
}
|
|
50
|
+
}))),
|
|
51
|
+
asFragment = _render4.asFragment;
|
|
52
|
+
|
|
53
|
+
expect(asFragment()).toMatchSnapshot();
|
|
54
|
+
});
|
|
55
|
+
test('Render with customClass', function () {
|
|
56
|
+
var _render5 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
57
|
+
customClass: "my-audio-player"
|
|
58
|
+
}))),
|
|
59
|
+
asFragment = _render5.asFragment;
|
|
60
|
+
|
|
61
|
+
expect(asFragment()).toMatchSnapshot();
|
|
62
|
+
});
|
|
63
|
+
test('Render with i18nKeys', function () {
|
|
64
|
+
var _render6 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
65
|
+
i18nKeys: {
|
|
66
|
+
play: 'Play',
|
|
67
|
+
pause: 'Pause'
|
|
68
|
+
}
|
|
69
|
+
}))),
|
|
70
|
+
asFragment = _render6.asFragment;
|
|
71
|
+
|
|
72
|
+
expect(asFragment()).toMatchSnapshot();
|
|
73
|
+
});
|
|
74
|
+
test('Render with needClose=false', function () {
|
|
75
|
+
var _render7 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
76
|
+
needClose: false
|
|
77
|
+
}))),
|
|
78
|
+
asFragment = _render7.asFragment;
|
|
79
|
+
|
|
80
|
+
expect(asFragment()).toMatchSnapshot();
|
|
81
|
+
});
|
|
82
|
+
test('Render with needDownload=false', function () {
|
|
83
|
+
var _render8 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
84
|
+
needDownload: false
|
|
85
|
+
}))),
|
|
86
|
+
asFragment = _render8.asFragment;
|
|
87
|
+
|
|
88
|
+
expect(asFragment()).toMatchSnapshot();
|
|
89
|
+
});
|
|
90
|
+
test('Render with needMuteIcon=true', function () {
|
|
91
|
+
var _render9 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
92
|
+
needMuteIcon: true
|
|
93
|
+
}))),
|
|
94
|
+
asFragment = _render9.asFragment;
|
|
95
|
+
|
|
96
|
+
expect(asFragment()).toMatchSnapshot();
|
|
97
|
+
});
|
|
98
|
+
test('Render with isPlay=true', function () {
|
|
99
|
+
var _render10 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
100
|
+
isPlay: true
|
|
101
|
+
}))),
|
|
102
|
+
asFragment = _render10.asFragment;
|
|
103
|
+
|
|
104
|
+
expect(asFragment()).toMatchSnapshot();
|
|
105
|
+
});
|
|
106
|
+
test('Render with timerFormat=ss:mm', function () {
|
|
107
|
+
var _render11 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
108
|
+
timerFormat: "ss:mm"
|
|
109
|
+
}))),
|
|
110
|
+
asFragment = _render11.asFragment;
|
|
111
|
+
|
|
112
|
+
expect(asFragment()).toMatchSnapshot();
|
|
113
|
+
});
|
|
114
|
+
test('Render with forwardStepInSec=10', function () {
|
|
115
|
+
var _render12 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
116
|
+
forwardStepInSec: 10
|
|
117
|
+
}))),
|
|
118
|
+
asFragment = _render12.asFragment;
|
|
119
|
+
|
|
120
|
+
expect(asFragment()).toMatchSnapshot();
|
|
121
|
+
});
|
|
122
|
+
test('Render with backwardStepInSec=10', function () {
|
|
123
|
+
var _render13 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
124
|
+
backwardStepInSec: 10
|
|
125
|
+
}))),
|
|
126
|
+
asFragment = _render13.asFragment;
|
|
127
|
+
|
|
128
|
+
expect(asFragment()).toMatchSnapshot();
|
|
129
|
+
});
|
|
130
|
+
test('Render with range=50', function () {
|
|
131
|
+
var _render14 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
132
|
+
range: 50
|
|
133
|
+
}))),
|
|
134
|
+
asFragment = _render14.asFragment;
|
|
135
|
+
|
|
136
|
+
expect(asFragment()).toMatchSnapshot();
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
describe('AudioPlayer - Unit', function () {
|
|
140
|
+
test('Should call togglePlayer on close button click', function () {
|
|
141
|
+
var togglePlayer = jest.fn();
|
|
142
|
+
(0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
143
|
+
togglePlayer: togglePlayer
|
|
144
|
+
})));
|
|
145
|
+
|
|
146
|
+
var closeBtn = _react2.screen.queryByTestId('audioPlayerClose');
|
|
147
|
+
|
|
148
|
+
if (closeBtn) {
|
|
149
|
+
_react2.fireEvent.click(closeBtn);
|
|
150
|
+
|
|
151
|
+
expect(togglePlayer).toHaveBeenCalled();
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
test('Should call downloadFile on download button click', function () {
|
|
155
|
+
var downloadFile = jest.fn();
|
|
156
|
+
(0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
157
|
+
downloadFile: downloadFile
|
|
158
|
+
})));
|
|
159
|
+
|
|
160
|
+
var downloadBtn = _react2.screen.queryByTestId('audioDownload');
|
|
161
|
+
|
|
162
|
+
if (downloadBtn) {
|
|
163
|
+
_react2.fireEvent.click(downloadBtn);
|
|
164
|
+
|
|
165
|
+
expect(downloadFile).toHaveBeenCalled();
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
test('Should toggle play/pause on play button click', function () {
|
|
169
|
+
var togglePlayer = jest.fn();
|
|
170
|
+
(0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
171
|
+
togglePlayer: togglePlayer
|
|
172
|
+
})));
|
|
173
|
+
|
|
174
|
+
var playBtn = _react2.screen.queryByTestId('audioPlayPause');
|
|
175
|
+
|
|
176
|
+
if (playBtn) {
|
|
177
|
+
_react2.fireEvent.click(playBtn);
|
|
178
|
+
|
|
179
|
+
expect(togglePlayer).toHaveBeenCalled();
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
test('Should mute/unmute on mute button click', function () {
|
|
183
|
+
(0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
184
|
+
needMuteIcon: true
|
|
185
|
+
})));
|
|
186
|
+
|
|
187
|
+
var muteBtn = _react2.screen.queryByTestId('audioMute');
|
|
188
|
+
|
|
189
|
+
if (muteBtn) {
|
|
190
|
+
_react2.fireEvent.click(muteBtn); // Add assertion if mute state is exposed via prop or DOM
|
|
191
|
+
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
test('Should change range on slider input', function () {
|
|
195
|
+
(0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_AudioPlayer["default"], _extends({}, DEFAULT_PROPS, {
|
|
196
|
+
range: 0
|
|
197
|
+
})));
|
|
198
|
+
|
|
199
|
+
var rangeInput = _react2.screen.queryByTestId('audioRange');
|
|
200
|
+
|
|
201
|
+
if (rangeInput) {
|
|
202
|
+
_react2.fireEvent.change(rangeInput, {
|
|
203
|
+
target: {
|
|
204
|
+
value: 50
|
|
205
|
+
}
|
|
206
|
+
}); // Add assertion if range change is exposed via prop or DOM
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
});
|