@instructure/quiz-core 22.6.0 → 22.7.0
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/banks/api/banks.js +2 -2
- package/es/banks/components/AddBankEntryModal/presenter.js +17 -29
- package/es/banks/components/AddToBankModal/presenter.js +32 -44
- package/es/banks/components/AsyncSearch/index.js +69 -81
- package/es/banks/components/Bank/presenter.js +67 -79
- package/es/banks/components/Bank/styles.js +2 -2
- package/es/banks/components/BankEntriesList/presenter.js +11 -23
- package/es/banks/components/BankEntry/presenter.js +74 -88
- package/es/banks/components/BankEntry/styles.js +2 -2
- package/es/banks/components/BankEntryRow/presenter.js +41 -55
- package/es/banks/components/BankSearch/presenter.js +14 -26
- package/es/banks/components/Banks/presenter.js +90 -102
- package/es/banks/components/BanksList/presenter.js +62 -74
- package/es/banks/components/CopyMoveBankEntryModal/presenter.js +70 -82
- package/es/banks/components/CreateBankModal/presenter.js +31 -43
- package/es/banks/components/EditBankModal/presenter.js +25 -37
- package/es/banks/components/HeaderBreadCrumb/index.js +7 -19
- package/es/banks/components/HeaderMenu/presenter.js +2 -14
- package/es/banks/components/NavWrapper/presenter.js +9 -21
- package/es/banks/components/NavWrapper/styles.js +2 -2
- package/es/banks/components/SharingModal/ContextualIconButton/index.js +10 -22
- package/es/banks/components/SharingModal/RootAccountSharing.js +7 -19
- package/es/banks/components/SharingModal/ShareList/index.js +17 -29
- package/es/banks/components/SharingModal/presenter.js +108 -120
- package/es/building/api/quizEntries.js +2 -2
- package/es/building/components/layout/Sidebar/Sidebar.examples.js +9 -21
- package/es/building/components/layout/Sidebar/SidebarItem/presenter.js +2 -14
- package/es/building/components/layout/Sidebar/Stimulus/presenter.js +2 -14
- package/es/building/components/layout/Sidebar/presenter.js +28 -40
- package/es/building/components/layout/Sidebar/styles.js +2 -2
- package/es/building/components/layout/header/BuildingButtons/presenter.js +23 -35
- package/es/building/components/layout/header/BuildingButtons/styles.js +2 -2
- package/es/building/components/resources/ActionButtons/presenter.js +16 -28
- package/es/building/components/resources/ActionButtons/styles.js +2 -2
- package/es/building/components/resources/AddToBankOptions/index.js +16 -28
- package/es/building/components/resources/BanksTray/presenter.js +21 -33
- package/es/building/components/resources/DeleteStimulusModal/presenter.js +50 -62
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +16 -28
- package/es/building/components/resources/MoveImmutableModal/presenter.js +16 -28
- package/es/building/components/resources/quiz/editButton/EditButton.js +9 -21
- package/es/building/components/resources/quiz/instructions/Edit/presenter.js +2 -14
- package/es/building/components/resources/quiz/instructions/Instructions/presenter.js +25 -37
- package/es/building/components/resources/quiz/instructions/Show/index.js +7 -19
- package/es/building/components/resources/quiz/title/Edit/index.js +26 -38
- package/es/building/components/resources/quiz/title/Show/index.js +7 -19
- package/es/building/components/resources/quiz/title/Title/presenter.js +25 -37
- package/es/building/components/resources/quiz/title/Title/styles.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +47 -59
- package/es/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +2 -14
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +43 -55
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +2 -14
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +31 -43
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +51 -63
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +100 -112
- package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +38 -50
- package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +2 -2
- package/es/common/api/callHandlers.js +2 -2
- package/es/common/components/AccessCodeTextInput/index.js +8 -20
- package/es/common/components/ConfirmationModal/index.js +2 -2
- package/es/common/components/ConfirmationModal/presenter.js +28 -40
- package/es/common/components/ImportModal/ImportFileSelector/index.js +2 -14
- package/es/common/components/ImportModal/presenter.js +46 -58
- package/es/common/components/LearnosityCalculator/index.js +10 -22
- package/es/common/components/MaskedTextInput/index.js +4 -16
- package/es/common/components/Pin/presenter.js +7 -19
- package/es/common/components/PreviewFrame/index.js +2 -14
- package/es/common/components/PrintFontSizeModal/presenter.js +14 -26
- package/es/common/components/RceConfigProvider/presenter.js +2 -2
- package/es/common/components/SDKApp/index.js +9 -21
- package/es/common/components/alerts/presenter.js +10 -22
- package/es/common/components/layout/Page/index.js +2 -14
- package/es/common/components/layout/Page/styles.js +2 -2
- package/es/common/components/layout/header/Calculator/presenter.js +2 -14
- package/es/common/components/layout/header/HeaderMenuButton/presenter.js +10 -22
- package/es/common/components/layout/header/Timer/presenter.js +17 -29
- package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +2 -14
- package/es/common/components/layout/navbar/index.js +28 -40
- package/es/common/components/layout/navbar/styles.js +2 -2
- package/es/common/components/layout/sidebar/PositionSummary/index.js +4 -16
- package/es/common/components/layout/sidebar/Sidebar/Pin.js +7 -19
- package/es/common/components/layout/sidebar/Sidebar/index.js +24 -36
- package/es/common/components/layout/sidebar/Sidebar/styles.js +2 -2
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +8 -20
- package/es/common/components/layout/sidebar/SidebarItem/styles.js +2 -2
- package/es/common/components/layout/sidebar/Stimulus/Collection/presenter.js +12 -24
- package/es/common/components/layout/sidebar/Stimulus/Collection/styles.js +2 -2
- package/es/common/components/layout/sidebar/Stimulus/Summary/presenter.js +10 -22
- package/es/common/components/layout/sidebar/Stimulus/Title/index.js +2 -14
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +7 -19
- package/es/common/components/resources/BankSelection/presenter.js +16 -28
- package/es/common/components/resources/WarningWrapper/index.js +8 -20
- package/es/common/components/resources/entry/EntrySave/presenter.js +25 -37
- package/es/common/components/resources/item/ItemEdit/presenter.js +15 -27
- package/es/common/components/resources/item/ItemOverride/presenter.js +9 -21
- package/es/common/components/resources/item/ItemShow/index.js +2 -14
- package/es/common/components/resources/positionBox/PositionBox.js +2 -14
- package/es/common/components/resources/quiz/AddContent/Body/presenter.js +35 -47
- package/es/common/components/resources/quiz/AddContent/Button/index.js +7 -19
- package/es/common/components/resources/quiz/AddContent/Button/styles.js +2 -2
- package/es/common/components/resources/quiz/AddContent/Modal/presenter.js +2 -14
- package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +33 -45
- package/es/common/components/resources/quiz/info/QuizInfo.js +2 -14
- package/es/common/components/resources/quiz/instructions/Instructions.js +2 -14
- package/es/common/components/resources/quiz/title/Title.js +2 -14
- package/es/common/components/resources/quizSessionResult/Header/index.js +9 -21
- package/es/common/components/resources/quizSessionResult/Info/index.js +7 -19
- package/es/common/components/resources/sessionItemResult/ResultStimulus/index.js +7 -19
- package/es/common/components/resources/sessionItemResult/ResultStimulus/styles.js +2 -2
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +6 -18
- package/es/common/components/resources/sessionItemResult/SessionItemResult/styles.js +2 -2
- package/es/common/components/resources/sessionItemResult/SessionItemResultsList/index.js +11 -23
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +20 -32
- package/es/common/components/resources/stimulus/Stimulus/styles.js +2 -2
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +90 -102
- package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +18 -29
- package/es/common/components/resources/stimulus/StimulusShow/index.js +7 -19
- package/es/common/components/resources/stimulus/StimulusShowInfo/index.js +2 -14
- package/es/common/components/shared/Card/CardContent/index.js +4 -16
- package/es/common/components/shared/Card/CardWrapper/index.js +4 -16
- package/es/common/components/shared/ExpandButton/index.js +2 -14
- package/es/common/components/shared/ExpandButton/styles.js +2 -2
- package/es/common/components/shared/FormattedDuration/index.js +4 -16
- package/es/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +49 -61
- package/es/common/components/shared/IfFeature/presenter.js +2 -14
- package/es/common/components/shared/InteractionTypes/presenter.js +26 -38
- package/es/common/components/shared/PaginatedCollection/presenter.js +7 -19
- package/es/common/components/shared/Paginator/index.js +5 -17
- package/es/common/components/shared/PrintTrigger/presenter.js +31 -43
- package/es/common/components/shared/TagDisplay/index.js +2 -14
- package/es/common/components/shared/TagSelect/presenter.js +43 -55
- package/es/common/components/shared/TagSuggestSelect/presenter.js +18 -30
- package/es/common/components/shared/TagWrapper/presenter.js +7 -19
- package/es/common/components/shared/TimeUnitsInput/index.js +41 -53
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/index.js +6 -18
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/styles.js +2 -2
- package/es/common/components/shared/drag_and_drop/DragHandle/presenter.js +19 -31
- package/es/common/components/shared/file_selector/FileSelector.js +6 -18
- package/es/common/components/shared/functionality/componentWithOutsideClick.js +13 -24
- package/es/common/components/shared/functionality/componentWithOutsideClickEmotion.js +6 -18
- package/es/common/components/shared/functionality/makeEditable.js +11 -23
- package/es/common/components/shared/functionality/makeScrollable.js +13 -25
- package/es/common/components/shared/overlay/index.js +2 -14
- package/es/common/components/shared/return_button/ReturnButton.js +2 -14
- package/es/common/components/shared/spinner/Spinner.js +9 -21
- package/es/common/kinesis/StreamQueue.js +2 -2
- package/es/common/records/Alert.js +2 -14
- package/es/common/records/Bank.js +2 -14
- package/es/common/records/BankEntry.js +19 -17
- package/es/common/records/Item.js +2 -14
- package/es/common/records/ItemAnalysis.js +2 -14
- package/es/common/records/QtiImport.js +2 -14
- package/es/common/records/Quiz.js +9 -20
- package/es/common/records/QuizAnalysis.js +2 -14
- package/es/common/records/QuizEntry.js +25 -36
- package/es/common/records/QuizSession.js +2 -14
- package/es/common/records/QuizSessionEvent.js +2 -14
- package/es/common/records/QuizSessionResult.js +2 -14
- package/es/common/records/Response.js +2 -14
- package/es/common/records/SessionItem.js +5 -17
- package/es/common/records/SessionItemResult.js +2 -14
- package/es/common/records/Stimulus.js +2 -14
- package/es/common/records/baseRecord.js +4 -16
- package/es/common/records/reduxRecord.js +2 -14
- package/es/common/reducers/modifications.js +2 -2
- package/es/common/util/ExhaustivePaginatedFetcher.js +12 -23
- package/es/common/util/Fetcher.js +2 -2
- package/es/common/util/PaginatedFetcher.js +13 -24
- package/es/common/util/ThunkQueue.js +3 -3
- package/es/common/util/jsonify.js +2 -2
- package/es/common/util/localStoreService.js +43 -0
- package/es/common/util/warningHelpers.js +2 -7
- package/es/common/util/withDynamoPagination.js +8 -20
- package/es/configureStore.js +18 -10
- package/es/index.js +1 -0
- package/es/messages/StorageExhaustionError.js +6 -18
- package/es/messages/postMessageService.js +2 -2
- package/es/moderating/components/events/Event.js +2 -14
- package/es/moderating/components/events/PageBlurredEvent.js +2 -14
- package/es/moderating/components/events/PageFocusedEvent.js +2 -14
- package/es/moderating/components/events/RCEEvent.js +2 -14
- package/es/moderating/components/events/ResponseEvent.js +5 -17
- package/es/moderating/components/events/SessionStartEvent.js +2 -14
- package/es/moderating/components/events/SessionSubmitEvent.js +2 -14
- package/es/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/ExtraAttemptsInput/index.js +8 -20
- package/es/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/index.js +18 -30
- package/es/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +21 -33
- package/es/moderating/components/resources/AccommodationsModal/ExtraTimeSettings/index.js +22 -34
- package/es/moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings/index.js +12 -24
- package/es/moderating/components/resources/AccommodationsModal/index.js +34 -46
- package/es/moderating/components/resources/ElapsedTime.js +2 -14
- package/es/moderating/components/resources/ModerateTable/presenter.js +66 -78
- package/es/moderating/components/resources/ModerateTable/styles.js +2 -2
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +33 -45
- package/es/moderating/components/resources/OutstandingQuizzesModal/presenter.js +30 -42
- package/es/moderating/components/sidebar/ModerateTray/presenter.js +40 -52
- package/es/moderating/components/sidebar/ResetQuiz/presenter.js +15 -27
- package/es/reporting/components/Caption/index.js +2 -14
- package/es/reporting/components/MetricsListItem/index.js +4 -16
- package/es/reporting/components/charts/CentileDistribution/presenter.js +16 -28
- package/es/reporting/components/charts/Distribution/presenter.js +23 -35
- package/es/reporting/components/charts/Legend/index.js +6 -18
- package/es/reporting/components/charts/Legend/styles.js +2 -2
- package/es/reporting/components/charts/QuintileDistribution/presenter.js +19 -31
- package/es/reporting/components/itemAnalysis/AnswerFrequencySummary/index.js +10 -22
- package/es/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +21 -33
- package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +8 -20
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/presenter.js +2 -14
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisPopoverMetric/presenter.js +2 -14
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/AggregationType/presenter.js +9 -21
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +9 -21
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +24 -36
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +7 -19
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +13 -25
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +9 -21
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +34 -46
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +15 -27
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +16 -28
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +47 -59
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +29 -41
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +16 -28
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +13 -25
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +9 -21
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +30 -42
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +15 -27
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +11 -23
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +40 -52
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +53 -65
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +22 -34
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +22 -34
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/BlankIcon/presenter.js +2 -14
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +51 -63
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +24 -36
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +46 -58
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/styles.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +8 -20
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +62 -74
- package/es/reporting/components/resources/OutcomeAnalysis/presenter.js +2 -14
- package/es/reporting/components/resources/QuizAndItemAnalysis/presenter.js +22 -34
- package/es/reporting/components/resources/ReportCard/index.js +2 -14
- package/es/reporting/components/resources/ReportList/index.js +2 -14
- package/es/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +45 -57
- package/es/reporting/components/resources/StudentAnalysis/ReportCard/styles.js +2 -2
- package/es/reporting/components/resources/common/AnalysisUpdateDate/index.js +2 -14
- package/lib/banks/api/banks.js +2 -2
- package/lib/banks/components/AddBankEntryModal/index.js +2 -2
- package/lib/banks/components/AddBankEntryModal/presenter.js +19 -31
- package/lib/banks/components/AddToBankModal/index.js +2 -2
- package/lib/banks/components/AddToBankModal/presenter.js +34 -46
- package/lib/banks/components/AsyncSearch/index.js +71 -83
- package/lib/banks/components/Bank/index.js +2 -2
- package/lib/banks/components/Bank/presenter.js +69 -81
- package/lib/banks/components/Bank/styles.js +2 -2
- package/lib/banks/components/BankEntriesList/presenter.js +11 -23
- package/lib/banks/components/BankEntry/presenter.js +74 -88
- package/lib/banks/components/BankEntry/styles.js +2 -2
- package/lib/banks/components/BankEntryRow/index.js +2 -2
- package/lib/banks/components/BankEntryRow/presenter.js +43 -57
- package/lib/banks/components/BankSearch/presenter.js +14 -26
- package/lib/banks/components/Banks/index.js +2 -2
- package/lib/banks/components/Banks/presenter.js +92 -104
- package/lib/banks/components/BanksList/presenter.js +64 -76
- package/lib/banks/components/CopyMoveBankEntryModal/index.js +2 -2
- package/lib/banks/components/CopyMoveBankEntryModal/presenter.js +72 -84
- package/lib/banks/components/CreateBankModal/index.js +2 -2
- package/lib/banks/components/CreateBankModal/presenter.js +33 -45
- package/lib/banks/components/EditBankModal/index.js +2 -2
- package/lib/banks/components/EditBankModal/presenter.js +27 -39
- package/lib/banks/components/HeaderBreadCrumb/index.js +9 -21
- package/lib/banks/components/HeaderMenu/index.js +2 -2
- package/lib/banks/components/HeaderMenu/presenter.js +2 -14
- package/lib/banks/components/NavWrapper/presenter.js +9 -21
- package/lib/banks/components/NavWrapper/styles.js +2 -2
- package/lib/banks/components/SharingModal/ContextualIconButton/index.js +12 -24
- package/lib/banks/components/SharingModal/RootAccountSharing.js +9 -21
- package/lib/banks/components/SharingModal/ShareList/index.js +17 -29
- package/lib/banks/components/SharingModal/presenter.js +110 -122
- package/lib/building/api/quizEntries.js +2 -2
- package/lib/building/components/layout/Sidebar/Sidebar.examples.js +9 -21
- package/lib/building/components/layout/Sidebar/SidebarItem/presenter.js +2 -14
- package/lib/building/components/layout/Sidebar/Stimulus/presenter.js +2 -14
- package/lib/building/components/layout/Sidebar/presenter.js +28 -40
- package/lib/building/components/layout/Sidebar/styles.js +2 -2
- package/lib/building/components/layout/header/BuildingButtons/index.js +2 -2
- package/lib/building/components/layout/header/BuildingButtons/presenter.js +23 -35
- package/lib/building/components/layout/header/BuildingButtons/styles.js +2 -2
- package/lib/building/components/resources/ActionButtons/presenter.js +16 -28
- package/lib/building/components/resources/ActionButtons/styles.js +2 -2
- package/lib/building/components/resources/AddToBankOptions/index.js +16 -28
- package/lib/building/components/resources/BanksTray/presenter.js +23 -35
- package/lib/building/components/resources/DeleteStimulusModal/presenter.js +52 -64
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +16 -28
- package/lib/building/components/resources/MoveImmutableModal/presenter.js +18 -30
- package/lib/building/components/resources/quiz/editButton/EditButton.js +11 -23
- package/lib/building/components/resources/quiz/instructions/Edit/presenter.js +2 -14
- package/lib/building/components/resources/quiz/instructions/Instructions/presenter.js +25 -37
- package/lib/building/components/resources/quiz/instructions/Show/index.js +7 -19
- package/lib/building/components/resources/quiz/title/Edit/index.js +28 -40
- package/lib/building/components/resources/quiz/title/Show/index.js +7 -19
- package/lib/building/components/resources/quiz/title/Title/presenter.js +25 -37
- package/lib/building/components/resources/quiz/title/Title/styles.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +47 -59
- package/lib/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +2 -14
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +43 -55
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +2 -14
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +31 -43
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +51 -63
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/index.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +102 -114
- package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +38 -50
- package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +2 -2
- package/lib/common/api/callHandlers.js +2 -2
- package/lib/common/components/AccessCodeTextInput/index.js +10 -22
- package/lib/common/components/ApiFeatureFlagInitializer/index.js +2 -2
- package/lib/common/components/ConfirmationModal/index.js +2 -2
- package/lib/common/components/ConfirmationModal/presenter.js +30 -42
- package/lib/common/components/ImportModal/ImportFileSelector/index.js +2 -14
- package/lib/common/components/ImportModal/presenter.js +46 -58
- package/lib/common/components/LearnosityCalculator/index.js +12 -24
- package/lib/common/components/MaskedTextInput/index.js +6 -18
- package/lib/common/components/Pin/presenter.js +9 -21
- package/lib/common/components/PreviewFrame/index.js +4 -16
- package/lib/common/components/PrintFontSizeModal/presenter.js +14 -26
- package/lib/common/components/RceConfigProvider/presenter.js +4 -4
- package/lib/common/components/SDKApp/index.js +9 -21
- package/lib/common/components/alerts/presenter.js +10 -22
- package/lib/common/components/layout/Page/index.js +2 -14
- package/lib/common/components/layout/Page/styles.js +2 -2
- package/lib/common/components/layout/header/Calculator/presenter.js +4 -16
- package/lib/common/components/layout/header/HeaderMenuButton/presenter.js +10 -22
- package/lib/common/components/layout/header/Timer/presenter.js +19 -31
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +2 -14
- package/lib/common/components/layout/navbar/index.js +28 -40
- package/lib/common/components/layout/navbar/styles.js +2 -2
- package/lib/common/components/layout/sidebar/PositionSummary/index.js +4 -16
- package/lib/common/components/layout/sidebar/Sidebar/Pin.js +9 -21
- package/lib/common/components/layout/sidebar/Sidebar/index.js +24 -36
- package/lib/common/components/layout/sidebar/Sidebar/styles.js +2 -2
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +8 -20
- package/lib/common/components/layout/sidebar/SidebarItem/styles.js +2 -2
- package/lib/common/components/layout/sidebar/Stimulus/Collection/presenter.js +12 -24
- package/lib/common/components/layout/sidebar/Stimulus/Collection/styles.js +2 -2
- package/lib/common/components/layout/sidebar/Stimulus/Summary/presenter.js +10 -22
- package/lib/common/components/layout/sidebar/Stimulus/Title/index.js +2 -14
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +7 -19
- package/lib/common/components/resources/BankSelection/presenter.js +18 -30
- package/lib/common/components/resources/WarningWrapper/index.js +8 -20
- package/lib/common/components/resources/entry/EntrySave/presenter.js +27 -39
- package/lib/common/components/resources/item/ItemEdit/index.js +2 -2
- package/lib/common/components/resources/item/ItemEdit/presenter.js +17 -29
- package/lib/common/components/resources/item/ItemOverride/index.js +2 -2
- package/lib/common/components/resources/item/ItemOverride/presenter.js +11 -23
- package/lib/common/components/resources/item/ItemShow/index.js +4 -16
- package/lib/common/components/resources/positionBox/PositionBox.js +2 -14
- package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +35 -47
- package/lib/common/components/resources/quiz/AddContent/Button/index.js +7 -19
- package/lib/common/components/resources/quiz/AddContent/Button/styles.js +2 -2
- package/lib/common/components/resources/quiz/AddContent/Modal/presenter.js +4 -16
- package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +33 -45
- package/lib/common/components/resources/quiz/info/QuizInfo.js +4 -16
- package/lib/common/components/resources/quiz/instructions/Instructions.js +2 -14
- package/lib/common/components/resources/quiz/title/Title.js +2 -14
- package/lib/common/components/resources/quizSessionResult/Header/index.js +9 -21
- package/lib/common/components/resources/quizSessionResult/Info/index.js +7 -19
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/index.js +7 -19
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/styles.js +2 -2
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +6 -18
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/styles.js +2 -2
- package/lib/common/components/resources/sessionItemResult/SessionItemResultsList/index.js +11 -23
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +20 -32
- package/lib/common/components/resources/stimulus/Stimulus/styles.js +2 -2
- package/lib/common/components/resources/stimulus/StimulusEdit/index.js +2 -2
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +90 -102
- package/lib/common/components/resources/stimulus/StimulusEditInfo/index.js +2 -2
- package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +18 -29
- package/lib/common/components/resources/stimulus/StimulusShow/index.js +7 -19
- package/lib/common/components/resources/stimulus/StimulusShowInfo/index.js +4 -16
- package/lib/common/components/shared/Card/CardContent/index.js +4 -16
- package/lib/common/components/shared/Card/CardWrapper/index.js +4 -16
- package/lib/common/components/shared/ExpandButton/index.js +2 -14
- package/lib/common/components/shared/ExpandButton/styles.js +2 -2
- package/lib/common/components/shared/FormattedDuration/index.js +6 -18
- package/lib/common/components/shared/GenericAsyncSearch/GenericAsyncSearch.js +51 -63
- package/lib/common/components/shared/IfFeature/presenter.js +2 -14
- package/lib/common/components/shared/InteractionTypes/presenter.js +26 -38
- package/lib/common/components/shared/PaginatedCollection/presenter.js +9 -21
- package/lib/common/components/shared/Paginator/index.js +5 -17
- package/lib/common/components/shared/PrintTrigger/index.js +2 -2
- package/lib/common/components/shared/PrintTrigger/presenter.js +33 -45
- package/lib/common/components/shared/TagDisplay/index.js +2 -14
- package/lib/common/components/shared/TagSelect/presenter.js +45 -57
- package/lib/common/components/shared/TagSuggestSelect/presenter.js +20 -32
- package/lib/common/components/shared/TagWrapper/presenter.js +9 -21
- package/lib/common/components/shared/TimeUnitsInput/index.js +43 -55
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/index.js +6 -18
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/styles.js +2 -2
- package/lib/common/components/shared/drag_and_drop/DragHandle/presenter.js +21 -33
- package/lib/common/components/shared/file_selector/FileSelector.js +6 -18
- package/lib/common/components/shared/functionality/componentWithOutsideClick.js +13 -24
- package/lib/common/components/shared/functionality/componentWithOutsideClickEmotion.js +6 -18
- package/lib/common/components/shared/functionality/makeEditable.js +13 -25
- package/lib/common/components/shared/functionality/makeScrollable.js +15 -27
- package/lib/common/components/shared/overlay/index.js +4 -16
- package/lib/common/components/shared/return_button/ReturnButton.js +4 -16
- package/lib/common/components/shared/spinner/Spinner.js +9 -21
- package/lib/common/kinesis/StreamQueue.js +2 -2
- package/lib/common/records/Alert.js +2 -14
- package/lib/common/records/Bank.js +2 -14
- package/lib/common/records/BankEntry.js +19 -17
- package/lib/common/records/Item.js +2 -14
- package/lib/common/records/ItemAnalysis.js +2 -14
- package/lib/common/records/QtiImport.js +2 -14
- package/lib/common/records/Quiz.js +9 -20
- package/lib/common/records/QuizAnalysis.js +2 -14
- package/lib/common/records/QuizEntry.js +27 -38
- package/lib/common/records/QuizSession.js +2 -14
- package/lib/common/records/QuizSessionEvent.js +2 -14
- package/lib/common/records/QuizSessionResult.js +2 -14
- package/lib/common/records/Response.js +2 -14
- package/lib/common/records/SessionItem.js +5 -17
- package/lib/common/records/SessionItemResult.js +2 -14
- package/lib/common/records/Stimulus.js +2 -14
- package/lib/common/records/baseRecord.js +4 -16
- package/lib/common/records/reduxRecord.js +2 -14
- package/lib/common/reducers/modifications.js +2 -2
- package/lib/common/util/ExhaustivePaginatedFetcher.js +12 -23
- package/lib/common/util/Fetcher.js +2 -2
- package/lib/common/util/PaginatedFetcher.js +13 -24
- package/lib/common/util/ThunkQueue.js +3 -3
- package/lib/common/util/componentForItem.js +2 -2
- package/lib/common/util/interactionTypeRecordForItem.js +2 -2
- package/lib/common/util/jsonify.js +2 -2
- package/lib/common/util/localStoreService.js +50 -0
- package/lib/common/util/warningHelpers.js +2 -7
- package/lib/common/util/withDynamoPagination.js +8 -20
- package/lib/configureStore.js +18 -10
- package/lib/index.js +10 -2
- package/lib/messages/StorageExhaustionError.js +6 -18
- package/lib/messages/postMessageService.js +2 -2
- package/lib/moderating/components/events/Event.js +4 -16
- package/lib/moderating/components/events/PageBlurredEvent.js +4 -16
- package/lib/moderating/components/events/PageFocusedEvent.js +4 -16
- package/lib/moderating/components/events/RCEEvent.js +4 -16
- package/lib/moderating/components/events/ResponseEvent.js +7 -19
- package/lib/moderating/components/events/SessionStartEvent.js +4 -16
- package/lib/moderating/components/events/SessionSubmitEvent.js +4 -16
- package/lib/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/ExtraAttemptsInput/index.js +10 -22
- package/lib/moderating/components/resources/AccommodationsModal/ExtraAttemptSettings/index.js +20 -32
- package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +23 -35
- package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeSettings/index.js +24 -36
- package/lib/moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings/index.js +14 -26
- package/lib/moderating/components/resources/AccommodationsModal/index.js +36 -48
- package/lib/moderating/components/resources/ElapsedTime.js +4 -16
- package/lib/moderating/components/resources/ModerateTable/presenter.js +66 -78
- package/lib/moderating/components/resources/ModerateTable/styles.js +2 -2
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +35 -47
- package/lib/moderating/components/resources/OutstandingQuizzesModal/presenter.js +32 -44
- package/lib/moderating/components/sidebar/ModerateTray/presenter.js +42 -54
- package/lib/moderating/components/sidebar/ResetQuiz/presenter.js +17 -29
- package/lib/reporting/components/Caption/index.js +2 -14
- package/lib/reporting/components/MetricsListItem/index.js +4 -16
- package/lib/reporting/components/charts/CentileDistribution/presenter.js +16 -28
- package/lib/reporting/components/charts/Distribution/presenter.js +23 -35
- package/lib/reporting/components/charts/Legend/index.js +6 -18
- package/lib/reporting/components/charts/Legend/styles.js +2 -2
- package/lib/reporting/components/charts/QuintileDistribution/presenter.js +19 -31
- package/lib/reporting/components/itemAnalysis/AnswerFrequencySummary/index.js +10 -22
- package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +23 -35
- package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +10 -22
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisMetric/presenter.js +2 -14
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnalysisPopoverMetric/presenter.js +2 -14
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/AggregationType/presenter.js +11 -23
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ChoiceType/presenter.js +11 -23
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +24 -36
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +7 -19
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +15 -27
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingType.js +11 -23
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +34 -46
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/OrderingType.js +17 -29
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +18 -30
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +47 -59
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +29 -41
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/presenter.js +18 -30
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/Table/index.js +13 -25
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/ScoreDistributionType/index.js +11 -23
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/presenter.js +32 -44
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +17 -29
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +11 -23
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +40 -52
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +53 -65
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ExpandableCard/presenter.js +22 -34
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +22 -34
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/BlankIcon/presenter.js +2 -14
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +51 -63
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewQuizAnalysis/presenter.js +24 -36
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +46 -58
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/styles.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/presenter.js +10 -22
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +64 -76
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/withAnalysisStatePresenter.js +2 -2
- package/lib/reporting/components/resources/OutcomeAnalysis/presenter.js +4 -16
- package/lib/reporting/components/resources/QuizAndItemAnalysis/presenter.js +22 -34
- package/lib/reporting/components/resources/ReportCard/index.js +2 -14
- package/lib/reporting/components/resources/ReportList/index.js +2 -14
- package/lib/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +47 -59
- package/lib/reporting/components/resources/StudentAnalysis/ReportCard/styles.js +2 -2
- package/lib/reporting/components/resources/StudentAnalysis/withStudentAnalysisReportStatePresenter.js +2 -2
- package/lib/reporting/components/resources/common/AnalysisUpdateDate/index.js +4 -16
- package/lib/taking/api/taking.js +2 -2
- package/package.json +8 -8
|
@@ -5,20 +5,8 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
7
|
var _dec, _class, _InteractionTypes;
|
|
8
|
-
function _callSuper(
|
|
9
|
-
|
|
10
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
11
|
-
if (Reflect.construct.sham) return false;
|
|
12
|
-
if (typeof Proxy === "function") return true;
|
|
13
|
-
try {
|
|
14
|
-
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
derived = _getPrototypeOf(derived);
|
|
20
|
-
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
|
-
}
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
10
|
/** @jsx jsx */
|
|
23
11
|
import { Component } from 'react';
|
|
24
12
|
import PropTypes from 'prop-types';
|
|
@@ -38,18 +26,18 @@ import generateComponentTheme from './theme';
|
|
|
38
26
|
import { withStyleOverrides } from '@instructure/quiz-common';
|
|
39
27
|
export var InteractionTypes = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_InteractionTypes = /*#__PURE__*/function (_Component) {
|
|
40
28
|
function InteractionTypes() {
|
|
41
|
-
var
|
|
29
|
+
var _this;
|
|
42
30
|
_classCallCheck(this, InteractionTypes);
|
|
43
31
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
32
|
args[_key] = arguments[_key];
|
|
45
33
|
}
|
|
46
|
-
|
|
47
|
-
_defineProperty(
|
|
34
|
+
_this = _callSuper(this, InteractionTypes, [].concat(args));
|
|
35
|
+
_defineProperty(_this, "renderInteractionTypeButton", function (intType, i) {
|
|
48
36
|
var onClick, Icon, name, title, automation;
|
|
49
37
|
switch (intType.name) {
|
|
50
38
|
case 'Stimulus':
|
|
51
39
|
onClick = function onClick() {
|
|
52
|
-
return
|
|
40
|
+
return _this.props.addStimulus(false);
|
|
53
41
|
};
|
|
54
42
|
Icon = IconPlusLine;
|
|
55
43
|
name = t('Stimulus');
|
|
@@ -58,7 +46,7 @@ export var InteractionTypes = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
58
46
|
break;
|
|
59
47
|
case 'Passage':
|
|
60
48
|
onClick = function onClick() {
|
|
61
|
-
return
|
|
49
|
+
return _this.props.addStimulus(true);
|
|
62
50
|
};
|
|
63
51
|
Icon = IconPlusLine;
|
|
64
52
|
name = t('Text Block');
|
|
@@ -67,7 +55,7 @@ export var InteractionTypes = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
67
55
|
break;
|
|
68
56
|
default:
|
|
69
57
|
{
|
|
70
|
-
onClick = partial(
|
|
58
|
+
onClick = partial(_this.props.addItem, intType);
|
|
71
59
|
var metadata = interactionTypeMetadata(intType);
|
|
72
60
|
Icon = metadata.icon;
|
|
73
61
|
name = metadata.name;
|
|
@@ -94,29 +82,29 @@ export var InteractionTypes = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
94
82
|
}, jsx(Grid.Col, {
|
|
95
83
|
width: "auto"
|
|
96
84
|
}, jsx("div", {
|
|
97
|
-
css:
|
|
85
|
+
css: _this.props.styles.iconWrapper
|
|
98
86
|
}, jsx(Icon, {
|
|
99
87
|
title: title
|
|
100
88
|
}))), jsx(Grid.Col, null, jsx("div", {
|
|
101
|
-
css:
|
|
89
|
+
css: _this.props.styles.textWrapper
|
|
102
90
|
}, jsx(PresentationContent, null, jsx(Text, {
|
|
103
91
|
color: "primary"
|
|
104
92
|
}, name)))))));
|
|
105
93
|
});
|
|
106
|
-
_defineProperty(
|
|
94
|
+
_defineProperty(_this, "renderInteractionTypeRows", function () {
|
|
107
95
|
var buttons = [];
|
|
108
|
-
var types =
|
|
96
|
+
var types = _this.props.types;
|
|
109
97
|
|
|
110
98
|
// The interaction types are in alphabetical order
|
|
111
99
|
types.sortBy(function (intType) {
|
|
112
100
|
return interactionTypeMetadata(intType).name;
|
|
113
101
|
}).forEach(function (intType, i) {
|
|
114
|
-
var button =
|
|
115
|
-
if (i %
|
|
116
|
-
buttons[Math.floor(i /
|
|
102
|
+
var button = _this.renderInteractionTypeButton(intType, i);
|
|
103
|
+
if (i % _this.props.columns === 0) {
|
|
104
|
+
buttons[Math.floor(i / _this.props.columns)] = [];
|
|
117
105
|
}
|
|
118
|
-
buttons[Math.floor(i /
|
|
119
|
-
width: 12 /
|
|
106
|
+
buttons[Math.floor(i / _this.props.columns)].push(jsx(Grid.Col, {
|
|
107
|
+
width: 12 / _this.props.columns,
|
|
120
108
|
key: intType.slug
|
|
121
109
|
}, button));
|
|
122
110
|
});
|
|
@@ -129,34 +117,34 @@ export var InteractionTypes = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
129
117
|
}, gridCols);
|
|
130
118
|
});
|
|
131
119
|
});
|
|
132
|
-
_defineProperty(
|
|
133
|
-
if (
|
|
120
|
+
_defineProperty(_this, "renderStimulusTypeButton", function () {
|
|
121
|
+
if (_this.props.allowStimulusCreation) {
|
|
134
122
|
var dividerRow = jsx(Grid.Row, {
|
|
135
123
|
key: "divider"
|
|
136
124
|
}, jsx(Grid.Col, {
|
|
137
125
|
key: "divider"
|
|
138
126
|
}, jsx("div", {
|
|
139
|
-
css:
|
|
127
|
+
css: _this.props.styles.stimulusDivider
|
|
140
128
|
})));
|
|
141
129
|
var stimulusRow = jsx(Grid.Row, {
|
|
142
130
|
key: "stimulus"
|
|
143
131
|
}, jsx(Grid.Col, {
|
|
144
|
-
width: 12 /
|
|
132
|
+
width: 12 / _this.props.columns,
|
|
145
133
|
key: "stimulus"
|
|
146
|
-
},
|
|
134
|
+
}, _this.renderInteractionTypeButton({
|
|
147
135
|
name: 'Stimulus',
|
|
148
136
|
slug: 'stimulus'
|
|
149
|
-
})),
|
|
150
|
-
width: 12 /
|
|
137
|
+
})), _this.props.allowPassageCreation && jsx(Grid.Col, {
|
|
138
|
+
width: 12 / _this.props.columns,
|
|
151
139
|
key: "passage"
|
|
152
|
-
},
|
|
140
|
+
}, _this.renderInteractionTypeButton({
|
|
153
141
|
name: 'Passage',
|
|
154
142
|
slug: 'passage'
|
|
155
143
|
})));
|
|
156
144
|
return [dividerRow, stimulusRow];
|
|
157
145
|
}
|
|
158
146
|
});
|
|
159
|
-
return
|
|
147
|
+
return _this;
|
|
160
148
|
}
|
|
161
149
|
_inherits(InteractionTypes, _Component);
|
|
162
150
|
return _createClass(InteractionTypes, [{
|
|
@@ -7,20 +7,8 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
8
|
var _dec, _class, _PaginatedCollection;
|
|
9
9
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
10
|
-
function _callSuper(
|
|
11
|
-
|
|
12
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
13
|
-
if (Reflect.construct.sham) return false;
|
|
14
|
-
if (typeof Proxy === "function") return true;
|
|
15
|
-
try {
|
|
16
|
-
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
17
|
-
} catch (e) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
derived = _getPrototypeOf(derived);
|
|
22
|
-
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
23
|
-
}
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
12
|
/** @jsx jsx */
|
|
25
13
|
import { Component } from 'react';
|
|
26
14
|
import * as Immutable from 'immutable';
|
|
@@ -49,18 +37,18 @@ import generateComponentTheme from './theme';
|
|
|
49
37
|
import { withStyleOverrides } from '@instructure/quiz-common';
|
|
50
38
|
export var PaginatedCollection = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_PaginatedCollection = /*#__PURE__*/function (_Component) {
|
|
51
39
|
function PaginatedCollection() {
|
|
52
|
-
var
|
|
40
|
+
var _this;
|
|
53
41
|
_classCallCheck(this, PaginatedCollection);
|
|
54
42
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
55
43
|
args[_key] = arguments[_key];
|
|
56
44
|
}
|
|
57
|
-
|
|
58
|
-
_defineProperty(
|
|
59
|
-
|
|
45
|
+
_this = _callSuper(this, PaginatedCollection, [].concat(args));
|
|
46
|
+
_defineProperty(_this, "onPageChange", function (nextPage) {
|
|
47
|
+
_this.props.merge(_this.props.stateKey, {
|
|
60
48
|
current: nextPage
|
|
61
49
|
});
|
|
62
50
|
});
|
|
63
|
-
return
|
|
51
|
+
return _this;
|
|
64
52
|
}
|
|
65
53
|
_inherits(PaginatedCollection, _Component);
|
|
66
54
|
return _createClass(PaginatedCollection, [{
|
|
@@ -5,20 +5,8 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
7
|
var _dec, _class, _Paginator;
|
|
8
|
-
function _callSuper(
|
|
9
|
-
|
|
10
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
11
|
-
if (Reflect.construct.sham) return false;
|
|
12
|
-
if (typeof Proxy === "function") return true;
|
|
13
|
-
try {
|
|
14
|
-
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
derived = _getPrototypeOf(derived);
|
|
20
|
-
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
|
-
}
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
10
|
/** @jsx jsx */
|
|
23
11
|
import { Component } from 'react';
|
|
24
12
|
import PropTypes from 'prop-types';
|
|
@@ -37,13 +25,13 @@ export var Paginator = (_dec = withStyleOverrides(generateStyle, generateCompone
|
|
|
37
25
|
return _createClass(Paginator, [{
|
|
38
26
|
key: "renderPagination",
|
|
39
27
|
value: function renderPagination() {
|
|
40
|
-
var
|
|
28
|
+
var _this = this;
|
|
41
29
|
var paginationButtons = Array.from(Array(this.props.totalPages)).map(function (v, i) {
|
|
42
30
|
var page = i + 1;
|
|
43
31
|
return jsx(Pagination.Page, {
|
|
44
32
|
key: page,
|
|
45
|
-
current: page ===
|
|
46
|
-
onClick:
|
|
33
|
+
current: page === _this.props.currentPage,
|
|
34
|
+
onClick: _this.props.onPageChange.bind(null, page)
|
|
47
35
|
}, page);
|
|
48
36
|
});
|
|
49
37
|
return jsx("div", {
|
|
@@ -5,20 +5,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
6
6
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
function _callSuper(
|
|
9
|
-
|
|
10
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
11
|
-
if (Reflect.construct.sham) return false;
|
|
12
|
-
if (typeof Proxy === "function") return true;
|
|
13
|
-
try {
|
|
14
|
-
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
derived = _getPrototypeOf(derived);
|
|
20
|
-
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
|
-
}
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
10
|
import React, { Component } from 'react';
|
|
23
11
|
import PropTypes from 'prop-types';
|
|
24
12
|
import { Overlay, Mask } from '@instructure/ui-overlays';
|
|
@@ -30,66 +18,66 @@ import PrintFontSizeModal from '../../PrintFontSizeModal';
|
|
|
30
18
|
import { PRINT_CURRENT_PAGE, PRINT_BLANK } from '@instructure/quiz-common';
|
|
31
19
|
export var PrintTrigger = /*#__PURE__*/function (_Component) {
|
|
32
20
|
function PrintTrigger(props) {
|
|
33
|
-
var
|
|
21
|
+
var _this;
|
|
34
22
|
_classCallCheck(this, PrintTrigger);
|
|
35
|
-
|
|
36
|
-
_defineProperty(
|
|
23
|
+
_this = _callSuper(this, PrintTrigger, [props]);
|
|
24
|
+
_defineProperty(_this, "state", {
|
|
37
25
|
waitingForPrintingToBeReady: false,
|
|
38
26
|
printType: PRINT_CURRENT_PAGE,
|
|
39
27
|
// quiz key or blank quiz
|
|
40
28
|
shouldPrint: false
|
|
41
29
|
});
|
|
42
|
-
_defineProperty(
|
|
43
|
-
printWithCss(
|
|
30
|
+
_defineProperty(_this, "print", function () {
|
|
31
|
+
printWithCss(_this.fontSize, 100);
|
|
44
32
|
});
|
|
45
|
-
_defineProperty(
|
|
46
|
-
|
|
33
|
+
_defineProperty(_this, "ensurePrintingIsReady", function (printFontSizeModalClose) {
|
|
34
|
+
_this.setState({
|
|
47
35
|
waitingForPrintingToBeReady: true
|
|
48
36
|
});
|
|
49
37
|
var sampleItemFetchPromises = [];
|
|
50
|
-
if (!
|
|
51
|
-
var
|
|
52
|
-
activeQuizId =
|
|
53
|
-
bankQuizEntryIds =
|
|
54
|
-
getSampleItemsForQuizEntry =
|
|
38
|
+
if (!_this.props.isGrading) {
|
|
39
|
+
var _this$props = _this.props,
|
|
40
|
+
activeQuizId = _this$props.activeQuizId,
|
|
41
|
+
bankQuizEntryIds = _this$props.bankQuizEntryIds,
|
|
42
|
+
getSampleItemsForQuizEntry = _this$props.getSampleItemsForQuizEntry;
|
|
55
43
|
sampleItemFetchPromises = bankQuizEntryIds.map(function (bankQuizEntryId) {
|
|
56
44
|
return getSampleItemsForQuizEntry(activeQuizId, bankQuizEntryId);
|
|
57
45
|
});
|
|
58
46
|
}
|
|
59
47
|
var allPromises = [].concat(_toConsumableArray(sampleItemFetchPromises), [ensureImagesLoaded(), printFontSizeModalClose]);
|
|
60
48
|
Promise.all(allPromises).then(function () {
|
|
61
|
-
|
|
49
|
+
_this.setState({
|
|
62
50
|
waitingForPrintingToBeReady: false
|
|
63
51
|
});
|
|
64
|
-
|
|
52
|
+
_this.onExited = function () {};
|
|
65
53
|
});
|
|
66
54
|
});
|
|
67
|
-
_defineProperty(
|
|
55
|
+
_defineProperty(_this, "handlePrintModalSubmit", function (fontSize, shouldPersist) {
|
|
68
56
|
var printFontSizeModalClose = new Promise(function (resolve) {
|
|
69
|
-
|
|
57
|
+
_this.onExited = resolve;
|
|
70
58
|
});
|
|
71
|
-
|
|
59
|
+
_this.props.closePrintFontSizeModal();
|
|
72
60
|
if (shouldPersist) {
|
|
73
|
-
|
|
61
|
+
_this.props.persistPrintFontSize(fontSize);
|
|
74
62
|
} else {
|
|
75
|
-
|
|
63
|
+
_this.props.setPrintFontSize(fontSize);
|
|
76
64
|
}
|
|
77
|
-
if (
|
|
78
|
-
|
|
65
|
+
if (_this.state.printType === PRINT_BLANK) {
|
|
66
|
+
_this.props.navigateToPreviewPrint();
|
|
79
67
|
} else {
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
_this.fontSize = fontSize;
|
|
69
|
+
_this.ensurePrintingIsReady(printFontSizeModalClose);
|
|
82
70
|
}
|
|
83
71
|
});
|
|
84
|
-
_defineProperty(
|
|
85
|
-
|
|
72
|
+
_defineProperty(_this, "handlePrint", function (printType) {
|
|
73
|
+
_this.setState({
|
|
86
74
|
printType: printType
|
|
87
75
|
});
|
|
88
|
-
|
|
76
|
+
_this.props.openPrintFontSizeModal();
|
|
89
77
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return
|
|
78
|
+
_this.onExited = function () {};
|
|
79
|
+
_this.fontSize = '';
|
|
80
|
+
return _this;
|
|
93
81
|
}
|
|
94
82
|
_inherits(PrintTrigger, _Component);
|
|
95
83
|
return _createClass(PrintTrigger, [{
|
|
@@ -5,20 +5,8 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
7
|
var _dec, _class, _TagDisplay;
|
|
8
|
-
function _callSuper(
|
|
9
|
-
|
|
10
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
11
|
-
if (Reflect.construct.sham) return false;
|
|
12
|
-
if (typeof Proxy === "function") return true;
|
|
13
|
-
try {
|
|
14
|
-
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
derived = _getPrototypeOf(derived);
|
|
20
|
-
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
21
|
-
}
|
|
8
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
10
|
/** @jsx jsx */
|
|
23
11
|
import { Component } from 'react';
|
|
24
12
|
import PropTypes from 'prop-types';
|
|
@@ -6,20 +6,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
-
function _callSuper(
|
|
10
|
-
|
|
11
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
12
|
-
if (Reflect.construct.sham) return false;
|
|
13
|
-
if (typeof Proxy === "function") return true;
|
|
14
|
-
try {
|
|
15
|
-
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
16
|
-
} catch (e) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
derived = _getPrototypeOf(derived);
|
|
21
|
-
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
22
|
-
}
|
|
9
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
11
|
import React, { Component } from 'react';
|
|
24
12
|
import PropTypes from 'prop-types';
|
|
25
13
|
import TagWrapper from '../TagWrapper';
|
|
@@ -32,92 +20,92 @@ var tagShape = PropTypes.shape({
|
|
|
32
20
|
});
|
|
33
21
|
export var TagSelect = /*#__PURE__*/function (_Component) {
|
|
34
22
|
function TagSelect() {
|
|
35
|
-
var
|
|
23
|
+
var _this;
|
|
36
24
|
_classCallCheck(this, TagSelect);
|
|
37
25
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
38
26
|
args[_key] = arguments[_key];
|
|
39
27
|
}
|
|
40
|
-
|
|
41
|
-
_defineProperty(
|
|
28
|
+
_this = _callSuper(this, TagSelect, [].concat(args));
|
|
29
|
+
_defineProperty(_this, "state", {
|
|
42
30
|
inputValue: '',
|
|
43
31
|
isShowingOptions: false,
|
|
44
32
|
highlightedOptionId: null
|
|
45
33
|
});
|
|
46
|
-
_defineProperty(
|
|
47
|
-
|
|
34
|
+
_defineProperty(_this, "setInputRef", function (inputRef) {
|
|
35
|
+
_this.inputRef = inputRef;
|
|
48
36
|
});
|
|
49
|
-
_defineProperty(
|
|
50
|
-
|
|
37
|
+
_defineProperty(_this, "handleShowOptions", function () {
|
|
38
|
+
_this.setState({
|
|
51
39
|
isShowingOptions: true
|
|
52
40
|
});
|
|
53
41
|
});
|
|
54
|
-
_defineProperty(
|
|
55
|
-
|
|
42
|
+
_defineProperty(_this, "handleHideOptions", function () {
|
|
43
|
+
_this.setState({
|
|
56
44
|
isShowingOptions: false
|
|
57
45
|
});
|
|
58
46
|
});
|
|
59
|
-
_defineProperty(
|
|
60
|
-
|
|
47
|
+
_defineProperty(_this, "handleBlur", function () {
|
|
48
|
+
_this.setState({
|
|
61
49
|
highlightedOptionId: null
|
|
62
50
|
});
|
|
63
51
|
});
|
|
64
|
-
_defineProperty(
|
|
52
|
+
_defineProperty(_this, "handleHighlightOption", function (event, _ref) {
|
|
65
53
|
var id = _ref.id;
|
|
66
54
|
event.persist();
|
|
67
|
-
var tag =
|
|
68
|
-
|
|
55
|
+
var tag = _this.decodeTag(id);
|
|
56
|
+
_this.setState(function (state) {
|
|
69
57
|
return {
|
|
70
58
|
highlightedOptionId: id,
|
|
71
59
|
inputValue: event.type === 'keydown' ? tag.value : state.inputValue
|
|
72
60
|
};
|
|
73
61
|
});
|
|
74
62
|
});
|
|
75
|
-
_defineProperty(
|
|
63
|
+
_defineProperty(_this, "handleSelectOption", function (event, _ref2) {
|
|
76
64
|
var id = _ref2.id;
|
|
77
65
|
if (id === SELECT_EMPTY_OPTION) return;
|
|
78
|
-
var tag =
|
|
79
|
-
|
|
66
|
+
var tag = _this.decodeTag(id);
|
|
67
|
+
_this.props.onChange([].concat(_toConsumableArray(_this.props.tags), [tag.id ? tag : {
|
|
80
68
|
value: tag.value
|
|
81
69
|
}]));
|
|
82
|
-
|
|
70
|
+
_this.setState({
|
|
83
71
|
highlightedOptionId: null,
|
|
84
72
|
inputValue: '',
|
|
85
73
|
isShowingOptions: false
|
|
86
74
|
});
|
|
87
75
|
});
|
|
88
|
-
_defineProperty(
|
|
76
|
+
_defineProperty(_this, "handleInputChange", function (event) {
|
|
89
77
|
var inputValue = event.target.value !== ' ' ? event.target.value : '';
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
_this.props.onInputChange(inputValue === '' ? null : inputValue);
|
|
79
|
+
_this.setState({
|
|
92
80
|
inputValue: inputValue,
|
|
93
81
|
isShowingOptions: true
|
|
94
82
|
});
|
|
95
83
|
});
|
|
96
|
-
_defineProperty(
|
|
97
|
-
var inputValue =
|
|
84
|
+
_defineProperty(_this, "handleKeyDown", function (event) {
|
|
85
|
+
var inputValue = _this.state.inputValue;
|
|
98
86
|
if (event.keyCode === 8) {
|
|
99
87
|
// when backspace key is pressed
|
|
100
|
-
if (inputValue === '' &&
|
|
88
|
+
if (inputValue === '' && _this.props.tags.length > 0) {
|
|
101
89
|
// remove last selected option, if input has no entered text
|
|
102
|
-
|
|
103
|
-
|
|
90
|
+
_this.props.onChange(_this.props.tags.slice(0, -1));
|
|
91
|
+
_this.setState({
|
|
104
92
|
highlightedOptionId: null
|
|
105
93
|
});
|
|
106
94
|
}
|
|
107
95
|
}
|
|
108
96
|
});
|
|
109
|
-
_defineProperty(
|
|
110
|
-
var tags =
|
|
111
|
-
return
|
|
97
|
+
_defineProperty(_this, "dismissTag", function (encodedTag) {
|
|
98
|
+
var tags = _this.props.tags.filter(function (tag) {
|
|
99
|
+
return _this.encodeTag(tag) !== encodedTag;
|
|
112
100
|
});
|
|
113
|
-
|
|
114
|
-
|
|
101
|
+
_this.props.onChange(tags);
|
|
102
|
+
_this.setState({
|
|
115
103
|
highlightedOptionId: null
|
|
116
104
|
}, function () {
|
|
117
|
-
|
|
105
|
+
_this.inputRef.focus();
|
|
118
106
|
});
|
|
119
107
|
});
|
|
120
|
-
return
|
|
108
|
+
return _this;
|
|
121
109
|
}
|
|
122
110
|
_inherits(TagSelect, _Component);
|
|
123
111
|
return _createClass(TagSelect, [{
|
|
@@ -152,15 +140,15 @@ export var TagSelect = /*#__PURE__*/function (_Component) {
|
|
|
152
140
|
}, {
|
|
153
141
|
key: "renderTags",
|
|
154
142
|
value: function renderTags() {
|
|
155
|
-
var
|
|
143
|
+
var _this2 = this;
|
|
156
144
|
var tags = this.props.tags;
|
|
157
145
|
return tags.map(function (tag, index) {
|
|
158
146
|
return /*#__PURE__*/React.createElement(TagWrapper, {
|
|
159
|
-
key:
|
|
160
|
-
id:
|
|
147
|
+
key: _this2.encodeTag(tag),
|
|
148
|
+
id: _this2.encodeTag(tag),
|
|
161
149
|
index: index,
|
|
162
150
|
text: tag.value,
|
|
163
|
-
onClick:
|
|
151
|
+
onClick: _this2.dismissTag
|
|
164
152
|
});
|
|
165
153
|
});
|
|
166
154
|
}
|
|
@@ -181,7 +169,7 @@ export var TagSelect = /*#__PURE__*/function (_Component) {
|
|
|
181
169
|
}, {
|
|
182
170
|
key: "options",
|
|
183
171
|
value: function options() {
|
|
184
|
-
var
|
|
172
|
+
var _this3 = this;
|
|
185
173
|
var _this$props2 = this.props,
|
|
186
174
|
allowNewTags = _this$props2.allowNewTags,
|
|
187
175
|
tags = _this$props2.tags,
|
|
@@ -189,9 +177,9 @@ export var TagSelect = /*#__PURE__*/function (_Component) {
|
|
|
189
177
|
var notSelectedTagSuggestions = differenceBy(tagSuggestions, tags, 'value');
|
|
190
178
|
var options = notSelectedTagSuggestions.map(function (tag) {
|
|
191
179
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
192
|
-
key:
|
|
193
|
-
id:
|
|
194
|
-
isHighlighted:
|
|
180
|
+
key: _this3.encodeTag(tag),
|
|
181
|
+
id: _this3.encodeTag(tag),
|
|
182
|
+
isHighlighted: _this3.encodeTag(tag) === _this3.state.highlightedOptionId
|
|
195
183
|
}, tag.value);
|
|
196
184
|
});
|
|
197
185
|
var inputValue = this.normalizeSpaces(this.state.inputValue);
|
|
@@ -4,20 +4,8 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
4
4
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
function _callSuper(
|
|
8
|
-
|
|
9
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
10
|
-
if (Reflect.construct.sham) return false;
|
|
11
|
-
if (typeof Proxy === "function") return true;
|
|
12
|
-
try {
|
|
13
|
-
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
14
|
-
} catch (e) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
derived = _getPrototypeOf(derived);
|
|
19
|
-
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
20
|
-
}
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
9
|
import React, { Component } from 'react';
|
|
22
10
|
import Immutable from 'immutable';
|
|
23
11
|
import PropTypes from 'prop-types';
|
|
@@ -30,36 +18,36 @@ var tagShape = PropTypes.shape({
|
|
|
30
18
|
});
|
|
31
19
|
export var TagSuggest = /*#__PURE__*/function (_Component) {
|
|
32
20
|
function TagSuggest() {
|
|
33
|
-
var
|
|
21
|
+
var _this;
|
|
34
22
|
_classCallCheck(this, TagSuggest);
|
|
35
23
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
24
|
args[_key] = arguments[_key];
|
|
37
25
|
}
|
|
38
|
-
|
|
39
|
-
_defineProperty(
|
|
40
|
-
return
|
|
26
|
+
_this = _callSuper(this, TagSuggest, [].concat(args));
|
|
27
|
+
_defineProperty(_this, "debouncedSuggestions", debounce(function (parentType, parentId, tagText) {
|
|
28
|
+
return _this.props.getTagSuggestions(parentType, parentId, tagText);
|
|
41
29
|
}, 200));
|
|
42
|
-
_defineProperty(
|
|
43
|
-
var
|
|
44
|
-
parentType =
|
|
45
|
-
parentId =
|
|
46
|
-
|
|
30
|
+
_defineProperty(_this, "handleTagInputChange", function (tagText) {
|
|
31
|
+
var _this$props = _this.props,
|
|
32
|
+
parentType = _this$props.parentType,
|
|
33
|
+
parentId = _this$props.parentId;
|
|
34
|
+
_this.props.setTagInput(parentType, parentId, tagText);
|
|
47
35
|
if (tagText != null) {
|
|
48
|
-
|
|
36
|
+
_this.debouncedSuggestions(parentType, parentId, tagText);
|
|
49
37
|
} else {
|
|
50
|
-
|
|
38
|
+
_this.props.setTagSuggestions(parentType, parentId, null, tagText);
|
|
51
39
|
}
|
|
52
40
|
});
|
|
53
|
-
return
|
|
41
|
+
return _this;
|
|
54
42
|
}
|
|
55
43
|
_inherits(TagSuggest, _Component);
|
|
56
44
|
return _createClass(TagSuggest, [{
|
|
57
45
|
key: "getTagSuggestions",
|
|
58
46
|
value: function getTagSuggestions() {
|
|
59
|
-
var _this$
|
|
60
|
-
defaultSuggestions = _this$
|
|
61
|
-
tagSuggestions = _this$
|
|
62
|
-
tags = _this$
|
|
47
|
+
var _this$props2 = this.props,
|
|
48
|
+
defaultSuggestions = _this$props2.defaultSuggestions,
|
|
49
|
+
tagSuggestions = _this$props2.tagSuggestions,
|
|
50
|
+
tags = _this$props2.tags;
|
|
63
51
|
var suggestions = tagSuggestions || Immutable.fromJS(defaultSuggestions);
|
|
64
52
|
var visibleTagIds = tags.map(function (tag) {
|
|
65
53
|
return tag.id;
|