@ndla/ui 50.1.1 → 50.1.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/es/Article/Article.js +73 -76
- package/es/Article/ArticleAccessMessage.js +6 -4
- package/es/Article/ArticleByline.js +42 -58
- package/es/Article/ArticleFootNotes.js +17 -17
- package/es/Article/ArticleHeaderWrapper.js +11 -14
- package/es/Article/ArticleNotions.js +13 -10
- package/es/Aside/Aside.js +19 -24
- package/es/AudioPlayer/AudioPlayer.js +40 -53
- package/es/AudioPlayer/Controls.js +74 -97
- package/es/AudioPlayer/SpeechControl.js +11 -8
- package/es/BannerCard/BannerCard.js +19 -25
- package/es/BlogPost/BlogPost.js +18 -17
- package/es/Breadcrumb/Breadcrumb.js +42 -55
- package/es/Breadcrumb/BreadcrumbItem.js +32 -26
- package/es/Breadcrumb/HeaderBreadcrumb.js +15 -12
- package/es/Breadcrumb/HomeBreadcrumb.js +33 -21
- package/es/CampaignBlock/CampaignBlock.js +18 -18
- package/es/CompetenceGoalTab/CompetenceGoalItem.js +22 -21
- package/es/CompetenceGoalTab/CompetenceGoalTab.js +21 -27
- package/es/CompetenceGoalTab/CompetenceItem.js +49 -52
- package/es/CompetenceGoalTab/CoreElementItem.js +11 -8
- package/es/CompetenceGoalTab/SearchButton.js +8 -6
- package/es/CompetenceGoalTab/styles.js +5 -5
- package/es/ContactBlock/ContactBlock.js +46 -45
- package/es/ContentLoader/index.js +26 -40
- package/es/ContentPlaceholder/ContentPlaceholder.js +4 -4
- package/es/ContentTypeBadge/ContentTypeBadge.js +48 -61
- package/es/CopyParagraphButton/CopyParagraphButton.js +24 -33
- package/es/CreatedBy/CreatedBy.js +14 -13
- package/es/DefinitionList/DefinitionDescription.js +10 -17
- package/es/DefinitionList/DefinitionTerm.js +10 -17
- package/es/Embed/AudioEmbed.js +27 -32
- package/es/Embed/BrightcoveEmbed.js +63 -85
- package/es/Embed/ConceptEmbed.js +84 -85
- package/es/Embed/ConceptListEmbed.js +19 -12
- package/es/Embed/ContentLinkEmbed.js +14 -9
- package/es/Embed/EmbedErrorPlaceholder.js +9 -7
- package/es/Embed/ExternalEmbed.js +26 -26
- package/es/Embed/FootnoteEmbed.js +10 -7
- package/es/Embed/H5pEmbed.js +9 -8
- package/es/Embed/IframeEmbed.js +37 -33
- package/es/Embed/ImageEmbed.js +80 -97
- package/es/Embed/RelatedContentEmbed.js +23 -24
- package/es/Embed/UnknownEmbed.js +8 -5
- package/es/Embed/conceptComponents.js +53 -64
- package/es/ErrorMessage/ErrorMessage.js +14 -14
- package/es/ErrorMessage/ErrorResourceAccessDenied.js +8 -5
- package/es/ExpandableBox/ExpandableBox.js +16 -20
- package/es/FactBox/FactBox.js +21 -35
- package/es/Figure/Figure.js +21 -28
- package/es/Figure/FigureOpenDialogButton.js +5 -3
- package/es/FileList/File.js +27 -22
- package/es/FileList/FileList.js +10 -7
- package/es/FileList/PdfFile.js +5 -3
- package/es/Filter/FilterButtons.js +65 -83
- package/es/Filter/FilterCarousel.js +42 -64
- package/es/Filter/FilterList.js +47 -69
- package/es/Filter/FilterListPhone.js +134 -176
- package/es/Filter/ToggleItem.js +25 -26
- package/es/Filter/filterClasses.js +1 -1
- package/es/Footer/EditorName.js +6 -4
- package/es/Footer/Footer.js +23 -22
- package/es/Footer/FooterLinks.js +31 -32
- package/es/Footer/FooterPrivacy.js +17 -17
- package/es/Footer/FooterText.js +5 -3
- package/es/FramedContent/FramedContent.js +12 -19
- package/es/Frontpage/FrontpageAllSubjects.js +65 -76
- package/es/FrontpageArticle/FrontpageArticle.js +22 -20
- package/es/Gloss/Gloss.js +34 -36
- package/es/Grid/Grid.js +24 -29
- package/es/Hero/Hero.js +38 -48
- package/es/Hero/HeroContent.js +1 -1
- package/es/Image/Image.js +37 -51
- package/es/Image/ImageLink.js +12 -19
- package/es/KeyFigure/KeyFigure.js +13 -11
- package/es/LanguageSelector/LanguageSelector.js +32 -33
- package/es/Layout/Content.js +4 -2
- package/es/Layout/LayoutItem.js +10 -17
- package/es/Layout/OneColumn.js +16 -23
- package/es/Layout/PageContainer.js +19 -28
- package/es/LearningPaths/LearningPathContent.js +5 -3
- package/es/LearningPaths/LearningPathInformation.js +17 -14
- package/es/LearningPaths/LearningPathLastStepNavigation.js +15 -12
- package/es/LearningPaths/LearningPathMenu.js +61 -69
- package/es/LearningPaths/LearningPathMenuAside.js +18 -17
- package/es/LearningPaths/LearningPathMenuAsideCopyright.js +12 -11
- package/es/LearningPaths/LearningPathMenuContent.js +86 -50
- package/es/LearningPaths/LearningPathMenuIntro.js +17 -20
- package/es/LearningPaths/LearningPathMenuModalWrapper.js +13 -19
- package/es/LearningPaths/LearningPathMobileHeader.js +6 -5
- package/es/LearningPaths/LearningPathMobileStepInfo.js +9 -6
- package/es/LearningPaths/LearningPathSticky.js +24 -21
- package/es/LearningPaths/LearningPathWrapper.js +6 -4
- package/es/LetterFilter/LetterFilter.js +17 -20
- package/es/LetterFilter/alphabet.js +1 -1
- package/es/LicenseByline/EmbedByline.js +31 -36
- package/es/LicenseByline/LicenseDescription.js +6 -4
- package/es/LicenseByline/LicenseLink.js +7 -6
- package/es/LinkBlock/LinkBlock.js +17 -15
- package/es/LinkBlock/LinkBlockSection.js +12 -20
- package/es/List/OrderedList.js +17 -22
- package/es/List/UnOrderedList.js +10 -17
- package/es/Logo/Logo.js +17 -22
- package/es/Logo/SvgLogo.js +10 -15
- package/es/Masthead/Masthead.js +17 -23
- package/es/Masthead/SkipToMainContent.js +9 -6
- package/es/Masthead/utils.js +12 -24
- package/es/MediaList/MediaList.js +83 -72
- package/es/Messages/MessageBanner.js +14 -10
- package/es/Messages/MessageBox.js +20 -20
- package/es/MyNdla/Resource/Folder.js +35 -30
- package/es/MyNdla/Resource/FolderInput.js +23 -31
- package/es/NDLAFilm/AboutNdlaFilm.js +10 -7
- package/es/NDLAFilm/AllMoviesAlphabetically.js +49 -60
- package/es/NDLAFilm/FilmContentCard.js +28 -40
- package/es/NDLAFilm/FilmContentCardTags.js +14 -16
- package/es/NDLAFilm/FilmMovieList.js +15 -17
- package/es/NDLAFilm/FilmMovieSearch.js +34 -36
- package/es/NDLAFilm/FilmSlideshow.js +32 -51
- package/es/NDLAFilm/MovieGrid.js +23 -26
- package/es/NDLAFilm/VisualElement.js +11 -7
- package/es/NDLAFilm/filmStyles.js +14 -12
- package/es/NDLAFilm/isLetter.js +3 -3
- package/es/Navigation/NavigationBox.js +80 -94
- package/es/NoContentBox/NoContentBox.js +6 -4
- package/es/Notion/Notion.js +24 -26
- package/es/Notion/NotionImage.js +13 -10
- package/es/Programme/Programme.js +39 -21
- package/es/Programme/ProgrammeSubjects.js +19 -25
- package/es/ProgrammeCard/ProgrammeCard.js +10 -8
- package/es/RelatedArticleList/RelatedArticleList.js +51 -69
- package/es/Resource/BlockResource.js +34 -30
- package/es/Resource/ListResource.js +43 -37
- package/es/Resource/resourceComponents.js +69 -78
- package/es/Resource/storyComponents.js +28 -30
- package/es/ResourceBox/ResourceBox.js +14 -12
- package/es/ResourceGroup/ResourceGroup.js +14 -13
- package/es/ResourceGroup/ResourceItem.js +56 -36
- package/es/ResourceGroup/ResourceList.js +23 -31
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +29 -25
- package/es/ResourcesWrapper/ResourcesWrapper.js +10 -16
- package/es/Search/ActiveFilterContent.js +9 -9
- package/es/Search/ActiveFilters.js +31 -24
- package/es/Search/ContentTypeResult.js +49 -66
- package/es/Search/ContentTypeResultStyles.js +19 -27
- package/es/Search/IsPathToHighlight.js +2 -2
- package/es/Search/LoadingWrapper.js +5 -3
- package/es/Search/SearchField.js +42 -48
- package/es/Search/SearchFieldForm.js +9 -9
- package/es/Search/SearchResult.js +53 -59
- package/es/Search/SearchResultSleeve.js +67 -89
- package/es/SearchTypeResult/ActiveFilterContent.js +11 -10
- package/es/SearchTypeResult/ActiveFilters.js +38 -33
- package/es/SearchTypeResult/PopupFilter.js +33 -47
- package/es/SearchTypeResult/ResultNavigation.js +22 -22
- package/es/SearchTypeResult/SearchFieldHeader.js +28 -41
- package/es/SearchTypeResult/SearchFilterContent.js +13 -10
- package/es/SearchTypeResult/SearchHeader.js +47 -57
- package/es/SearchTypeResult/SearchItem.js +30 -29
- package/es/SearchTypeResult/SearchItemList.js +39 -40
- package/es/SearchTypeResult/SearchItems.js +18 -19
- package/es/SearchTypeResult/SearchNotionsResult.js +16 -13
- package/es/SearchTypeResult/SearchSubjectItem.js +23 -14
- package/es/SearchTypeResult/SearchSubjectResult.js +17 -17
- package/es/SearchTypeResult/SearchTypeHeader.js +40 -40
- package/es/SearchTypeResult/SearchTypeResult.js +17 -21
- package/es/SearchTypeResult/SearchViewType.js +16 -19
- package/es/SearchTypeResult/components/ItemContexts.js +39 -38
- package/es/SearchTypeResult/components/ItemResourceHeader.js +24 -30
- package/es/SearchTypeResult/components/ItemTopicHeader.js +14 -11
- package/es/SearchTypeResult/components/SubjectFilters.js +49 -72
- package/es/SectionHeading/SectionHeading.js +11 -11
- package/es/SnackBar/DefaultSnackbar.js +14 -13
- package/es/SnackBar/SnackbarProvider.js +60 -91
- package/es/Subject/SubjectBanner.js +9 -13
- package/es/Subject/SubjectHeader.js +14 -21
- package/es/Table/Table.js +37 -53
- package/es/TagSelector/Control.js +11 -15
- package/es/TagSelector/DropdownIndicator.js +24 -30
- package/es/TagSelector/Input.js +6 -11
- package/es/TagSelector/Menu.js +10 -17
- package/es/TagSelector/MenuList.js +11 -15
- package/es/TagSelector/Option.js +26 -24
- package/es/TagSelector/SelectContainer.js +10 -13
- package/es/TagSelector/TagSelector.js +65 -102
- package/es/TagSelector/ValueButton.js +21 -20
- package/es/TagSelector/ariaMessages.js +83 -81
- package/es/ToolboxPage/ToolboxInfo.js +11 -8
- package/es/Topic/Loader.js +96 -98
- package/es/Topic/Topic.js +50 -52
- package/es/TreeStructure/AddFolderButton.js +22 -21
- package/es/TreeStructure/ComboboxButton.js +27 -28
- package/es/TreeStructure/FolderItem.js +64 -70
- package/es/TreeStructure/FolderItems.js +33 -37
- package/es/TreeStructure/TreeStructure.js +52 -89
- package/es/TreeStructure/arrowNavigation.js +5 -7
- package/es/TreeStructure/helperFunctions.js +19 -24
- package/es/i18n/formatNestedMessages.js +8 -9
- package/es/i18n/i18n.js +3 -3
- package/es/locale/LocaleProvider.js +13 -8
- package/es/locale/messages-en.js +98 -33
- package/es/locale/messages-nb.js +98 -33
- package/es/locale/messages-nn.js +105 -40
- package/es/locale/messages-se.js +97 -32
- package/es/locale/messages-sma.js +102 -37
- package/es/model/ContentType.js +36 -33
- package/es/model/SubjectCategories.js +4 -4
- package/es/model/SubjectTypes.js +3 -3
- package/es/model/WordClass.js +1 -1
- package/es/model/index.js +8 -8
- package/es/types.js +1 -1
- package/es/utils/relativeUrl.js +11 -11
- package/es/utils/resourceTypeColor.js +4 -2
- package/lib/Article/Article.js +80 -85
- package/lib/Article/ArticleAccessMessage.js +15 -15
- package/lib/Article/ArticleByline.js +51 -66
- package/lib/Article/ArticleFootNotes.js +18 -19
- package/lib/Article/ArticleHeaderWrapper.js +20 -22
- package/lib/Article/ArticleNotions.js +20 -18
- package/lib/Article/index.js +9 -11
- package/lib/Aside/Aside.js +28 -32
- package/lib/Aside/index.js +1 -2
- package/lib/AudioPlayer/AudioPlayer.js +47 -61
- package/lib/AudioPlayer/Controls.js +81 -105
- package/lib/AudioPlayer/SpeechControl.js +12 -10
- package/lib/AudioPlayer/index.js +1 -2
- package/lib/BannerCard/BannerCard.js +22 -28
- package/lib/BannerCard/index.js +1 -1
- package/lib/BlogPost/BlogPost.js +19 -19
- package/lib/BlogPost/index.js +1 -1
- package/lib/Breadcrumb/Breadcrumb.js +49 -63
- package/lib/Breadcrumb/BreadcrumbItem.js +39 -34
- package/lib/Breadcrumb/HeaderBreadcrumb.js +16 -14
- package/lib/Breadcrumb/HomeBreadcrumb.js +40 -29
- package/lib/Breadcrumb/index.js +3 -4
- package/lib/CampaignBlock/CampaignBlock.js +25 -26
- package/lib/CampaignBlock/index.js +1 -1
- package/lib/CompetenceGoalTab/CompetenceGoalItem.js +23 -23
- package/lib/CompetenceGoalTab/CompetenceGoalTab.js +30 -35
- package/lib/CompetenceGoalTab/CompetenceItem.js +56 -60
- package/lib/CompetenceGoalTab/CoreElementItem.js +12 -10
- package/lib/CompetenceGoalTab/SearchButton.js +9 -8
- package/lib/CompetenceGoalTab/index.js +1 -2
- package/lib/CompetenceGoalTab/styles.js +12 -17
- package/lib/ContactBlock/ContactBlock.js +55 -56
- package/lib/ContactBlock/index.js +1 -2
- package/lib/ContentLoader/index.js +28 -42
- package/lib/ContentPlaceholder/ContentPlaceholder.js +11 -12
- package/lib/ContentPlaceholder/index.js +1 -2
- package/lib/ContentTypeBadge/ContentTypeBadge.js +50 -63
- package/lib/ContentTypeBadge/index.js +8 -9
- package/lib/CopyParagraphButton/CopyParagraphButton.js +31 -41
- package/lib/CopyParagraphButton/index.js +2 -3
- package/lib/CreatedBy/CreatedBy.js +21 -21
- package/lib/CreatedBy/index.js +1 -2
- package/lib/DefinitionList/DefinitionDescription.js +13 -20
- package/lib/DefinitionList/DefinitionTerm.js +13 -20
- package/lib/DefinitionList/index.js +2 -2
- package/lib/Embed/AudioEmbed.js +28 -34
- package/lib/Embed/BrightcoveEmbed.js +70 -93
- package/lib/Embed/ConceptEmbed.js +91 -93
- package/lib/Embed/ConceptListEmbed.js +26 -20
- package/lib/Embed/ContentLinkEmbed.js +15 -11
- package/lib/Embed/EmbedErrorPlaceholder.js +10 -9
- package/lib/Embed/ExternalEmbed.js +33 -34
- package/lib/Embed/FootnoteEmbed.js +11 -9
- package/lib/Embed/H5pEmbed.js +16 -16
- package/lib/Embed/IframeEmbed.js +38 -35
- package/lib/Embed/ImageEmbed.js +91 -109
- package/lib/Embed/RelatedContentEmbed.js +24 -26
- package/lib/Embed/UnknownEmbed.js +9 -7
- package/lib/Embed/conceptComponents.js +56 -67
- package/lib/Embed/index.js +17 -18
- package/lib/ErrorMessage/ErrorMessage.js +15 -16
- package/lib/ErrorMessage/ErrorResourceAccessDenied.js +9 -7
- package/lib/ErrorMessage/index.js +2 -3
- package/lib/ExpandableBox/ExpandableBox.js +16 -20
- package/lib/ExpandableBox/index.js +2 -2
- package/lib/FactBox/FactBox.js +28 -43
- package/lib/FactBox/index.js +1 -2
- package/lib/Figure/Figure.js +25 -31
- package/lib/Figure/FigureOpenDialogButton.js +5 -3
- package/lib/Figure/index.js +2 -2
- package/lib/FileList/File.js +34 -30
- package/lib/FileList/FileList.js +17 -15
- package/lib/FileList/PdfFile.js +6 -5
- package/lib/FileList/index.js +3 -4
- package/lib/Filter/FilterButtons.js +72 -91
- package/lib/Filter/FilterCarousel.js +49 -72
- package/lib/Filter/FilterList.js +56 -77
- package/lib/Filter/FilterListPhone.js +143 -184
- package/lib/Filter/ToggleItem.js +34 -34
- package/lib/Filter/filterClasses.js +2 -3
- package/lib/Filter/index.js +5 -5
- package/lib/Footer/EditorName.js +6 -4
- package/lib/Footer/Footer.js +30 -30
- package/lib/Footer/FooterLinks.js +32 -34
- package/lib/Footer/FooterPrivacy.js +24 -25
- package/lib/Footer/FooterText.js +5 -3
- package/lib/Footer/index.js +3 -3
- package/lib/FramedContent/FramedContent.js +14 -21
- package/lib/FramedContent/index.js +1 -2
- package/lib/Frontpage/FrontpageAllSubjects.js +66 -78
- package/lib/FrontpageArticle/FrontpageArticle.js +23 -24
- package/lib/FrontpageArticle/index.js +5 -7
- package/lib/Gloss/Gloss.js +41 -44
- package/lib/Gloss/index.js +1 -1
- package/lib/Grid/Grid.js +31 -37
- package/lib/Grid/index.js +4 -5
- package/lib/Hero/Hero.js +46 -54
- package/lib/Hero/HeroContent.js +2 -3
- package/lib/Hero/index.js +9 -9
- package/lib/Image/Image.js +44 -59
- package/lib/Image/ImageLink.js +18 -25
- package/lib/Image/index.js +5 -7
- package/lib/KeyFigure/KeyFigure.js +20 -19
- package/lib/KeyFigure/index.js +1 -1
- package/lib/LanguageSelector/LanguageSelector.js +39 -41
- package/lib/LanguageSelector/index.js +1 -1
- package/lib/Layout/Content.js +5 -4
- package/lib/Layout/LayoutItem.js +11 -19
- package/lib/Layout/OneColumn.js +19 -26
- package/lib/Layout/PageContainer.js +22 -31
- package/lib/Layout/index.js +4 -5
- package/lib/LearningPaths/LearningPathContent.js +5 -3
- package/lib/LearningPaths/LearningPathInformation.js +17 -14
- package/lib/LearningPaths/LearningPathLastStepNavigation.js +16 -14
- package/lib/LearningPaths/LearningPathMenu.js +70 -77
- package/lib/LearningPaths/LearningPathMenuAside.js +19 -19
- package/lib/LearningPaths/LearningPathMenuAsideCopyright.js +13 -13
- package/lib/LearningPaths/LearningPathMenuContent.js +87 -52
- package/lib/LearningPaths/LearningPathMenuIntro.js +24 -28
- package/lib/LearningPaths/LearningPathMenuModalWrapper.js +22 -27
- package/lib/LearningPaths/LearningPathMobileHeader.js +7 -7
- package/lib/LearningPaths/LearningPathMobileStepInfo.js +10 -8
- package/lib/LearningPaths/LearningPathSticky.js +24 -21
- package/lib/LearningPaths/LearningPathWrapper.js +6 -4
- package/lib/LearningPaths/index.js +10 -10
- package/lib/LetterFilter/LetterFilter.js +18 -22
- package/lib/LetterFilter/alphabet.js +1 -2
- package/lib/LetterFilter/index.js +1 -2
- package/lib/LicenseByline/EmbedByline.js +38 -44
- package/lib/LicenseByline/LicenseDescription.js +7 -6
- package/lib/LicenseByline/LicenseLink.js +8 -8
- package/lib/LicenseByline/index.js +1 -1
- package/lib/LinkBlock/LinkBlock.js +18 -17
- package/lib/LinkBlock/LinkBlockSection.js +15 -23
- package/lib/LinkBlock/index.js +2 -2
- package/lib/List/OrderedList.js +20 -25
- package/lib/List/UnOrderedList.js +13 -20
- package/lib/List/index.js +2 -2
- package/lib/Logo/Logo.js +27 -31
- package/lib/Logo/SvgLogo.js +20 -23
- package/lib/Logo/index.js +1 -2
- package/lib/Masthead/Masthead.js +24 -31
- package/lib/Masthead/SkipToMainContent.js +10 -8
- package/lib/Masthead/index.js +4 -5
- package/lib/Masthead/utils.js +20 -30
- package/lib/MediaList/MediaList.js +91 -78
- package/lib/MediaList/index.js +6 -6
- package/lib/Messages/MessageBanner.js +21 -18
- package/lib/Messages/MessageBox.js +27 -28
- package/lib/Messages/index.js +2 -2
- package/lib/MyNdla/Resource/Folder.js +42 -38
- package/lib/MyNdla/Resource/FolderInput.js +26 -34
- package/lib/MyNdla/Resource/index.js +2 -2
- package/lib/MyNdla/index.js +2 -2
- package/lib/NDLAFilm/AboutNdlaFilm.js +11 -9
- package/lib/NDLAFilm/AllMoviesAlphabetically.js +58 -68
- package/lib/NDLAFilm/FilmContentCard.js +35 -48
- package/lib/NDLAFilm/FilmContentCardTags.js +15 -18
- package/lib/NDLAFilm/FilmMovieList.js +16 -19
- package/lib/NDLAFilm/FilmMovieSearch.js +35 -38
- package/lib/NDLAFilm/FilmSlideshow.js +39 -59
- package/lib/NDLAFilm/MovieGrid.js +24 -28
- package/lib/NDLAFilm/VisualElement.js +18 -15
- package/lib/NDLAFilm/filmStyles.js +14 -14
- package/lib/NDLAFilm/index.js +6 -6
- package/lib/NDLAFilm/isLetter.js +3 -3
- package/lib/Navigation/NavigationBox.js +81 -96
- package/lib/Navigation/index.js +1 -1
- package/lib/NoContentBox/NoContentBox.js +7 -6
- package/lib/NoContentBox/index.js +1 -2
- package/lib/Notion/Notion.js +31 -34
- package/lib/Notion/NotionImage.js +13 -10
- package/lib/Notion/index.js +1 -1
- package/lib/Programme/Programme.js +42 -26
- package/lib/Programme/ProgrammeSubjects.js +20 -27
- package/lib/Programme/index.js +2 -3
- package/lib/ProgrammeCard/ProgrammeCard.js +11 -10
- package/lib/ProgrammeCard/index.js +1 -1
- package/lib/RelatedArticleList/RelatedArticleList.js +57 -75
- package/lib/RelatedArticleList/index.js +2 -3
- package/lib/Resource/BlockResource.js +41 -38
- package/lib/Resource/ListResource.js +50 -45
- package/lib/Resource/index.js +2 -2
- package/lib/Resource/resourceComponents.js +77 -88
- package/lib/Resource/storyComponents.js +28 -31
- package/lib/ResourceBox/ResourceBox.js +15 -14
- package/lib/ResourceBox/index.js +1 -1
- package/lib/ResourceGroup/ResourceGroup.js +15 -15
- package/lib/ResourceGroup/ResourceItem.js +65 -47
- package/lib/ResourceGroup/ResourceList.js +26 -34
- package/lib/ResourceGroup/index.js +1 -2
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +30 -27
- package/lib/ResourcesWrapper/ResourcesWrapper.js +13 -19
- package/lib/ResourcesWrapper/index.js +2 -3
- package/lib/Search/ActiveFilterContent.js +10 -12
- package/lib/Search/ActiveFilters.js +34 -29
- package/lib/Search/ContentTypeResult.js +50 -68
- package/lib/Search/ContentTypeResultStyles.js +20 -38
- package/lib/Search/IsPathToHighlight.js +2 -2
- package/lib/Search/LoadingWrapper.js +6 -5
- package/lib/Search/SearchField.js +51 -56
- package/lib/Search/SearchFieldForm.js +9 -9
- package/lib/Search/SearchResult.js +53 -59
- package/lib/Search/SearchResultSleeve.js +76 -97
- package/lib/Search/index.js +4 -4
- package/lib/SearchTypeResult/ActiveFilterContent.js +18 -19
- package/lib/SearchTypeResult/ActiveFilters.js +47 -44
- package/lib/SearchTypeResult/PopupFilter.js +40 -55
- package/lib/SearchTypeResult/ResultNavigation.js +23 -24
- package/lib/SearchTypeResult/SearchFieldHeader.js +35 -49
- package/lib/SearchTypeResult/SearchFilterContent.js +20 -18
- package/lib/SearchTypeResult/SearchHeader.js +54 -65
- package/lib/SearchTypeResult/SearchItem.js +37 -37
- package/lib/SearchTypeResult/SearchItemList.js +46 -48
- package/lib/SearchTypeResult/SearchItems.js +25 -27
- package/lib/SearchTypeResult/SearchNotionsResult.js +17 -15
- package/lib/SearchTypeResult/SearchSubjectItem.js +30 -22
- package/lib/SearchTypeResult/SearchSubjectResult.js +18 -19
- package/lib/SearchTypeResult/SearchTypeHeader.js +47 -48
- package/lib/SearchTypeResult/SearchTypeResult.js +26 -29
- package/lib/SearchTypeResult/SearchViewType.js +23 -27
- package/lib/SearchTypeResult/components/ItemContexts.js +46 -46
- package/lib/SearchTypeResult/components/ItemResourceHeader.js +31 -38
- package/lib/SearchTypeResult/components/ItemTopicHeader.js +21 -19
- package/lib/SearchTypeResult/components/SubjectFilters.js +56 -80
- package/lib/SearchTypeResult/index.js +6 -6
- package/lib/SectionHeading/SectionHeading.js +12 -13
- package/lib/SectionHeading/index.js +1 -2
- package/lib/SnackBar/DefaultSnackbar.js +15 -15
- package/lib/SnackBar/SnackbarProvider.js +67 -99
- package/lib/SnackBar/index.js +4 -4
- package/lib/Subject/SubjectBanner.js +10 -15
- package/lib/Subject/SubjectHeader.js +15 -23
- package/lib/Subject/index.js +2 -2
- package/lib/Table/Table.js +44 -62
- package/lib/Table/index.js +4 -6
- package/lib/TagSelector/Control.js +20 -23
- package/lib/TagSelector/DropdownIndicator.js +31 -38
- package/lib/TagSelector/Input.js +15 -19
- package/lib/TagSelector/Menu.js +12 -19
- package/lib/TagSelector/MenuList.js +20 -24
- package/lib/TagSelector/Option.js +35 -32
- package/lib/TagSelector/SelectContainer.js +19 -21
- package/lib/TagSelector/TagSelector.js +65 -103
- package/lib/TagSelector/ValueButton.js +30 -29
- package/lib/TagSelector/ariaMessages.js +83 -81
- package/lib/TagSelector/index.js +1 -1
- package/lib/ToolboxPage/ToolboxInfo.js +12 -10
- package/lib/ToolboxPage/index.js +1 -1
- package/lib/Topic/Loader.js +97 -100
- package/lib/Topic/Topic.js +57 -60
- package/lib/Topic/index.js +1 -2
- package/lib/TreeStructure/AddFolderButton.js +29 -29
- package/lib/TreeStructure/ComboboxButton.js +28 -30
- package/lib/TreeStructure/FolderItem.js +71 -78
- package/lib/TreeStructure/FolderItems.js +40 -45
- package/lib/TreeStructure/TreeStructure.js +59 -98
- package/lib/TreeStructure/arrowNavigation.js +5 -7
- package/lib/TreeStructure/helperFunctions.js +19 -24
- package/lib/TreeStructure/index.js +1 -1
- package/lib/i18n/formatNestedMessages.js +8 -9
- package/lib/i18n/i18n.js +3 -5
- package/lib/i18n/index.js +2 -2
- package/lib/index.js +175 -176
- package/lib/locale/LocaleProvider.js +14 -10
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +107 -40
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +107 -40
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +114 -47
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +106 -39
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +111 -44
- package/lib/model/ContentType.js +37 -53
- package/lib/model/SubjectCategories.js +4 -8
- package/lib/model/SubjectTypes.js +3 -6
- package/lib/model/WordClass.js +2 -3
- package/lib/model/index.js +8 -10
- package/lib/types.js +1 -1
- package/lib/utils/relativeUrl.js +11 -11
- package/lib/utils/resourceTypeColor.js +5 -4
- package/package.json +3 -3
- package/src/NDLAFilm/filmStyles.ts +9 -2
- package/src/locale/messages-en.ts +1 -0
- package/src/locale/messages-nb.ts +2 -1
- package/src/locale/messages-nn.ts +9 -8
- package/src/locale/messages-se.ts +1 -0
- package/src/locale/messages-sma.ts +6 -5
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
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); }
|
|
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
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
-
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); }
|
|
14
|
-
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; }
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
1
|
/*
|
|
18
2
|
* Copyright (c) 2016-present, NDLA.
|
|
19
3
|
*
|
|
@@ -33,58 +17,44 @@ import ActiveFilters from '../Search/ActiveFilters';
|
|
|
33
17
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
34
18
|
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
35
19
|
import { Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
36
|
-
|
|
20
|
+
const is2DArray = options => {
|
|
37
21
|
return Array.isArray(options[0]);
|
|
38
22
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
modifiers =
|
|
45
|
-
onChange
|
|
46
|
-
options
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
64
|
-
open = _useState2[0],
|
|
65
|
-
setOpen = _useState2[1];
|
|
66
|
-
var _useState3 = useState(false),
|
|
67
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
68
|
-
isNarrowScreen = _useState4[0],
|
|
69
|
-
setIsNarrowScreen = _useState4[1];
|
|
70
|
-
var _useState5 = useState(defaultVisibleCount),
|
|
71
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
72
|
-
visibleCount = _useState6[0],
|
|
73
|
-
setVisibleCount = _useState6[1];
|
|
74
|
-
useEffect(function () {
|
|
23
|
+
const FilterListPhone = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
preid,
|
|
26
|
+
label,
|
|
27
|
+
labelNotVisible,
|
|
28
|
+
modifiers = '',
|
|
29
|
+
onChange,
|
|
30
|
+
options,
|
|
31
|
+
values = [],
|
|
32
|
+
defaultVisibleCount,
|
|
33
|
+
showLabel,
|
|
34
|
+
hideLabel,
|
|
35
|
+
alignedGroup = false,
|
|
36
|
+
collapseMobile = true,
|
|
37
|
+
activeFiltersNarrow,
|
|
38
|
+
messages,
|
|
39
|
+
viewMode = 'inlineDesktop',
|
|
40
|
+
isGroupedOptions,
|
|
41
|
+
showActiveFiltersOnSmallScreen
|
|
42
|
+
} = _ref;
|
|
43
|
+
const [open, setOpen] = useState(false);
|
|
44
|
+
const [isNarrowScreen, setIsNarrowScreen] = useState(false);
|
|
45
|
+
const [visibleCount, setVisibleCount] = useState(defaultVisibleCount);
|
|
46
|
+
useEffect(() => {
|
|
75
47
|
setScreenSize(true);
|
|
76
|
-
|
|
77
|
-
return setScreenSize(false);
|
|
78
|
-
}, 50);
|
|
48
|
+
const debounced = debounce(() => setScreenSize(false), 50);
|
|
79
49
|
window.addEventListener('resize', debounced);
|
|
80
|
-
return
|
|
50
|
+
return () => {
|
|
81
51
|
debounced.cancel();
|
|
82
52
|
window.removeEventListener('resize', debounced);
|
|
83
53
|
};
|
|
84
54
|
}, []);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
55
|
+
const setScreenSize = function () {
|
|
56
|
+
let initial = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
57
|
+
const newIsNarrowScreen = (window.innerWidth || document.documentElement.clientWidth) < 768;
|
|
88
58
|
|
|
89
59
|
/* eslint react/no-did-mount-set-state: 0 */
|
|
90
60
|
if (initial && newIsNarrowScreen || !initial) {
|
|
@@ -92,175 +62,163 @@ var FilterListPhone = function FilterListPhone(_ref) {
|
|
|
92
62
|
}
|
|
93
63
|
/* eslint react/no-did-mount-set-state: 1 */
|
|
94
64
|
};
|
|
95
|
-
|
|
96
|
-
var onClose = useCallback(function () {
|
|
65
|
+
const onClose = useCallback(() => {
|
|
97
66
|
setOpen(false);
|
|
98
67
|
}, []);
|
|
99
|
-
|
|
100
|
-
|
|
68
|
+
const handleChange = (event, option) => {
|
|
69
|
+
let newValues = null;
|
|
101
70
|
if (event.currentTarget.checked) {
|
|
102
|
-
newValues = [
|
|
71
|
+
newValues = [...values, option.value];
|
|
103
72
|
} else {
|
|
104
|
-
newValues = values.filter(
|
|
105
|
-
return value !== option.value;
|
|
106
|
-
});
|
|
73
|
+
newValues = values.filter(value => value !== option.value);
|
|
107
74
|
}
|
|
108
75
|
if (onChange) {
|
|
109
76
|
onChange(newValues, option.value);
|
|
110
77
|
}
|
|
111
78
|
};
|
|
112
|
-
|
|
113
|
-
|
|
79
|
+
const showAll = defaultVisibleCount === undefined || options.length <= defaultVisibleCount;
|
|
80
|
+
const labelModifiers = [];
|
|
114
81
|
if (labelNotVisible) {
|
|
115
82
|
labelModifiers.push('hidden');
|
|
116
83
|
}
|
|
117
|
-
|
|
84
|
+
const groupedOptions = is2DArray(options) ? options : [options];
|
|
118
85
|
if (isNarrowScreen || viewMode === 'allModal') {
|
|
119
|
-
|
|
120
|
-
groupedOptions.forEach(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return value === option.value;
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
currentlyActiveFilters = [].concat(_toConsumableArray(currentlyActiveFilters), _toConsumableArray(activeFilters));
|
|
86
|
+
let currentlyActiveFilters = [];
|
|
87
|
+
groupedOptions.forEach(options => {
|
|
88
|
+
const activeFilters = options.filter(option => values.some(value => value === option.value));
|
|
89
|
+
currentlyActiveFilters = [...currentlyActiveFilters, ...activeFilters];
|
|
127
90
|
});
|
|
128
|
-
|
|
91
|
+
const wrapperClassName = activeFiltersNarrow || viewMode === 'allModal' ? classes('narrow-active-filters').className : '';
|
|
129
92
|
return _jsxs("div", {
|
|
130
93
|
className: wrapperClassName,
|
|
131
94
|
children: [currentlyActiveFilters.length > 0 && _jsx(ActiveFilters, {
|
|
132
95
|
filters: currentlyActiveFilters,
|
|
133
96
|
showOnSmallScreen: showActiveFiltersOnSmallScreen,
|
|
134
|
-
onFilterRemove:
|
|
135
|
-
onChange(values.filter(
|
|
136
|
-
return option !== value;
|
|
137
|
-
}), value);
|
|
97
|
+
onFilterRemove: value => {
|
|
98
|
+
onChange(values.filter(option => option !== value), value);
|
|
138
99
|
}
|
|
139
100
|
}), _jsxs(Modal, {
|
|
140
101
|
open: open,
|
|
141
102
|
onOpenChange: setOpen,
|
|
142
103
|
children: [_jsx(ModalTrigger, {
|
|
143
|
-
children: _jsx(ButtonV2,
|
|
144
|
-
variant: "outline"
|
|
145
|
-
|
|
104
|
+
children: _jsx(ButtonV2, {
|
|
105
|
+
variant: "outline",
|
|
106
|
+
...classes('modal-button'),
|
|
146
107
|
children: messages.openFilter
|
|
147
|
-
})
|
|
108
|
+
})
|
|
148
109
|
}), _jsxs(ModalContent, {
|
|
149
110
|
size: "full",
|
|
150
111
|
children: [_jsx(ModalHeader, {
|
|
151
|
-
children: _jsxs("div",
|
|
152
|
-
|
|
153
|
-
|
|
112
|
+
children: _jsxs("div", {
|
|
113
|
+
...classes('modal-header'),
|
|
114
|
+
children: [_jsxs("div", {
|
|
115
|
+
...classes('modal-heading'),
|
|
116
|
+
children: [!isNarrowScreen && label && _jsx("h1", {
|
|
117
|
+
...classes('label'),
|
|
154
118
|
children: label
|
|
155
|
-
})
|
|
119
|
+
}), _jsx(ButtonV2, {
|
|
156
120
|
variant: "outline",
|
|
157
121
|
onClick: onClose,
|
|
158
122
|
children: messages.useFilter
|
|
159
123
|
})]
|
|
160
|
-
})
|
|
124
|
+
}), _jsx(ModalCloseButton, {
|
|
161
125
|
title: messages.closeFilter
|
|
162
126
|
})]
|
|
163
|
-
})
|
|
127
|
+
})
|
|
164
128
|
}), _jsxs(ModalBody, {
|
|
165
129
|
modifier: "no-side-padding-mobile",
|
|
166
|
-
children: [isNarrowScreen && label && _jsx("h1",
|
|
130
|
+
children: [isNarrowScreen && label && _jsx("h1", {
|
|
131
|
+
...classes('label'),
|
|
167
132
|
children: label
|
|
168
|
-
})
|
|
169
|
-
|
|
133
|
+
}), groupedOptions.map((options, index) => _jsx("ul", {
|
|
134
|
+
...classes('item-wrapper', {
|
|
170
135
|
'aligned-grouping': !!alignedGroup,
|
|
171
136
|
'collapse-mobile': !!collapseMobile,
|
|
172
137
|
'grouped-options': !!isGroupedOptions
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}, option.value);
|
|
196
|
-
})
|
|
197
|
-
}), index);
|
|
198
|
-
}), _jsx("div", _objectSpread(_objectSpread({}, classes('usefilter-wrapper')), {}, {
|
|
138
|
+
}),
|
|
139
|
+
children: options.map(option => {
|
|
140
|
+
const itemModifiers = [];
|
|
141
|
+
const checked = values.some(value => value === option.value);
|
|
142
|
+
if (option.noResults) {
|
|
143
|
+
itemModifiers.push('no-results');
|
|
144
|
+
}
|
|
145
|
+
if (option.disabled) {
|
|
146
|
+
itemModifiers.push('disabled');
|
|
147
|
+
}
|
|
148
|
+
return _jsx(ToggleItem, {
|
|
149
|
+
id: preid + option.value,
|
|
150
|
+
value: option.value,
|
|
151
|
+
checked: checked,
|
|
152
|
+
onChange: event => handleChange(event, option),
|
|
153
|
+
label: option.title,
|
|
154
|
+
disabled: option.disabled,
|
|
155
|
+
modifiers: itemModifiers
|
|
156
|
+
}, option.value);
|
|
157
|
+
})
|
|
158
|
+
}, index)), _jsx("div", {
|
|
159
|
+
...classes('usefilter-wrapper'),
|
|
199
160
|
children: _jsx(ButtonV2, {
|
|
200
161
|
variant: "outline",
|
|
201
162
|
onClick: onClose,
|
|
202
163
|
children: messages.useFilter
|
|
203
164
|
})
|
|
204
|
-
})
|
|
165
|
+
})]
|
|
205
166
|
})]
|
|
206
167
|
})]
|
|
207
168
|
})]
|
|
208
169
|
});
|
|
209
170
|
}
|
|
210
171
|
return _jsxs(_Fragment, {
|
|
211
|
-
children: [isGroupedOptions && label && _jsx("h2",
|
|
172
|
+
children: [isGroupedOptions && label && _jsx("h2", {
|
|
173
|
+
...classes('label', labelModifiers),
|
|
212
174
|
children: label
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
})
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
})
|
|
261
|
-
}))]
|
|
262
|
-
}), index);
|
|
263
|
-
})]
|
|
175
|
+
}), groupedOptions.map((options, index) => _jsxs("section", {
|
|
176
|
+
...classes('list', modifiers),
|
|
177
|
+
children: [!isGroupedOptions && label && _jsx("h1", {
|
|
178
|
+
...classes('label', labelModifiers),
|
|
179
|
+
children: label
|
|
180
|
+
}), _jsx("ul", {
|
|
181
|
+
...classes('item-wrapper'),
|
|
182
|
+
children: options.map((option, index) => {
|
|
183
|
+
const itemModifiers = [];
|
|
184
|
+
const checked = values.some(value => value === option.value);
|
|
185
|
+
if (!showAll && !checked && !!visibleCount && index + 1 > visibleCount) {
|
|
186
|
+
itemModifiers.push('hidden');
|
|
187
|
+
}
|
|
188
|
+
if (option.noResults) {
|
|
189
|
+
itemModifiers.push('no-results');
|
|
190
|
+
}
|
|
191
|
+
if (option.disabled) {
|
|
192
|
+
itemModifiers.push('disabled');
|
|
193
|
+
}
|
|
194
|
+
return _jsx(ToggleItem, {
|
|
195
|
+
id: preid + option.value,
|
|
196
|
+
value: option.value,
|
|
197
|
+
tabIndex: option.noResults ? -1 : 0,
|
|
198
|
+
checked: checked,
|
|
199
|
+
onChange: event => handleChange(event, option),
|
|
200
|
+
label: option.title,
|
|
201
|
+
modifiers: itemModifiers,
|
|
202
|
+
disabled: option.disabled
|
|
203
|
+
}, option.value);
|
|
204
|
+
})
|
|
205
|
+
}), !showAll && _jsx("button", {
|
|
206
|
+
...classes('expand'),
|
|
207
|
+
type: "button",
|
|
208
|
+
onClick: () => {
|
|
209
|
+
setVisibleCount(prev => prev === defaultVisibleCount ? options.length : defaultVisibleCount);
|
|
210
|
+
},
|
|
211
|
+
children: visibleCount === defaultVisibleCount ? _jsxs(_Fragment, {
|
|
212
|
+
children: [_jsx("span", {
|
|
213
|
+
children: showLabel
|
|
214
|
+
}), " ", _jsx(ChevronDown, {})]
|
|
215
|
+
}) : _jsxs(_Fragment, {
|
|
216
|
+
children: [_jsx("span", {
|
|
217
|
+
children: hideLabel
|
|
218
|
+
}), " ", _jsx(ChevronUp, {})]
|
|
219
|
+
})
|
|
220
|
+
})]
|
|
221
|
+
}, index))]
|
|
264
222
|
});
|
|
265
223
|
};
|
|
266
224
|
export default FilterListPhone;
|
package/es/Filter/ToggleItem.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
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); }
|
|
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
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
1
|
/*
|
|
8
2
|
* Copyright (c) 2017-present, NDLA.
|
|
9
3
|
*
|
|
@@ -15,21 +9,23 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
15
9
|
import { classes } from './filterClasses';
|
|
16
10
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
17
11
|
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
checked =
|
|
22
|
-
modifiers
|
|
23
|
-
label
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return _jsxs(Component,
|
|
32
|
-
|
|
12
|
+
const ToggleItem = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
id,
|
|
15
|
+
checked = false,
|
|
16
|
+
modifiers,
|
|
17
|
+
label,
|
|
18
|
+
component: Component = 'li',
|
|
19
|
+
onChange,
|
|
20
|
+
tabIndex,
|
|
21
|
+
value,
|
|
22
|
+
disabled,
|
|
23
|
+
hits
|
|
24
|
+
} = _ref;
|
|
25
|
+
return _jsxs(Component, {
|
|
26
|
+
...classes('item', modifiers),
|
|
27
|
+
children: [_jsx("input", {
|
|
28
|
+
...classes('input'),
|
|
33
29
|
type: "checkbox",
|
|
34
30
|
id: id,
|
|
35
31
|
value: value,
|
|
@@ -37,12 +33,15 @@ var ToggleItem = function ToggleItem(_ref) {
|
|
|
37
33
|
tabIndex: tabIndex,
|
|
38
34
|
checked: checked,
|
|
39
35
|
onChange: onChange
|
|
40
|
-
})
|
|
36
|
+
}), _jsxs("label", {
|
|
41
37
|
htmlFor: id,
|
|
42
|
-
children: [_jsx("span",
|
|
43
|
-
|
|
44
|
-
})
|
|
38
|
+
children: [_jsx("span", {
|
|
39
|
+
...classes('item-checkbox')
|
|
40
|
+
}), _jsxs("span", {
|
|
41
|
+
...classes('text'),
|
|
42
|
+
children: [label, hits !== undefined && ` (${hits})`]
|
|
43
|
+
})]
|
|
45
44
|
})]
|
|
46
|
-
})
|
|
45
|
+
});
|
|
47
46
|
};
|
|
48
47
|
export default ToggleItem;
|
package/es/Footer/EditorName.js
CHANGED
|
@@ -8,12 +8,14 @@ import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export const EditorName = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
title,
|
|
14
|
+
name
|
|
15
|
+
} = _ref;
|
|
14
16
|
return _jsxs("span", {
|
|
15
17
|
children: [_jsx("strong", {
|
|
16
18
|
children: title
|
|
17
|
-
}),
|
|
19
|
+
}), ` ${name}`]
|
|
18
20
|
});
|
|
19
21
|
};
|