@cccsaurora/howler-ui 3.1.0-dev.1493 → 3.1.0-dev.1607
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/api/action/execute.d.ts +1 -1
- package/api/action/index.d.ts +10 -6
- package/api/action/index.js +5 -9
- package/api/action/operations.js +2 -2
- package/api/analytic/comments/index.d.ts +4 -6
- package/api/analytic/comments/react.d.ts +2 -2
- package/api/analytic/favourite.d.ts +2 -4
- package/api/analytic/index.d.ts +7 -4
- package/api/analytic/index.js +2 -2
- package/api/analytic/notebooks/index.d.ts +2 -4
- package/api/analytic/owner.d.ts +1 -1
- package/api/auth/apikey.d.ts +2 -2
- package/api/auth/login.d.ts +2 -2
- package/api/configs/index.d.ts +1 -1
- package/api/dossier.d.ts +16 -0
- package/api/{dossier/index.js → dossier.js} +6 -4
- package/api/help.d.ts +2 -2
- package/api/hit/assign.d.ts +6 -2
- package/api/hit/comments/index.d.ts +4 -6
- package/api/hit/comments/react.d.ts +2 -2
- package/api/hit/index.d.ts +3 -8
- package/api/hit/labels.d.ts +2 -2
- package/api/hit/overwrite.d.ts +1 -1
- package/api/hit/transition.d.ts +1 -1
- package/api/index.d.ts +6 -6
- package/api/index.js +7 -6
- package/api/notebook/environments.d.ts +1 -1
- package/api/notebook/index.d.ts +1 -1
- package/api/overview/index.d.ts +4 -4
- package/api/search/action.d.ts +1 -1
- package/api/search/analytic.d.ts +1 -1
- package/api/search/case.d.ts +1 -1
- package/api/search/count/hit.d.ts +1 -1
- package/api/search/dossier.d.ts +1 -1
- package/api/search/eql/hit.d.ts +1 -1
- package/api/search/explain/hit.d.ts +1 -1
- package/api/search/facet/hit.d.ts +1 -1
- package/api/search/fields/hit.js +1 -2
- package/api/search/fields/user.js +2 -4
- package/api/search/grouped/hit.d.ts +1 -1
- package/api/search/grouped/user.js +3 -0
- package/api/search/histogram/hit.d.ts +1 -1
- package/api/search/hit.d.ts +1 -1
- package/api/search/overview.d.ts +1 -1
- package/api/search/sigma/hit.d.ts +1 -1
- package/api/search/template.d.ts +1 -1
- package/api/search/user.d.ts +30 -2
- package/api/search/user.js +3 -0
- package/api/search/view.d.ts +1 -1
- package/api/socket/viewers.d.ts +1 -1
- package/api/socket/viewers.js +1 -1
- package/api/template/index.d.ts +3 -3
- package/api/template/index.js +2 -2
- package/api/user/avatar/index.d.ts +1 -1
- package/api/user/groups.d.ts +1 -1
- package/api/user/index.d.ts +2 -2
- package/api/user/whoami.d.ts +1 -1
- package/api/utils/createPermissionsApi.d.ts +10 -0
- package/api/utils/createPermissionsApi.js +10 -0
- package/api/v2/case/index.d.ts +4 -4
- package/api/v2/case/items.d.ts +3 -3
- package/api/v2/case/rules.d.ts +3 -3
- package/api/v2/fuzzy.d.ts +1 -1
- package/api/v2/search/facet.d.ts +1 -1
- package/api/v2/search/index.d.ts +1 -1
- package/api/view/favourite.d.ts +2 -4
- package/api/view/index.d.ts +9 -5
- package/api/view/index.js +3 -1
- package/branding/AppBrand.d.ts +2 -2
- package/branding/AppBrand.js +4 -6
- package/components/app/App.js +248 -51
- package/components/app/AppContainer.js +1 -1
- package/components/app/drawers/ApiKeyDrawer.js +13 -5
- package/components/app/drawers/AssignUserDrawer.js +11 -4
- package/components/app/hooks/useMatchers.d.ts +3 -3
- package/components/app/hooks/useMatchers.js +12 -12
- package/components/app/hooks/useMatchers.test.js +15 -14
- package/components/app/hooks/useTitle.js +8 -7
- package/components/app/providers/AnalyticProvider.d.ts +1 -1
- package/components/app/providers/AnalyticProvider.js +7 -4
- package/components/app/providers/ApiConfigProvider.d.ts +2 -1
- package/components/app/providers/ApiConfigProvider.js +12 -10
- package/components/app/providers/AppDrawerProvider.js +2 -2
- package/components/app/providers/AvatarProvider.js +18 -11
- package/components/app/providers/FavouritesProvider.js +56 -86
- package/components/app/providers/FieldProvider.js +1 -1
- package/components/app/providers/GridColumnsProvider.d.ts +1 -1
- package/components/app/providers/GridColumnsProvider.js +17 -4
- package/components/app/providers/GridColumnsProvider.test.js +2 -1
- package/components/app/providers/LocalStorageProvider.d.ts +2 -2
- package/components/app/providers/LocalStorageProvider.js +4 -3
- package/components/app/providers/ModalProvider.js +8 -1
- package/components/app/providers/OverviewProvider.js +10 -2
- package/components/app/providers/ParameterProvider.d.ts +7 -7
- package/components/app/providers/ParameterProvider.js +42 -5
- package/components/app/providers/ParameterProvider.test.js +1 -0
- package/components/app/providers/RecordProvider.js +7 -1
- package/components/app/providers/RecordSearchProvider.d.ts +1 -2
- package/components/app/providers/RecordSearchProvider.js +32 -23
- package/components/app/providers/RecordSearchProvider.test.js +2 -1
- package/components/app/providers/SearchResponseProvider.d.ts +9 -6
- package/components/app/providers/SearchResponseProvider.js +37 -19
- package/components/app/providers/SearchResponseProvider.test.js +37 -11
- package/components/app/providers/SocketProvider.js +6 -4
- package/components/app/providers/UserListProvider.d.ts +1 -1
- package/components/app/providers/ViewProvider.d.ts +2 -2
- package/components/app/providers/ViewProvider.js +22 -12
- package/components/app/providers/ViewProvider.test.js +2 -2
- package/components/app/providers/contextUtils.d.ts +1 -0
- package/components/app/providers/contextUtils.js +3 -0
- package/components/elements/Comment.d.ts +1 -1
- package/components/elements/Comment.js +11 -9
- package/components/elements/ContextMenu.js +1 -1
- package/components/elements/ContextMenu.test.js +2 -2
- package/components/elements/EditRow.d.ts +9 -4
- package/components/elements/EditRow.js +5 -4
- package/components/elements/MarkdownEditor.js +1 -1
- package/components/elements/MembershipManagement.test.js +178 -0
- package/components/elements/ObjectDetails.js +6 -6
- package/components/elements/ThemedEditor.js +17 -17
- package/components/elements/UserList.d.ts +2 -0
- package/components/elements/UserList.js +26 -18
- package/components/elements/UserList.test.js +24 -1
- package/components/elements/addons/buttons/CustomButton.d.ts +1 -1
- package/components/elements/addons/buttons/CustomButton.js +2 -2
- package/components/elements/addons/buttons/CustomIconButton.d.ts +1 -1
- package/components/elements/addons/buttons/CustomIconButton.js +3 -3
- package/components/elements/addons/buttons/index.d.ts +1 -1
- package/components/elements/addons/layout/FlexOne.d.ts +2 -2
- package/components/elements/addons/layout/FlexOne.test.js +1 -0
- package/components/elements/addons/layout/FlexPort.d.ts +1 -1
- package/components/elements/addons/layout/FlexPort.js +9 -2
- package/components/elements/addons/layout/FlexVertical.d.ts +2 -2
- package/components/elements/addons/layout/FlexVertical.js +1 -1
- package/components/elements/addons/layout/vsbox/VSBox.d.ts +2 -2
- package/components/elements/addons/layout/vsbox/VSBox.js +5 -4
- package/components/elements/addons/layout/vsbox/VSBoxElement.d.ts +1 -1
- package/components/elements/addons/layout/vsbox/VSBoxHeader.js +4 -3
- package/components/elements/addons/lists/TuiList.d.ts +2 -2
- package/components/elements/addons/lists/TuiList.js +1 -1
- package/components/elements/addons/lists/TuiListBase.d.ts +2 -2
- package/components/elements/addons/lists/TuiListBase.js +4 -4
- package/components/elements/addons/lists/TuiListElement.d.ts +2 -2
- package/components/elements/addons/lists/TuiListElement.js +2 -2
- package/components/elements/addons/lists/TuiListMenu.d.ts +13 -37
- package/components/elements/addons/lists/TuiListMenu.js +8 -8
- package/components/elements/addons/lists/TuiListProvider.d.ts +2 -2
- package/components/elements/addons/lists/TuiListProvider.js +4 -4
- package/components/elements/addons/lists/hooks/useTuiListKeyboard.js +1 -1
- package/components/elements/addons/lists/table/TuiTable.d.ts +1 -1
- package/components/elements/addons/lists/table/TuiTable.js +1 -1
- package/components/elements/addons/lists/table/TuiTableBody.d.ts +1 -1
- package/components/elements/addons/lists/table/TuiTableBody.js +1 -1
- package/components/elements/addons/lists/table/TuiTableHead.d.ts +1 -1
- package/components/elements/addons/lists/table/TuiTableHead.js +1 -1
- package/components/elements/addons/lists/table/TuiTableHeader.d.ts +1 -1
- package/components/elements/addons/lists/table/TuiTableLayout.js +1 -1
- package/components/elements/addons/search/SearchPagination.d.ts +1 -1
- package/components/elements/addons/search/SearchPagination.test.js +1 -1
- package/components/elements/addons/search/SearchTotal.d.ts +1 -1
- package/components/elements/addons/search/phrase/Phrase.d.ts +2 -2
- package/components/elements/addons/search/phrase/Phrase.js +7 -7
- package/components/elements/addons/search/phrase/PhraseConsumer.d.ts +2 -2
- package/components/elements/addons/search/phrase/PhraseLexer.d.ts +1 -1
- package/components/elements/addons/search/phrase/PhraseLexer.js +6 -6
- package/components/elements/addons/search/phrase/WordLexer.test.js +1 -0
- package/components/elements/addons/search/phrase/index.d.ts +2 -2
- package/components/elements/addons/search/phrase/index.js +3 -2
- package/components/elements/addons/search/phrase/word/consumers/WhitespaceConsumer.d.ts +1 -1
- package/components/elements/addons/search/phrase/word/consumers/WhitespaceConsumer.js +1 -1
- package/components/elements/addons/search/phrase/word/consumers/WordConsumer.d.ts +1 -1
- package/components/elements/case/CaseCard.js +10 -4
- package/components/elements/case/CasePreview.js +1 -1
- package/components/elements/display/ActionButton.js +3 -1
- package/components/elements/display/ChipPopper.js +1 -1
- package/components/elements/display/ChipPopper.test.js +1 -0
- package/components/elements/display/Classification.js +6 -5
- package/components/elements/display/ClassificationChip.d.ts +2 -4
- package/components/elements/display/ClassificationChip.js +5 -3
- package/components/elements/display/DocumentationButton.js +1 -1
- package/components/elements/display/DocumentationButton.test.js +1 -1
- package/components/elements/display/HandlebarsMarkdown.js +2 -2
- package/components/elements/display/HowlerAvatar.d.ts +1 -0
- package/components/elements/display/HowlerAvatar.js +5 -4
- package/components/elements/display/HowlerAvatarHeader.js +2 -2
- package/components/elements/display/Image.test.js +1 -0
- package/components/elements/display/ItemManager.d.ts +6 -6
- package/components/elements/display/ItemManager.js +1 -1
- package/components/elements/display/Markdown.js +9 -3
- package/components/elements/display/Modal.js +3 -3
- package/components/elements/display/QueryResultText.js +1 -1
- package/components/elements/display/TextDivider.test.js +1 -0
- package/components/elements/display/TypingIndicator.d.ts +1 -1
- package/components/elements/display/UserPageWrapper.js +2 -2
- package/components/elements/display/handlebars/helpers.js +1 -1
- package/components/elements/display/json/JSONViewer.js +2 -2
- package/components/elements/display/markdownPlugins/tabs.js +4 -0
- package/components/elements/display/modals/CreateActionModal.js +1 -1
- package/components/elements/display/modals/RationaleModal.js +1 -2
- package/components/elements/display/modals/RationaleModal.test.js +9 -5
- package/components/elements/event/EventPreview.js +1 -1
- package/components/elements/hit/HitActions.js +5 -7
- package/components/elements/hit/HitBanner.js +4 -16
- package/components/elements/hit/HitBanner.test.js +11 -20
- package/components/elements/hit/HitLabels.js +23 -13
- package/components/elements/hit/HitLinks.js +4 -4
- package/components/elements/hit/HitNotebooks.js +28 -10
- package/components/elements/hit/HitOutline.js +9 -15
- package/components/elements/hit/HitOutline.test.js +5 -5
- package/components/elements/hit/HitOverview.js +3 -3
- package/components/elements/hit/HitPreview.d.ts +1 -1
- package/components/elements/hit/HitPreview.js +6 -7
- package/components/elements/hit/HitSummary.js +8 -8
- package/components/elements/hit/PivotTooltip.js +1 -1
- package/components/elements/hit/actions/ButtonActions.js +2 -2
- package/components/elements/hit/actions/DropdownActions.js +4 -4
- package/components/elements/hit/aggregate/HitGraph.js +28 -11
- package/components/elements/hit/elements/AnalyticLink.js +2 -2
- package/components/elements/hit/elements/AnalyticLink.test.js +1 -1
- package/components/elements/hit/elements/Assigned.js +1 -1
- package/components/elements/hit/elements/Assigned.test.js +1 -1
- package/components/elements/hit/elements/EscalationChip.js +2 -2
- package/components/elements/hit/elements/HitTimestamp.js +2 -2
- package/components/elements/hit/grid/AddColumnModal.js +2 -2
- package/components/elements/hit/grid/ColumnHeader.js +1 -1
- package/components/elements/hit/grid/RecordRow.js +1 -1
- package/components/elements/hit/grid/RecordTable.d.ts +4 -3
- package/components/elements/hit/grid/RecordTable.js +6 -6
- package/components/elements/hit/related/PivotLink.js +2 -2
- package/components/elements/hit/related/RelatedIcon.js +2 -2
- package/components/elements/hit/related/RelatedLink.js +1 -1
- package/components/elements/hit/related/RelatedRecords.js +1 -1
- package/components/elements/membership/Members.d.ts +6 -0
- package/components/elements/membership/Members.js +14 -0
- package/components/elements/membership/MembershipManagement.d.ts +9 -0
- package/components/elements/membership/MembershipManagement.js +119 -0
- package/components/elements/membership/types.d.ts +7 -0
- package/components/elements/membership/utils.d.ts +2 -0
- package/components/elements/membership/utils.js +6 -0
- package/components/elements/record/RecordComments.js +16 -10
- package/components/elements/record/RecordContextMenu.d.ts +2 -2
- package/components/elements/record/RecordContextMenu.js +11 -5
- package/components/elements/record/RecordContextMenu.test.js +14 -6
- package/components/elements/record/RecordRelated.js +2 -2
- package/components/elements/search/FuzzySearchBar.js +1 -1
- package/components/elements/view/LayoutToggle.d.ts +1 -1
- package/components/elements/view/ViewTitle.js +3 -4
- package/components/hooks/useHitActions.d.ts +1 -1
- package/components/hooks/useHitActions.js +25 -15
- package/components/hooks/useLocalStorage.d.ts +1 -1
- package/components/hooks/useLocalStorage.js +1 -1
- package/components/hooks/useLocalStorageItem.d.ts +11 -1
- package/components/hooks/useLocalStorageItem.js +7 -5
- package/components/hooks/useLocalStorageItem.test.js +23 -0
- package/components/hooks/useMyAccessibility.d.ts +7 -0
- package/components/hooks/useMyAccessibility.js +21 -0
- package/components/hooks/useMyApi.d.ts +1 -1
- package/components/hooks/useMyApi.js +4 -4
- package/components/hooks/useMyChart.d.ts +46 -48
- package/components/hooks/useMyChart.js +30 -9
- package/components/hooks/useMyCookies.d.ts +3 -0
- package/components/hooks/useMyCookies.js +8 -0
- package/components/hooks/useMyLocalStorage.d.ts +8 -2
- package/components/hooks/useMyLocalStorage.js +1 -1
- package/components/hooks/useMyPreferences.d.ts +1 -1
- package/components/hooks/useMyPreferences.js +93 -127
- package/components/hooks/useMyRouter.d.ts +2 -0
- package/components/hooks/useMyRouter.js +24 -0
- package/components/hooks/useMySearch.d.ts +1 -1
- package/components/hooks/useMySearch.js +17 -7
- package/components/hooks/useMySnackbar.js +1 -1
- package/components/hooks/useMyTheme.d.ts +1 -1
- package/components/hooks/useMyTheme.js +13 -8
- package/components/hooks/useMyTheme.test.js +11 -6
- package/components/hooks/useMyUser.d.ts +1 -1
- package/components/hooks/useMyUser.js +6 -5
- package/components/hooks/useMyUserFunctions.d.ts +2 -2
- package/components/hooks/useMyUserFunctions.js +14 -10
- package/components/hooks/useMyUserList.d.ts +1 -1
- package/components/hooks/useMyUtils.js +1 -1
- package/components/hooks/useParamState.js +5 -3
- package/components/hooks/useParamState.test.js +1 -1
- package/components/hooks/useRecordSelection.d.ts +4 -3
- package/components/hooks/useRecordSelection.js +5 -5
- package/components/hooks/useScrollRestoration.js +3 -3
- package/components/logins/Login.d.ts +1 -1
- package/components/logins/Login.js +4 -6
- package/components/logins/auth/OAuthLogin.js +1 -1
- package/components/logins/auth/UserPassLogin.d.ts +1 -1
- package/components/logins/hooks/useLogin.js +10 -6
- package/components/routes/403.js +1 -1
- package/components/routes/403.test.js +7 -3
- package/components/routes/404.js +1 -1
- package/components/routes/404.test.js +7 -3
- package/components/routes/ErrorBoundary.d.ts +2 -2
- package/components/routes/ErrorBoundary.js +2 -2
- package/components/routes/ErrorBoundary.test.js +1 -4
- package/components/routes/ErrorOccured.js +1 -1
- package/components/routes/ErrorOccured.test.js +7 -3
- package/components/routes/Logout.js +3 -4
- package/components/routes/Logout.test.js +12 -11
- package/components/routes/action/edit/ActionEditor.js +38 -30
- package/components/routes/action/shared/ActionReportDisplay.js +1 -1
- package/components/routes/action/shared/OperationEntry.js +2 -2
- package/components/routes/action/shared/OperationStep.js +12 -10
- package/components/routes/action/useMyActionFunctions.d.ts +3 -3
- package/components/routes/action/useMyActionFunctions.js +13 -13
- package/components/routes/action/view/ActionDetails.d.ts +1 -1
- package/components/routes/action/view/ActionDetails.js +46 -26
- package/components/routes/action/view/ActionSearch.js +11 -10
- package/components/routes/action/view/Integrations.js +2 -2
- package/components/routes/action/view/markdown/integrations.en.md.js +1 -1
- package/components/routes/action/view/markdown/integrations.fr.md.js +1 -1
- package/components/routes/admin/users/UserEditor.js +21 -8
- package/components/routes/admin/users/UserSearch.js +10 -9
- package/components/routes/advanced/QueryBuilder.js +17 -11
- package/components/routes/advanced/luceneCompletionProvider.js +42 -21
- package/components/routes/analytics/AnalyticComments.js +19 -14
- package/components/routes/analytics/AnalyticDetails.d.ts +1 -1
- package/components/routes/analytics/AnalyticDetails.js +20 -16
- package/components/routes/analytics/AnalyticHitComments.js +13 -6
- package/components/routes/analytics/AnalyticHitComments.test.js +5 -4
- package/components/routes/analytics/AnalyticNotebooks.js +5 -5
- package/components/routes/analytics/AnalyticOverview.js +28 -15
- package/components/routes/analytics/AnalyticOverviews.js +2 -2
- package/components/routes/analytics/AnalyticSearch.js +11 -10
- package/components/routes/analytics/AnalyticTemplates.js +3 -3
- package/components/routes/analytics/TriageSettings.d.ts +1 -1
- package/components/routes/analytics/TriageSettings.js +1 -1
- package/components/routes/analytics/widgets/Assessment.js +1 -1
- package/components/routes/analytics/widgets/Created.js +9 -9
- package/components/routes/analytics/widgets/Escalation.js +3 -3
- package/components/routes/analytics/widgets/Stacked.js +5 -5
- package/components/routes/analytics/widgets/Status.js +2 -2
- package/components/routes/cases/CaseViewer.js +1 -1
- package/components/routes/cases/CaseViewer.test.js +2 -2
- package/components/routes/cases/Cases.d.ts +1 -1
- package/components/routes/cases/Cases.js +8 -7
- package/components/routes/cases/constants.d.ts +3 -3
- package/components/routes/cases/detail/AlertPanel.js +1 -1
- package/components/routes/cases/detail/AlertPanel.test.js +4 -6
- package/components/routes/cases/detail/CaseDashboard.js +8 -4
- package/components/routes/cases/detail/CaseDashboard.test.js +2 -2
- package/components/routes/cases/detail/CaseDetails.js +7 -2
- package/components/routes/cases/detail/CaseDetails.test.js +1 -1
- package/components/routes/cases/detail/CaseObservables.js +5 -4
- package/components/routes/cases/detail/CaseObservables.test.js +1 -1
- package/components/routes/cases/detail/CaseOverview.js +2 -2
- package/components/routes/cases/detail/CaseRules.js +10 -6
- package/components/routes/cases/detail/CaseRules.test.js +2 -2
- package/components/routes/cases/detail/CaseSearch.js +5 -5
- package/components/routes/cases/detail/CaseSearch.test.js +2 -2
- package/components/routes/cases/detail/CaseSidebar.js +12 -7
- package/components/routes/cases/detail/CaseSidebar.test.js +5 -6
- package/components/routes/cases/detail/CaseTask.js +27 -15
- package/components/routes/cases/detail/CaseTask.test.js +8 -1
- package/components/routes/cases/detail/CaseTimeline.js +8 -8
- package/components/routes/cases/detail/CaseTimeline.test.js +6 -6
- package/components/routes/cases/detail/CreateRuleDialog.js +4 -4
- package/components/routes/cases/detail/CreateRuleDialog.test.js +2 -2
- package/components/routes/cases/detail/ItemPage.js +3 -3
- package/components/routes/cases/detail/MarkdownPage.test.js +0 -4
- package/components/routes/cases/detail/RelatedCasePanel.js +1 -1
- package/components/routes/cases/detail/RelatedCasePanel.test.js +4 -6
- package/components/routes/cases/detail/TaskPanel.js +8 -8
- package/components/routes/cases/detail/TaskPanel.test.js +3 -3
- package/components/routes/cases/detail/aggregates/CaseAggregate.js +1 -1
- package/components/routes/cases/detail/aggregates/SourceAggregate.js +3 -3
- package/components/routes/cases/detail/observables/Observable.js +4 -5
- package/components/routes/cases/detail/observables/Observable.test.js +1 -1
- package/components/routes/cases/detail/observables/ObservableTable.js +3 -3
- package/components/routes/cases/detail/observables/ObservableTable.test.js +1 -1
- package/components/routes/cases/detail/sidebar/CaseFolder.js +24 -20
- package/components/routes/cases/detail/sidebar/CaseFolder.test.js +1 -1
- package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.js +4 -2
- package/components/routes/cases/detail/sidebar/CaseFolderContextMenu.test.js +3 -2
- package/components/routes/cases/detail/sidebar/FolderEntry.js +3 -3
- package/components/routes/cases/detail/sidebar/FolderEntry.test.js +3 -3
- package/components/routes/cases/detail/sidebar/types.d.ts +1 -1
- package/components/routes/cases/detail/sidebar/utils.js +1 -1
- package/components/routes/cases/detail/sidebar/utils.test.js +8 -8
- package/components/routes/cases/detail/utils.d.ts +1 -1
- package/components/routes/cases/detail/utils.js +3 -2
- package/components/routes/cases/hooks/useCase.js +14 -2
- package/components/routes/cases/modals/AddRecordToCaseModal.test.js +1 -1
- package/components/routes/cases/modals/AddToCaseModal.d.ts +1 -1
- package/components/routes/cases/modals/AddToCaseModal.js +2 -2
- package/components/routes/cases/modals/CreateCaseModal.test.js +1 -1
- package/components/routes/cases/modals/ResolveModal.js +8 -5
- package/components/routes/cases/modals/ResolveModal.test.js +5 -5
- package/components/routes/cases/modals/hooks.js +1 -2
- package/components/routes/cases/modals/types.d.ts +1 -1
- package/components/routes/cases/search/CaseAssigneeFilter.js +1 -1
- package/components/routes/cases/search/CaseAssigneeFilter.test.js +8 -3
- package/components/routes/cases/search/CaseStatusFilter.test.js +1 -0
- package/components/routes/cases/utils.d.ts +0 -1
- package/components/routes/cases/utils.js +4 -13
- package/components/routes/dossiers/DossierCard.js +3 -3
- package/components/routes/dossiers/DossierCard.test.js +6 -6
- package/components/routes/dossiers/DossierEditor.js +61 -25
- package/components/routes/dossiers/DossierEditor.test.js +16 -9
- package/components/routes/dossiers/Dossiers.d.ts +1 -1
- package/components/routes/dossiers/Dossiers.js +6 -5
- package/components/routes/dossiers/LeadEditor.d.ts +1 -1
- package/components/routes/dossiers/LeadEditor.js +2 -2
- package/components/routes/dossiers/LeadForm.js +2 -2
- package/components/routes/dossiers/PivotForm.d.ts +1 -1
- package/components/routes/dossiers/PivotForm.js +10 -9
- package/components/routes/events/EventViewer.js +1 -1
- package/components/routes/help/ActionDocumentation.js +2 -2
- package/components/routes/help/ActionIntroductionDocumentation.js +2 -2
- package/components/routes/help/ApiDocumentation.js +3 -4
- package/components/routes/help/AuthDocumentation.js +1 -1
- package/components/routes/help/ClientDocumentation.js +1 -1
- package/components/routes/help/Help.d.ts +1 -1
- package/components/routes/help/Help.js +5 -4
- package/components/routes/help/HitDocumentation.js +3 -3
- package/components/routes/help/HitLabelsDocumentation.js +12 -12
- package/components/routes/help/HitLinksDocumentation.js +2 -2
- package/components/routes/help/HitSchemaDocumentation.js +14 -8
- package/components/routes/help/NotebookDocumentation.js +1 -1
- package/components/routes/help/OverviewDocumentation.js +1 -1
- package/components/routes/help/RetentionDocumentation.js +3 -3
- package/components/routes/help/SearchDocumentation.js +6 -4
- package/components/routes/help/TemplateDocumentation.js +2 -2
- package/components/routes/help/ViewDocumentation.js +1 -1
- package/components/routes/help/markdown/en/views.md.js +1 -1
- package/components/routes/help/markdown/fr/views.md.js +1 -1
- package/components/routes/hits/search/InformationPane.js +8 -8
- package/components/routes/hits/search/QuerySettings.js +1 -1
- package/components/routes/hits/search/QuerySettings.test.js +8 -4
- package/components/routes/hits/search/RecordBrowser.js +12 -9
- package/components/routes/hits/search/RecordQuery.js +13 -10
- package/components/routes/hits/search/SearchPane.js +2 -3
- package/components/routes/hits/search/ViewLink.js +4 -4
- package/components/routes/hits/search/ViewLink.test.js +1 -0
- package/components/routes/hits/search/grid/RecordGrid.js +1 -1
- package/components/routes/hits/search/shared/CustomSort.js +3 -2
- package/components/routes/hits/search/shared/CustomSpan.js +9 -1
- package/components/routes/hits/search/shared/HitFilter.js +8 -3
- package/components/routes/hits/search/shared/HitSort.js +8 -6
- package/components/routes/hits/search/shared/IndexPicker.js +1 -1
- package/components/routes/hits/search/shared/LayoutSettings.js +1 -1
- package/components/routes/hits/search/shared/SearchActionMenu.d.ts +1 -1
- package/components/routes/hits/search/shared/SearchActionMenu.js +1 -1
- package/components/routes/hits/search/shared/SearchSpan.js +1 -1
- package/components/routes/hits/view/HitViewer.js +21 -11
- package/components/routes/hits/view/HitViewer.test.js +2 -2
- package/components/routes/home/AddNewCard.d.ts +2 -1
- package/components/routes/home/AddNewCard.js +7 -4
- package/components/routes/home/AnalyticCard.js +3 -3
- package/components/routes/home/EntryWrapper.js +1 -1
- package/components/routes/home/ViewCard.js +11 -7
- package/components/routes/home/ViewCard.test.js +3 -6
- package/components/routes/home/index.js +20 -17
- package/components/routes/overviews/OverviewCard.js +6 -2
- package/components/routes/overviews/OverviewViewer.d.ts +1 -1
- package/components/routes/overviews/OverviewViewer.js +48 -39
- package/components/routes/overviews/Overviews.d.ts +1 -1
- package/components/routes/overviews/Overviews.js +7 -6
- package/components/routes/overviews/markdownExtendedTokenProvider.test.js +1 -0
- package/components/routes/overviews/startingTemplate.js +1 -1
- package/components/routes/settings/ProfileSection.d.ts +1 -1
- package/components/routes/settings/ProfileSection.js +2 -2
- package/components/routes/settings/SecuritySection.d.ts +1 -1
- package/components/routes/settings/SecuritySection.js +2 -2
- package/components/routes/settings/Settings.js +6 -6
- package/components/routes/templates/TemplateCard.js +1 -1
- package/components/routes/templates/TemplateEditor.d.ts +1 -1
- package/components/routes/templates/TemplateEditor.js +3 -3
- package/components/routes/templates/TemplateViewer.d.ts +1 -1
- package/components/routes/templates/TemplateViewer.js +54 -52
- package/components/routes/templates/Templates.d.ts +1 -1
- package/components/routes/templates/Templates.js +10 -9
- package/components/routes/views/ViewComposer.js +38 -30
- package/components/routes/views/Views.d.ts +2 -1
- package/components/routes/views/Views.js +20 -14
- package/i18n.js +4 -0
- package/locales/en/translation.json +10 -0
- package/locales/fr/translation.json +10 -0
- package/models/entities/HowlerUser.d.ts +1 -1
- package/models/entities/generated/Action.d.ts +3 -1
- package/models/entities/generated/ApiType.d.ts +2 -3
- package/models/entities/generated/Dossier.d.ts +2 -0
- package/models/entities/generated/HowlerDossier.d.ts +2 -0
- package/models/entities/generated/Item.d.ts +2 -2
- package/models/entities/generated/Settings.d.ts +1 -1
- package/models/entities/generated/View.d.ts +2 -0
- package/package.json +102 -118
- package/plugins/HowlerPlugin.d.ts +9 -50
- package/plugins/HowlerPlugin.js +7 -113
- package/plugins/clue/Provider.js +2 -2
- package/plugins/clue/components/ClueLeadForm.js +2 -2
- package/plugins/clue/components/CluePivot.js +6 -7
- package/plugins/clue/components/CluePivotForm.js +26 -15
- package/plugins/clue/components/ClueTypography.js +2 -2
- package/plugins/clue/helpers.js +5 -5
- package/plugins/clue/index.d.ts +2 -2
- package/plugins/clue/index.js +1 -1
- package/plugins/clue/setup.js +1 -1
- package/plugins/clue/utils.d.ts +1 -1
- package/plugins/store.d.ts +26 -43
- package/plugins/store.js +2 -15
- package/rest/AxiosClient.js +3 -3
- package/rest/FetchClient.d.ts +1 -1
- package/rest/FetchClient.js +8 -5
- package/rest/FetchClient.test.js +7 -4
- package/rest/index.d.ts +4 -3
- package/setupTests.d.ts +3 -0
- package/tests/MockLocalStorage.js +2 -1
- package/tests/mocks.d.ts +2 -2
- package/tests/mocks.js +3 -3
- package/tests/server-handlers.js +1 -1
- package/utils/Throttler.js +1 -1
- package/utils/actionUtils.d.ts +1 -1
- package/utils/actionUtils.js +10 -6
- package/utils/classificationParser.js +56 -63
- package/utils/constants.d.ts +0 -17
- package/utils/constants.js +1 -18
- package/utils/exampleHit.d.ts +2 -0
- package/utils/exampleHit.js +18 -0
- package/utils/localStorage.d.ts +2 -2
- package/utils/localStorage.js +1 -1
- package/utils/menuUtils.d.ts +3 -89
- package/utils/menuUtils.js +66 -227
- package/utils/menuUtils.test.js +45 -181
- package/utils/sessionStorage.js +1 -1
- package/utils/sessionStorage.test.js +1 -0
- package/utils/stringUtils.d.ts +1 -1
- package/utils/utils.d.ts +30 -6
- package/utils/utils.js +66 -9
- package/utils/utils.test.js +1 -0
- package/utils/xsrf.d.ts +1 -1
- package/utils/xsrf.js +5 -10
- package/api/dossier/hit.d.ts +0 -2
- package/api/dossier/hit.js +0 -7
- package/api/dossier/index.d.ts +0 -9
- package/commons/components/app/AppConfigs.d.ts +0 -137
- package/commons/components/app/AppConstants.d.ts +0 -10
- package/commons/components/app/AppConstants.js +0 -10
- package/commons/components/app/AppContexts.d.ts +0 -105
- package/commons/components/app/AppContexts.js +0 -21
- package/commons/components/app/AppDefaults.d.ts +0 -6
- package/commons/components/app/AppDefaults.js +0 -40
- package/commons/components/app/AppNotificationService.d.ts +0 -6
- package/commons/components/app/AppNotificationService.js +0 -1
- package/commons/components/app/AppProvider.d.ts +0 -15
- package/commons/components/app/AppProvider.js +0 -41
- package/commons/components/app/AppSearchService.d.ts +0 -21
- package/commons/components/app/AppSearchService.js +0 -1
- package/commons/components/app/AppSkeleton.d.ts +0 -5
- package/commons/components/app/AppSkeleton.js +0 -152
- package/commons/components/app/AppUserService.d.ts +0 -17
- package/commons/components/app/AppUserService.js +0 -1
- package/commons/components/app/hooks/index.d.ts +0 -18
- package/commons/components/app/hooks/index.js +0 -18
- package/commons/components/app/hooks/useApp.d.ts +0 -1
- package/commons/components/app/hooks/useApp.js +0 -5
- package/commons/components/app/hooks/useAppBanner.d.ts +0 -1
- package/commons/components/app/hooks/useAppBanner.js +0 -6
- package/commons/components/app/hooks/useAppBar.d.ts +0 -1
- package/commons/components/app/hooks/useAppBar.js +0 -5
- package/commons/components/app/hooks/useAppBarHeight.d.ts +0 -2
- package/commons/components/app/hooks/useAppBarHeight.js +0 -22
- package/commons/components/app/hooks/useAppBarScrollTrigger.d.ts +0 -1
- package/commons/components/app/hooks/useAppBarScrollTrigger.js +0 -7
- package/commons/components/app/hooks/useAppBreadcrumbs.d.ts +0 -1
- package/commons/components/app/hooks/useAppBreadcrumbs.js +0 -5
- package/commons/components/app/hooks/useAppConfigs.d.ts +0 -59
- package/commons/components/app/hooks/useAppConfigs.js +0 -44
- package/commons/components/app/hooks/useAppLanguage.d.ts +0 -6
- package/commons/components/app/hooks/useAppLanguage.js +0 -17
- package/commons/components/app/hooks/useAppLayout.d.ts +0 -1
- package/commons/components/app/hooks/useAppLayout.js +0 -5
- package/commons/components/app/hooks/useAppLeftNav.d.ts +0 -1
- package/commons/components/app/hooks/useAppLeftNav.js +0 -5
- package/commons/components/app/hooks/useAppLogo.d.ts +0 -1
- package/commons/components/app/hooks/useAppLogo.js +0 -8
- package/commons/components/app/hooks/useAppNotification.d.ts +0 -1
- package/commons/components/app/hooks/useAppNotification.js +0 -5
- package/commons/components/app/hooks/useAppQuickSearch.d.ts +0 -1
- package/commons/components/app/hooks/useAppQuickSearch.js +0 -5
- package/commons/components/app/hooks/useAppSearchService.d.ts +0 -2
- package/commons/components/app/hooks/useAppSearchService.js +0 -5
- package/commons/components/app/hooks/useAppSitemap.d.ts +0 -16
- package/commons/components/app/hooks/useAppSitemap.js +0 -70
- package/commons/components/app/hooks/useAppSwitcher.d.ts +0 -1
- package/commons/components/app/hooks/useAppSwitcher.js +0 -5
- package/commons/components/app/hooks/useAppTheme.d.ts +0 -8
- package/commons/components/app/hooks/useAppTheme.js +0 -12
- package/commons/components/app/hooks/useAppUser.d.ts +0 -2
- package/commons/components/app/hooks/useAppUser.js +0 -5
- package/commons/components/app/providers/AppBarProvider.d.ts +0 -10
- package/commons/components/app/providers/AppBarProvider.js +0 -24
- package/commons/components/app/providers/AppBreadcrumbsProvider.d.ts +0 -6
- package/commons/components/app/providers/AppBreadcrumbsProvider.js +0 -43
- package/commons/components/app/providers/AppLayoutProvider.d.ts +0 -6
- package/commons/components/app/providers/AppLayoutProvider.js +0 -73
- package/commons/components/app/providers/AppLeftNavProvider.d.ts +0 -6
- package/commons/components/app/providers/AppLeftNavProvider.js +0 -22
- package/commons/components/app/providers/AppNotificationProvider.d.ts +0 -6
- package/commons/components/app/providers/AppNotificationProvider.js +0 -31
- package/commons/components/app/providers/AppQuickSearchProvider.d.ts +0 -8
- package/commons/components/app/providers/AppQuickSearchProvider.js +0 -19
- package/commons/components/app/providers/AppSearchServiceProvider.d.ts +0 -6
- package/commons/components/app/providers/AppSearchServiceProvider.js +0 -46
- package/commons/components/app/providers/AppSnackbarProvider.d.ts +0 -3
- package/commons/components/app/providers/AppSnackbarProvider.js +0 -15
- package/commons/components/app/providers/AppSwitcherProvider.d.ts +0 -6
- package/commons/components/app/providers/AppSwitcherProvider.js +0 -10
- package/commons/components/app/providers/AppUserProvider.d.ts +0 -8
- package/commons/components/app/providers/AppUserProvider.js +0 -12
- package/commons/components/breadcrumbs/BreadcrumbIcon.d.ts +0 -6
- package/commons/components/breadcrumbs/BreadcrumbIcon.js +0 -9
- package/commons/components/breadcrumbs/BreadcrumbLastItem.d.ts +0 -7
- package/commons/components/breadcrumbs/BreadcrumbLastItem.js +0 -19
- package/commons/components/breadcrumbs/BreadcrumbLinkItem.d.ts +0 -7
- package/commons/components/breadcrumbs/BreadcrumbLinkItem.js +0 -20
- package/commons/components/breadcrumbs/BreadcrumbList.d.ts +0 -11
- package/commons/components/breadcrumbs/BreadcrumbList.js +0 -44
- package/commons/components/breadcrumbs/Breadcrumbs.d.ts +0 -5
- package/commons/components/breadcrumbs/Breadcrumbs.js +0 -31
- package/commons/components/display/AppAvatar.d.ts +0 -8
- package/commons/components/display/AppAvatar.js +0 -18
- package/commons/components/display/AppInfoPanel.d.ts +0 -5
- package/commons/components/display/AppInfoPanel.js +0 -17
- package/commons/components/display/AppListEmpty.d.ts +0 -2
- package/commons/components/display/AppListEmpty.js +0 -5
- package/commons/components/display/AppToc.d.ts +0 -20
- package/commons/components/display/AppToc.js +0 -98
- package/commons/components/display/hooks/useAppColor.d.ts +0 -5
- package/commons/components/display/hooks/useAppColor.js +0 -10
- package/commons/components/leftnav/LeftNavDrawer.d.ts +0 -3
- package/commons/components/leftnav/LeftNavDrawer.js +0 -99
- package/commons/components/leftnav/LeftNavGroup.d.ts +0 -8
- package/commons/components/leftnav/LeftNavGroup.js +0 -55
- package/commons/components/leftnav/LeftNavItem.d.ts +0 -11
- package/commons/components/leftnav/LeftNavItem.js +0 -29
- package/commons/components/notification/FeedModels.d.ts +0 -64
- package/commons/components/notification/FeedModels.js +0 -94
- package/commons/components/notification/Notification.d.ts +0 -10
- package/commons/components/notification/Notification.js +0 -95
- package/commons/components/notification/elements/NotificationCloseButton.d.ts +0 -3
- package/commons/components/notification/elements/NotificationCloseButton.js +0 -6
- package/commons/components/notification/elements/NotificationContainer.d.ts +0 -16
- package/commons/components/notification/elements/NotificationContainer.js +0 -29
- package/commons/components/notification/elements/NotificationEndOfPage.d.ts +0 -5
- package/commons/components/notification/elements/NotificationEndOfPage.js +0 -36
- package/commons/components/notification/elements/NotificationError.d.ts +0 -2
- package/commons/components/notification/elements/NotificationError.js +0 -10
- package/commons/components/notification/elements/NotificationHeader.d.ts +0 -8
- package/commons/components/notification/elements/NotificationHeader.js +0 -18
- package/commons/components/notification/elements/NotificationItems.d.ts +0 -12
- package/commons/components/notification/elements/NotificationItems.js +0 -12
- package/commons/components/notification/elements/NotificationSkeleton.d.ts +0 -2
- package/commons/components/notification/elements/NotificationSkeleton.js +0 -12
- package/commons/components/notification/elements/NotificationTopNavButton.d.ts +0 -9
- package/commons/components/notification/elements/NotificationTopNavButton.js +0 -9
- package/commons/components/notification/elements/item/NotificationItem.d.ts +0 -5
- package/commons/components/notification/elements/item/NotificationItem.js +0 -25
- package/commons/components/notification/elements/item/NotificationItemAuthor.d.ts +0 -5
- package/commons/components/notification/elements/item/NotificationItemAuthor.js +0 -31
- package/commons/components/notification/elements/item/NotificationItemContent.d.ts +0 -3
- package/commons/components/notification/elements/item/NotificationItemContent.js +0 -9
- package/commons/components/notification/elements/item/NotificationItemDate.d.ts +0 -3
- package/commons/components/notification/elements/item/NotificationItemDate.js +0 -10
- package/commons/components/notification/elements/item/NotificationItemImage.d.ts +0 -4
- package/commons/components/notification/elements/item/NotificationItemImage.js +0 -8
- package/commons/components/notification/elements/item/NotificationItemTag.d.ts +0 -4
- package/commons/components/notification/elements/item/NotificationItemTag.js +0 -12
- package/commons/components/notification/elements/item/NotificationItemTitle.d.ts +0 -3
- package/commons/components/notification/elements/item/NotificationItemTitle.js +0 -15
- package/commons/components/notification/index.d.ts +0 -2
- package/commons/components/notification/index.js +0 -2
- package/commons/components/pages/PageCardCentered.d.ts +0 -5
- package/commons/components/pages/PageCardCentered.js +0 -30
- package/commons/components/pages/PageCenter.d.ts +0 -9
- package/commons/components/pages/PageCenter.js +0 -20
- package/commons/components/pages/PageContent.d.ts +0 -8
- package/commons/components/pages/PageContent.js +0 -8
- package/commons/components/pages/PageFullScreen.d.ts +0 -11
- package/commons/components/pages/PageFullScreen.js +0 -40
- package/commons/components/pages/PageFullWidth.d.ts +0 -11
- package/commons/components/pages/PageFullWidth.js +0 -7
- package/commons/components/pages/PageHeader.d.ts +0 -23
- package/commons/components/pages/PageHeader.js +0 -27
- package/commons/components/pages/hooks/usePageProps.d.ts +0 -24
- package/commons/components/pages/hooks/usePageProps.js +0 -19
- package/commons/components/search/AppSearch.d.ts +0 -1
- package/commons/components/search/AppSearch.js +0 -135
- package/commons/components/search/AppSearchInput.d.ts +0 -12
- package/commons/components/search/AppSearchInput.js +0 -35
- package/commons/components/search/AppSearchResult.d.ts +0 -5
- package/commons/components/search/AppSearchResult.js +0 -28
- package/commons/components/topnav/AppBar.d.ts +0 -6
- package/commons/components/topnav/AppBar.js +0 -80
- package/commons/components/topnav/AppName.d.ts +0 -5
- package/commons/components/topnav/AppName.js +0 -31
- package/commons/components/topnav/AppSwitcher.d.ts +0 -3
- package/commons/components/topnav/AppSwitcher.js +0 -44
- package/commons/components/topnav/Notifications.d.ts +0 -2
- package/commons/components/topnav/Notifications.js +0 -8
- package/commons/components/topnav/ThemeSelection.d.ts +0 -3
- package/commons/components/topnav/ThemeSelection.js +0 -33
- package/commons/components/topnav/ThemeSelectionIcon.d.ts +0 -2
- package/commons/components/topnav/ThemeSelectionIcon.js +0 -16
- package/commons/components/topnav/UserProfile.d.ts +0 -6
- package/commons/components/topnav/UserProfile.js +0 -71
- package/commons/components/utils/hooks/useClipboard.d.ts +0 -3
- package/commons/components/utils/hooks/useClipboard.js +0 -29
- package/commons/components/utils/hooks/useEnv.d.ts +0 -1
- package/commons/components/utils/hooks/useEnv.js +0 -11
- package/commons/components/utils/hooks/useFullscreenStatus.d.ts +0 -2
- package/commons/components/utils/hooks/useFullscreenStatus.js +0 -41
- package/commons/components/utils/hooks/useGravatar.d.ts +0 -2
- package/commons/components/utils/hooks/useGravatar.js +0 -9
- package/commons/components/utils/hooks/useLocalStorage.d.ts +0 -12
- package/commons/components/utils/hooks/useLocalStorage.js +0 -52
- package/commons/components/utils/hooks/useLocalStorageItem.d.ts +0 -14
- package/commons/components/utils/hooks/useLocalStorageItem.js +0 -39
- package/commons/components/utils/hooks/useThemeBuilder.d.ts +0 -7
- package/commons/components/utils/hooks/useThemeBuilder.js +0 -48
- package/commons/components/utils/keyboard.d.ts +0 -30
- package/commons/components/utils/keyboard.js +0 -50
- package/components/hooks/useMySitemap.d.ts +0 -3
- package/components/hooks/useMySitemap.js +0 -219
- /package/{commons/components/app/AppConfigs.js → components/elements/MembershipManagement.test.d.ts} +0 -0
|
@@ -1,43 +1,51 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Add } from '@mui/icons-material';
|
|
3
|
-
import { Autocomplete, AvatarGroup, Box, IconButton, Popover, Stack, TextField, Typography } from '@mui/material';
|
|
3
|
+
import { Autocomplete, AvatarGroup, Box, Divider, IconButton, Popover, Stack, TextField, Typography } from '@mui/material';
|
|
4
4
|
import { UserListContext } from '@cccsaurora/howler-ui/components/app/providers/UserListProvider';
|
|
5
5
|
import { uniq } from 'lodash-es';
|
|
6
6
|
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import Throttler from '@cccsaurora/howler-ui/utils/Throttler';
|
|
8
9
|
import HowlerAvatar from './display/HowlerAvatar';
|
|
9
|
-
const
|
|
10
|
+
const UserEntry = ({ user }) => {
|
|
11
|
+
return (_jsxs(Box, { sx: {
|
|
12
|
+
display: 'grid',
|
|
13
|
+
gridTemplateColumns: 'auto 1fr',
|
|
14
|
+
gridTemplateRows: 'auto auto',
|
|
15
|
+
gridTemplateAreas: `"profile name"\n"profile email"`,
|
|
16
|
+
columnGap: 1.5
|
|
17
|
+
}, children: [_jsx(HowlerAvatar, { sx: { gridArea: 'profile', alignSelf: 'center', height: '32px', width: '32px' }, userId: user?.username }), _jsx(Typography, { sx: { gridArea: 'name' }, variant: "body1", children: user?.name }), _jsx(Typography, { sx: { gridArea: 'email' }, variant: "caption", children: user?.email ?? '' })] }));
|
|
18
|
+
};
|
|
19
|
+
const UserList = ({ buttonSx = {}, userIds, onChange, i18nLabel, avatarHeight = 32, multiple = false, disabled = false, variant = 'compact', except = [] }) => {
|
|
10
20
|
const { t } = useTranslation();
|
|
11
21
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
12
|
-
const { users, fetchUsers } = useContext(UserListContext);
|
|
22
|
+
const { users, fetchUsers, searchUsers } = useContext(UserListContext);
|
|
13
23
|
const allUserIds = useMemo(() => Object.keys(users), [users]);
|
|
14
24
|
useEffect(() => {
|
|
15
25
|
fetchUsers(new Set(userIds));
|
|
16
26
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17
27
|
}, [userIds]);
|
|
18
|
-
const
|
|
28
|
+
const throttler = useMemo(() => new Throttler(300), []);
|
|
29
|
+
const search = (value) => throttler.debounce(() => searchUsers(value));
|
|
30
|
+
const renderInput = (params) => (_jsx(TextField, { ...params, autoComplete: "off", label: t(i18nLabel), size: "small" }));
|
|
19
31
|
const renderOption = (props, optionUserId) => {
|
|
20
32
|
const { key, ...optionProps } = props;
|
|
21
|
-
|
|
22
|
-
return (_jsx("li", { ...optionProps, children: _jsxs(Box, { sx: {
|
|
23
|
-
display: 'grid',
|
|
24
|
-
gridTemplateColumns: 'auto 1fr',
|
|
25
|
-
gridTemplateRows: 'auto auto',
|
|
26
|
-
gridTemplateAreas: `"profile name"\n"profile email"`,
|
|
27
|
-
columnGap: 1.5
|
|
28
|
-
}, children: [_jsx(HowlerAvatar, { sx: { gridArea: 'profile', alignSelf: 'center', height: '32px', width: '32px' }, userId: user?.username }), _jsx(Typography, { sx: { gridArea: 'name' }, variant: "body1", children: user?.name ?? optionUserId }), _jsx(Typography, { sx: { gridArea: 'email' }, variant: "caption", children: user?.email ?? '' })] }) }, key));
|
|
33
|
+
return (_jsx("li", { ...optionProps, children: _jsx(UserEntry, { user: users[optionUserId] }) }, key));
|
|
29
34
|
};
|
|
30
35
|
const sharedAutocompleteProps = {
|
|
31
36
|
disabled,
|
|
32
37
|
sx: { minWidth: '300px' },
|
|
33
38
|
options: allUserIds,
|
|
34
39
|
renderInput,
|
|
35
|
-
renderOption
|
|
40
|
+
renderOption,
|
|
41
|
+
onInputChange: (_e, value) => search(value),
|
|
42
|
+
getOptionDisabled: (optionUserId) => userIds.includes(optionUserId) || except.includes(optionUserId)
|
|
36
43
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
const autocomplete = multiple ? (_jsx(Autocomplete, { ...sharedAutocompleteProps, multiple: true, value: userIds, onChange: (__, options) => {
|
|
45
|
+
onChange(options);
|
|
46
|
+
} })) : (_jsx(Autocomplete, { ...sharedAutocompleteProps, value: userIds?.[0] ?? null, onChange: (__, option) => {
|
|
47
|
+
onChange(option ? [option] : []);
|
|
48
|
+
} }));
|
|
49
|
+
return (_jsxs(_Fragment, { children: [variant === 'compact' ? (multiple ? (_jsxs(Stack, { direction: "row", spacing: 0.25, alignItems: "center", children: [_jsx(AvatarGroup, { children: uniq(userIds ?? [null]).map(userId => (_jsx(HowlerAvatar, { userId: userId, sx: { height: avatarHeight, width: avatarHeight } }, userId))) }), _jsx(IconButton, { size: "small", sx: buttonSx, disabled: disabled, onClick: e => setAnchorEl(e.currentTarget), children: _jsx(Add, {}) })] })) : (_jsx(IconButton, { sx: buttonSx, disabled: disabled, onClick: e => setAnchorEl(e.currentTarget), children: _jsx(HowlerAvatar, { userId: userIds[0], sx: { height: avatarHeight, width: avatarHeight } }) }))) : multiple ? (_jsxs(Stack, { width: "100%", spacing: 1, alignItems: "stretch", divider: _jsx(Divider, { flexItem: true }), children: [uniq(userIds ?? [null]).map(userId => (_jsx(UserEntry, { user: users[userId] }, userId))), autocomplete] })) : (_jsxs(Stack, { direction: "row", children: [_jsx(HowlerAvatar, { userId: userIds[0], sx: { height: avatarHeight, width: avatarHeight } }), _jsx(Typography, { children: userIds[0] })] })), variant === 'compact' && (_jsx(Popover, { open: !!anchorEl, onClose: () => setAnchorEl(null), anchorEl: anchorEl, anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, children: _jsx(Box, { sx: { p: 2 }, children: autocomplete }) }))] }));
|
|
42
50
|
};
|
|
43
51
|
export default UserList;
|
|
@@ -84,9 +84,32 @@ describe('UserList', () => {
|
|
|
84
84
|
await user.click(within(listbox).getByText('Bob Analyst'));
|
|
85
85
|
expect(onChange).toHaveBeenCalledWith(expect.arrayContaining(['analystA', 'analystB']));
|
|
86
86
|
});
|
|
87
|
+
it('renders an inline picker and selects a user in list variant multiple mode', async () => {
|
|
88
|
+
const user = userEvent.setup();
|
|
89
|
+
const onChange = vi.fn();
|
|
90
|
+
render(_jsx(UserList, { i18nLabel: "user.list.label", userIds: ['analystA'], onChange: onChange, multiple: true, variant: "list" }), {
|
|
91
|
+
wrapper: createWrapper(defaultUsers)
|
|
92
|
+
});
|
|
93
|
+
expect(screen.getByText('Alice Analyst')).toBeInTheDocument();
|
|
94
|
+
const combo = screen.getByRole('combobox', { name: 'user.list.label' });
|
|
95
|
+
await user.click(combo);
|
|
96
|
+
const listbox = await screen.findByRole('listbox');
|
|
97
|
+
await user.click(within(listbox).getByText('Bob Analyst'));
|
|
98
|
+
expect(onChange).toHaveBeenCalledWith(expect.arrayContaining(['analystA', 'analystB']));
|
|
99
|
+
});
|
|
100
|
+
it('renders the selected user without a picker in list variant single mode', () => {
|
|
101
|
+
const onChange = vi.fn();
|
|
102
|
+
render(_jsx(UserList, { i18nLabel: "user.list.label", userIds: ['analystA'], onChange: onChange, variant: "list" }), {
|
|
103
|
+
wrapper: createWrapper(defaultUsers)
|
|
104
|
+
});
|
|
105
|
+
expect(screen.getByText('analystA', { selector: 'p' })).toBeInTheDocument();
|
|
106
|
+
expect(document.querySelector('#avatar-analystA')).toBeInTheDocument();
|
|
107
|
+
expect(screen.queryByRole('combobox')).not.toBeInTheDocument();
|
|
108
|
+
expect(screen.queryByRole('button')).not.toBeInTheDocument();
|
|
109
|
+
});
|
|
87
110
|
it('does not open popover when disabled', async () => {
|
|
88
111
|
const onChange = vi.fn();
|
|
89
|
-
render(_jsx(UserList, { i18nLabel: "user.list.label", userIds: ['analystA'], onChange: onChange, disabled: true }), {
|
|
112
|
+
render(_jsx(UserList, { i18nLabel: "user.list.label", userIds: ['analystA'], onChange: onChange, disabled: true, multiple: true }), {
|
|
90
113
|
wrapper: createWrapper(defaultUsers)
|
|
91
114
|
});
|
|
92
115
|
const button = screen.getByRole('button');
|
|
@@ -8,5 +8,5 @@ export type TuiButtonProps = Omit<ButtonProps, 'color'> & {
|
|
|
8
8
|
progress?: boolean;
|
|
9
9
|
tooltip?: string | ReactNode;
|
|
10
10
|
};
|
|
11
|
-
declare const CustomButton: ({ solid, color, route, href, progress, tooltip, variant, ...props }: TuiButtonProps) => import("react
|
|
11
|
+
declare const CustomButton: ({ solid, color, route, href, progress, tooltip, variant, ...props }: TuiButtonProps) => import("react").JSX.Element;
|
|
12
12
|
export default CustomButton;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { alpha, Button, CircularProgress, darken, emphasize, Link as MuiLink, Tooltip, useTheme } from '@mui/material';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { Link } from 'react-router
|
|
4
|
+
import { Link } from 'react-router';
|
|
5
5
|
import { isMuiButtonColor } from '.';
|
|
6
6
|
const CustomButton = ({ solid, color, route, href, progress, tooltip, variant, ...props }) => {
|
|
7
7
|
const theme = useTheme();
|
|
@@ -25,7 +25,7 @@ const CustomButton = ({ solid, color, route, href, progress, tooltip, variant, .
|
|
|
25
25
|
};
|
|
26
26
|
}, [_solid, requestedColor, variant, props.sx, isMuiColor, theme]);
|
|
27
27
|
const progressColor = useMemo(() => {
|
|
28
|
-
const _color = isMuiColor ? theme.palette[requestedColor].main : requestedColor;
|
|
28
|
+
const _color = isMuiColor && requestedColor !== 'inherit' ? theme.palette[requestedColor].main : requestedColor;
|
|
29
29
|
return _solid ? emphasize(_color, 0.5) : _color;
|
|
30
30
|
}, [_solid, requestedColor, isMuiColor, theme]);
|
|
31
31
|
let ColorButton = (_jsx(Button, { ...props, variant: variant, color: isMuiColor ? color : 'inherit', sx: sx, startIcon: progress ? (_jsx(CircularProgress, { size: props.size === 'large' ? 22 : props.size === 'small' ? 18 : 20, sx: { color: progressColor } })) : (props.startIcon) }));
|
|
@@ -11,5 +11,5 @@ export type CustomIconButtonProps = Omit<IconButtonProps, 'color'> & {
|
|
|
11
11
|
target?: HTMLAttributeAnchorTarget;
|
|
12
12
|
clickableWithProgress?: boolean;
|
|
13
13
|
};
|
|
14
|
-
declare const CustomIconButton: ({ progress, transparent, solid, color, route, href, target, tooltip, disabled, children, clickableWithProgress, ...props }: CustomIconButtonProps) => import("react
|
|
14
|
+
declare const CustomIconButton: ({ progress, transparent, solid, color, route, href, target, tooltip, disabled, children, clickableWithProgress, ...props }: CustomIconButtonProps) => import("react").JSX.Element;
|
|
15
15
|
export default CustomIconButton;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { alpha, CircularProgress, darken, emphasize, IconButton, lighten, Link as MuiLink, Tooltip, useTheme } from '@mui/material';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { Link } from 'react-router
|
|
4
|
+
import { Link } from 'react-router';
|
|
5
5
|
import { isMuiButtonColor } from '.';
|
|
6
6
|
const CustomIconButton = ({ progress, transparent, solid, color, route, href, target, tooltip, disabled, children, clickableWithProgress = false, ...props }) => {
|
|
7
7
|
const theme = useTheme();
|
|
@@ -26,13 +26,13 @@ const CustomIconButton = ({ progress, transparent, solid, color, route, href, ta
|
|
|
26
26
|
};
|
|
27
27
|
}, [requestedColor, solid, transparent, props.sx, isMuiColor, theme]);
|
|
28
28
|
const progressColor = useMemo(() => {
|
|
29
|
-
const _color = isMuiColor ? theme.palette[requestedColor].main : requestedColor;
|
|
29
|
+
const _color = isMuiColor && requestedColor !== 'inherit' ? theme.palette[requestedColor].main : requestedColor;
|
|
30
30
|
return solid ? emphasize(_color, 0.5) : _color;
|
|
31
31
|
}, [solid, requestedColor, isMuiColor, theme]);
|
|
32
32
|
let _IconButton = (_jsx(IconButton, { ...props, disabled: (!clickableWithProgress && !!progress) || disabled, color: isMuiColor ? color : 'inherit', sx: sx, children: progress ? (_jsxs("div", { style: { position: 'relative', display: 'inline-flex', alignItems: 'center', justifyContent: 'center' }, children: [children, _jsx(CircularProgress, { disableShrink: true, size: props.size === 'large' ? 52 : props.size === 'small' ? 28 : 40, style: {
|
|
33
33
|
position: 'absolute',
|
|
34
34
|
color: progressColor,
|
|
35
|
-
animationDuration: typeof progress === 'number' ? `${progress}s` :
|
|
35
|
+
animationDuration: typeof progress === 'number' ? `${progress}s` : undefined
|
|
36
36
|
} })] })) : (children) }));
|
|
37
37
|
if (tooltip) {
|
|
38
38
|
_IconButton = (_jsx(Tooltip, { title: tooltip, children: _jsx("span", { children: _IconButton }) }));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const MuiButtonColors: readonly ['inherit', 'primary', 'secondary', 'success', 'error', 'info', 'warning'];
|
|
2
2
|
export type MuiButtonColorType = (typeof MuiButtonColors)[number];
|
|
3
|
-
export declare const isMuiButtonColor: (color: string) =>
|
|
3
|
+
export declare const isMuiButtonColor: (color: string) => color is MuiButtonColorType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const FlexOne: ({ children }: {
|
|
2
|
-
children?:
|
|
3
|
-
}) => import("react
|
|
2
|
+
children?: null | undefined;
|
|
3
|
+
}) => import("react").JSX.Element;
|
|
4
4
|
declare const _default: import("react").MemoExoticComponent<typeof FlexOne>;
|
|
5
5
|
export default _default;
|
|
@@ -8,6 +8,6 @@ type FlexPortProps = {
|
|
|
8
8
|
id?: string;
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
};
|
|
11
|
-
declare const FlexPort: ({ children, disableOverflow, id, ...props }: FlexPortProps) => import("react
|
|
11
|
+
declare const FlexPort: ({ children, disableOverflow, id, ...props }: FlexPortProps) => import("react").JSX.Element;
|
|
12
12
|
declare const _default: import("react").MemoExoticComponent<typeof FlexPort>;
|
|
13
13
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import usePageProps from '@
|
|
2
|
+
import { usePageProps } from '@tui/core';
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
const FlexPort = ({ children, disableOverflow = false, id = '', ...props }) => {
|
|
5
5
|
const pageProps = usePageProps({ props, defaultOverrides: { height: '100%', mb: 0, ml: 0, mr: 0, mt: 0 } });
|
|
@@ -10,6 +10,13 @@ const FlexPort = ({ children, disableOverflow = false, id = '', ...props }) => {
|
|
|
10
10
|
marginLeft: pageProps.style.marginLeft,
|
|
11
11
|
marginRight: pageProps.style.marginRight,
|
|
12
12
|
marginTop: pageProps.style.marginTop
|
|
13
|
-
}, children: _jsx("div", { style: {
|
|
13
|
+
}, children: _jsx("div", { style: {
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
top: 0,
|
|
16
|
+
right: 0,
|
|
17
|
+
bottom: 0,
|
|
18
|
+
left: 0,
|
|
19
|
+
overflow: disableOverflow ? undefined : 'auto'
|
|
20
|
+
}, id: id, children: children }) }));
|
|
14
21
|
};
|
|
15
22
|
export default memo(FlexPort);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { PageProps } from '@
|
|
1
|
+
import type { PageProps } from '@tui/core';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
type FlexVerticalProps = PageProps & {
|
|
4
4
|
flex?: number;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
declare const FlexVertical: ({ flex, children, ...props }: FlexVerticalProps) => import("react
|
|
7
|
+
declare const FlexVertical: ({ flex, children, ...props }: FlexVerticalProps) => import("react").JSX.Element;
|
|
8
8
|
declare const _default: import("react").MemoExoticComponent<typeof FlexVertical>;
|
|
9
9
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import usePageProps from '@
|
|
2
|
+
import { usePageProps } from '@tui/core';
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
const FlexVertical = ({ flex = 1, children, ...props }) => {
|
|
5
5
|
const pageProps = usePageProps({ props, defaultOverrides: { mb: 0, ml: 0, mr: 0, mt: 0 } });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type StackProps } from '@mui/material';
|
|
2
|
-
type VSBoxProps = StackProps & {
|
|
2
|
+
type VSBoxProps = Omit<StackProps, 'top'> & {
|
|
3
3
|
top?: number;
|
|
4
4
|
};
|
|
5
5
|
type VSBoxState = {
|
|
@@ -12,5 +12,5 @@ export declare const VSBoxContext: import("react").Context<{
|
|
|
12
12
|
state: VSBoxState;
|
|
13
13
|
setState?: (state: VSBoxState) => void;
|
|
14
14
|
}>;
|
|
15
|
-
declare const VSBox: ({ top, children, ...stackProps }: VSBoxProps) => import("react
|
|
15
|
+
declare const VSBox: ({ top, children, ...stackProps }: VSBoxProps) => import("react").JSX.Element;
|
|
16
16
|
export default VSBox;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Stack } from '@mui/material';
|
|
3
|
-
import { useAppBar, useAppBarHeight } from '@
|
|
3
|
+
import { useAppBar, useAppBarHeight } from '@tui/core';
|
|
4
4
|
import { createContext, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import { notNil } from '@cccsaurora/howler-ui/utils/utils';
|
|
5
6
|
export const VSBoxContext = createContext({
|
|
6
7
|
state: { top: 0, scrollTop: 0 }
|
|
7
8
|
});
|
|
8
9
|
const VSBox = ({ top, children, ...stackProps }) => {
|
|
9
|
-
const ref = useRef();
|
|
10
|
+
const ref = useRef(null);
|
|
10
11
|
const appbarHeight = useAppBarHeight();
|
|
11
12
|
const { autoHide } = useAppBar();
|
|
12
|
-
const [state, setState] = useState({ top, scrollTop: top });
|
|
13
|
+
const [state, setState] = useState({ top: top ?? 0, scrollTop: top ?? 0 });
|
|
13
14
|
useLayoutEffect(() => {
|
|
14
15
|
// const tableHeader = content?.querySelector(':first-child[data-tuitable]') as HTMLDivElement;
|
|
15
16
|
const header = ref.current?.querySelector('[data-vsbox-header]');
|
|
16
17
|
const content = ref.current?.querySelector('[data-vsbox-content]');
|
|
17
18
|
// Explicit top or appbar height.
|
|
18
|
-
const _top = top
|
|
19
|
+
const _top = notNil(top) ? top : autoHide ? 0 : appbarHeight;
|
|
19
20
|
// We compute scroll top value on demand in order to ensure the
|
|
20
21
|
// header element is fully rendered.
|
|
21
22
|
const _scrollTop = _top + (header?.offsetHeight || 0);
|
|
@@ -4,6 +4,6 @@ type VSBoxElementProps = Omit<BoxProps, 'children'> & {
|
|
|
4
4
|
focus: boolean;
|
|
5
5
|
children: ReactElement;
|
|
6
6
|
};
|
|
7
|
-
declare const VSBoxElement: ({ focus, children }: VSBoxElementProps) => import("react
|
|
7
|
+
declare const VSBoxElement: ({ focus, children }: VSBoxElementProps) => import("react").JSX.Element;
|
|
8
8
|
declare const _default: import("react").MemoExoticComponent<typeof VSBoxElement>;
|
|
9
9
|
export default _default;
|
|
@@ -2,15 +2,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, useTheme } from '@mui/material';
|
|
3
3
|
import { useContext, useEffect, useRef } from 'react';
|
|
4
4
|
import { useResizeDetector } from 'react-resize-detector';
|
|
5
|
+
import { notNil } from '@cccsaurora/howler-ui/utils/utils';
|
|
5
6
|
import { VSBoxContext } from './VSBox';
|
|
6
7
|
const VSBoxHeader = ({ children, ...boxProps }) => {
|
|
7
8
|
const theme = useTheme();
|
|
8
|
-
const heightRef = useRef();
|
|
9
|
+
const heightRef = useRef(undefined);
|
|
9
10
|
const { height, ref } = useResizeDetector({ handleWidth: false });
|
|
10
11
|
const { state, setState } = useContext(VSBoxContext);
|
|
11
12
|
useEffect(() => {
|
|
12
|
-
if (height !== heightRef.current) {
|
|
13
|
-
setState({ ...state, scrollTop: state.top + height });
|
|
13
|
+
if (notNil(height) && height !== heightRef.current) {
|
|
14
|
+
setState?.({ ...state, scrollTop: state.top + height });
|
|
14
15
|
heightRef.current = height;
|
|
15
16
|
}
|
|
16
17
|
}, [height, state, setState]);
|
|
@@ -4,6 +4,6 @@ type TuiListProps<T> = {
|
|
|
4
4
|
children: TuiListItemRenderer<T>;
|
|
5
5
|
onSelection?: TuiListItemOnSelect<T>;
|
|
6
6
|
};
|
|
7
|
-
declare const TuiList: <T>({ keyboard, children, onSelection }: TuiListProps<T>) => import("react
|
|
8
|
-
declare const _default:
|
|
7
|
+
declare const TuiList: <T>({ keyboard, children, onSelection }: TuiListProps<T>) => import("react").JSX.Element;
|
|
8
|
+
declare const _default: typeof TuiList;
|
|
9
9
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import AppListEmpty from '@
|
|
2
|
+
import { AppListEmpty } from '@tui/core';
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import TuiListBase from './TuiListBase';
|
|
5
5
|
import TuiListElement from './TuiListElement';
|
|
@@ -6,6 +6,6 @@ type TuiListBaseProps<T> = {
|
|
|
6
6
|
onSelect: TuiListItemOnSelect<T>;
|
|
7
7
|
children: TuiListItemsRenderer<T>;
|
|
8
8
|
};
|
|
9
|
-
declare const TuiListBase: <T>({ keyboard, onSelect, children }: TuiListBaseProps<T>) => import("react
|
|
10
|
-
declare const _default:
|
|
9
|
+
declare const TuiListBase: <T>({ keyboard, onSelect, children }: TuiListBaseProps<T>) => import("react").JSX.Element;
|
|
10
|
+
declare const _default: typeof TuiListBase;
|
|
11
11
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { emphasize, styled } from '@mui/material';
|
|
3
|
-
import { useAppBar, useAppBarHeight, useAppLayout } from '@
|
|
3
|
+
import { useAppBar, useAppBarHeight, useAppLayout } from '@tui/core';
|
|
4
4
|
import useTuiListKeyboard from '@cccsaurora/howler-ui/components/elements/addons/lists/hooks/useTuiListKeyboard';
|
|
5
5
|
import { memo, useCallback, useContext, useEffect, useLayoutEffect, useRef } from 'react';
|
|
6
6
|
import { TuiListItemsContext, TuiListMethodContext } from './TuiListProvider';
|
|
@@ -37,7 +37,7 @@ const TuiListBaseRoot = styled('div')(({ theme }) => ({
|
|
|
37
37
|
}
|
|
38
38
|
}));
|
|
39
39
|
const TuiListBase = ({ keyboard = false, onSelect, children }) => {
|
|
40
|
-
const listEl = useRef();
|
|
40
|
+
const listEl = useRef(null);
|
|
41
41
|
const appbar = useAppBar();
|
|
42
42
|
const appbarHeight = useAppBarHeight();
|
|
43
43
|
const layout = useAppLayout();
|
|
@@ -45,7 +45,7 @@ const TuiListBase = ({ keyboard = false, onSelect, children }) => {
|
|
|
45
45
|
const { select } = useContext(TuiListMethodContext);
|
|
46
46
|
const onItemSelect = useCallback((selection, index) => {
|
|
47
47
|
const newItem = select(selection, index);
|
|
48
|
-
if (onSelect) {
|
|
48
|
+
if (newItem && onSelect) {
|
|
49
49
|
onSelect(newItem, index);
|
|
50
50
|
}
|
|
51
51
|
}, [select, onSelect]);
|
|
@@ -57,7 +57,7 @@ const TuiListBase = ({ keyboard = false, onSelect, children }) => {
|
|
|
57
57
|
}, [keyboard, register]);
|
|
58
58
|
useLayoutEffect(() => {
|
|
59
59
|
if (keyboard) {
|
|
60
|
-
listEl.current
|
|
60
|
+
listEl.current?.focus({ preventScroll: true });
|
|
61
61
|
}
|
|
62
62
|
}, [keyboard]);
|
|
63
63
|
return (_jsx(TuiListBaseRoot, { ref: listEl, tabIndex: -1, "data-tuiappbar-height": appbarHeight, "data-tuilayout": layout.current, "data-tuiappbar-autohide": appbar.autoHide, children: children(items, onItemSelect) }));
|
|
@@ -5,6 +5,6 @@ type TuiListElementProps<T> = {
|
|
|
5
5
|
onSelect?: TuiListItemOnSelect<T>;
|
|
6
6
|
children: TuiListItemRenderer<T>;
|
|
7
7
|
};
|
|
8
|
-
declare const TuiListElement: <T>({ position, item, onSelect: onClick, children }: TuiListElementProps<T>) => import("react
|
|
9
|
-
declare const _default:
|
|
8
|
+
declare const TuiListElement: <T>({ position, item, onSelect: onClick, children }: TuiListElementProps<T>) => import("react").JSX.Element;
|
|
9
|
+
declare const _default: typeof TuiListElement;
|
|
10
10
|
export default _default;
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo, useCallback, useRef } from 'react';
|
|
3
3
|
import VSBoxElement from '../layout/vsbox/VSBoxElement';
|
|
4
4
|
const TuiListElement = ({ position, item, onSelect: onClick, children }) => {
|
|
5
|
-
const elementEl = useRef();
|
|
6
|
-
const onItemClick = useCallback(_event => {
|
|
5
|
+
const elementEl = useRef(null);
|
|
6
|
+
const onItemClick = useCallback((_event) => {
|
|
7
7
|
if (onClick && !item.disabled) {
|
|
8
8
|
onClick(item, position);
|
|
9
9
|
}
|
|
@@ -1,41 +1,17 @@
|
|
|
1
1
|
import type { CSSProperties, ReactElement } from 'react';
|
|
2
|
+
type PlacementBox = {
|
|
3
|
+
top: number | undefined;
|
|
4
|
+
right: number | undefined;
|
|
5
|
+
bottom: number | undefined;
|
|
6
|
+
left: number | undefined;
|
|
7
|
+
};
|
|
2
8
|
declare const PLACEMENTS: {
|
|
3
|
-
right:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
left: {
|
|
10
|
-
top: number;
|
|
11
|
-
right: any;
|
|
12
|
-
bottom: number;
|
|
13
|
-
left: number;
|
|
14
|
-
};
|
|
15
|
-
'top-left': {
|
|
16
|
-
top: number;
|
|
17
|
-
right: any;
|
|
18
|
-
bottom: any;
|
|
19
|
-
left: number;
|
|
20
|
-
};
|
|
21
|
-
'top-right': {
|
|
22
|
-
top: number;
|
|
23
|
-
right: number;
|
|
24
|
-
bottom: any;
|
|
25
|
-
left: any;
|
|
26
|
-
};
|
|
27
|
-
'bottom-left': {
|
|
28
|
-
top: any;
|
|
29
|
-
right: any;
|
|
30
|
-
bottom: number;
|
|
31
|
-
left: number;
|
|
32
|
-
};
|
|
33
|
-
'bottom-right': {
|
|
34
|
-
top: any;
|
|
35
|
-
right: number;
|
|
36
|
-
bottom: number;
|
|
37
|
-
left: any;
|
|
38
|
-
};
|
|
9
|
+
right: PlacementBox;
|
|
10
|
+
left: PlacementBox;
|
|
11
|
+
'top-left': PlacementBox;
|
|
12
|
+
'top-right': PlacementBox;
|
|
13
|
+
'bottom-left': PlacementBox;
|
|
14
|
+
'bottom-right': PlacementBox;
|
|
39
15
|
};
|
|
40
16
|
type TuiListMenuProps = {
|
|
41
17
|
permanent?: boolean;
|
|
@@ -45,6 +21,6 @@ type TuiListMenuProps = {
|
|
|
45
21
|
children: ReactElement | ReactElement[];
|
|
46
22
|
};
|
|
47
23
|
export type TuiListMenuPlacement = keyof typeof PLACEMENTS;
|
|
48
|
-
declare const TuiListMenu: ({ style, className, permanent, placement, children }: TuiListMenuProps) => import("react
|
|
24
|
+
declare const TuiListMenu: ({ style, className, permanent, placement, children }: TuiListMenuProps) => import("react").JSX.Element;
|
|
49
25
|
declare const _default: import("react").MemoExoticComponent<typeof TuiListMenu>;
|
|
50
26
|
export default _default;
|
|
@@ -3,18 +3,18 @@ import { styled } from '@mui/material';
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
const MY_PROPS = ['permanent', 'placement'];
|
|
5
5
|
const PLACEMENTS = {
|
|
6
|
-
right: { top: 0, right: 0, bottom: 0, left:
|
|
7
|
-
left: { top: 0, right:
|
|
8
|
-
'top-left': { top: 0, right:
|
|
9
|
-
'top-right': { top: 0, right: 0, bottom:
|
|
10
|
-
'bottom-left': { top:
|
|
11
|
-
'bottom-right': { top:
|
|
6
|
+
right: { top: 0, right: 0, bottom: 0, left: undefined },
|
|
7
|
+
left: { top: 0, right: undefined, bottom: 0, left: 0 },
|
|
8
|
+
'top-left': { top: 0, right: undefined, bottom: undefined, left: 0 },
|
|
9
|
+
'top-right': { top: 0, right: 0, bottom: undefined, left: undefined },
|
|
10
|
+
'bottom-left': { top: undefined, right: undefined, bottom: 0, left: 0 },
|
|
11
|
+
'bottom-right': { top: undefined, right: 0, bottom: 0, left: undefined }
|
|
12
12
|
};
|
|
13
13
|
const TuiListMenuRoot = styled('div', { shouldForwardProp: prop => !MY_PROPS.includes(prop) })(({ theme, permanent, placement }) => {
|
|
14
14
|
const position = PLACEMENTS[placement];
|
|
15
15
|
return {
|
|
16
16
|
...position,
|
|
17
|
-
zIndex: position ? 100 :
|
|
17
|
+
zIndex: position ? 100 : undefined,
|
|
18
18
|
display: permanent ? 'flex' : 'none',
|
|
19
19
|
position: position ? 'absolute' : 'inherit',
|
|
20
20
|
alignItems: 'center',
|
|
@@ -28,6 +28,6 @@ const TuiListMenuRoot = styled('div', { shouldForwardProp: prop => !MY_PROPS.inc
|
|
|
28
28
|
});
|
|
29
29
|
// TODO: placement property (top-left, top-right, bottom-left, bottom-right)
|
|
30
30
|
const TuiListMenu = ({ style, className, permanent, placement, children }) => {
|
|
31
|
-
return (_jsx(TuiListMenuRoot, { permanent: permanent, placement: placement, style: style, className: `actions ${className || ''}`, onClick: event => event.stopPropagation(), children: children }));
|
|
31
|
+
return (_jsx(TuiListMenuRoot, { permanent: !!permanent, placement: placement ?? 'right', style: style, className: `actions ${className || ''}`, onClick: event => event.stopPropagation(), children: children }));
|
|
32
32
|
};
|
|
33
33
|
export default memo(TuiListMenu);
|
|
@@ -3,7 +3,7 @@ import type { TuiListItem } from '.';
|
|
|
3
3
|
export type TuiListMethodsState<T> = {
|
|
4
4
|
load: (items: TuiListItem<T>[]) => void;
|
|
5
5
|
move: (index: number) => void;
|
|
6
|
-
select: (item: TuiListItem<T>, index: number) => TuiListItem<T
|
|
6
|
+
select: (item: TuiListItem<T>, index: number) => TuiListItem<T> | null;
|
|
7
7
|
replace: (item: TuiListItem<T>, newItem: TuiListItem<T>) => void;
|
|
8
8
|
replaceById: (item: TuiListItem<T>, newItem: TuiListItem<T>) => void;
|
|
9
9
|
remove: (id: string) => void;
|
|
@@ -18,5 +18,5 @@ export declare const TuiListItemsContext: import("react").Context<TuiListItemsSt
|
|
|
18
18
|
type TuiListProviderProps = {
|
|
19
19
|
children: ReactNode;
|
|
20
20
|
};
|
|
21
|
-
declare const TuiListProvider: <T>({ children }: TuiListProviderProps) => import("react
|
|
21
|
+
declare const TuiListProvider: <T>({ children }: TuiListProviderProps) => import("react").JSX.Element;
|
|
22
22
|
export default TuiListProvider;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isNil } from 'lodash-es';
|
|
2
3
|
import { createContext, useCallback, useMemo, useState } from 'react';
|
|
3
4
|
const DEFAULT_METHODS_STATE = {
|
|
4
5
|
load: () => null,
|
|
@@ -9,7 +10,6 @@ const DEFAULT_METHODS_STATE = {
|
|
|
9
10
|
remove: () => null
|
|
10
11
|
};
|
|
11
12
|
const DEFAULT_ITEMS_STATE = {
|
|
12
|
-
size: 0,
|
|
13
13
|
items: [],
|
|
14
14
|
movePrevious: () => null,
|
|
15
15
|
moveNext: () => null
|
|
@@ -25,9 +25,9 @@ const TuiListProvider = ({ children }) => {
|
|
|
25
25
|
if (previous) {
|
|
26
26
|
return {
|
|
27
27
|
...i,
|
|
28
|
-
cursor: i.cursor
|
|
29
|
-
selected: i.selected
|
|
30
|
-
details: i.details
|
|
28
|
+
cursor: isNil(i.cursor) ? previous.cursor : i.cursor,
|
|
29
|
+
selected: isNil(i.selected) ? previous.selected : i.selected,
|
|
30
|
+
details: isNil(i.details) ? previous.details : i.details
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
return i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isArrowDown, isArrowUp, isEnter } from '@
|
|
1
|
+
import { isArrowDown, isArrowUp, isEnter } from '@tui/core';
|
|
2
2
|
import { useCallback, useContext, useMemo } from 'react';
|
|
3
3
|
import Throttler from '@cccsaurora/howler-ui/utils/Throttler';
|
|
4
4
|
import { TuiListItemsContext } from '../TuiListProvider';
|
|
@@ -10,5 +10,5 @@ type TuiTableProps<T> = {
|
|
|
10
10
|
detailRenderer?: TuiTableRowDetailRenderer<T>;
|
|
11
11
|
children?: TuiTableCellRenderer<T>;
|
|
12
12
|
};
|
|
13
|
-
declare const TuiTable: <T>({ keyboard, flexPort, headless, columns, onRowSelect, menuRenderer, detailRenderer, children }: TuiTableProps<T>) => import("react
|
|
13
|
+
declare const TuiTable: <T>({ keyboard, flexPort, headless, columns, onRowSelect, menuRenderer, detailRenderer, children }: TuiTableProps<T>) => import("react").JSX.Element;
|
|
14
14
|
export default TuiTable;
|
|
@@ -69,7 +69,7 @@ const TuiTable = ({ keyboard, flexPort, headless, columns, onRowSelect, menuRend
|
|
|
69
69
|
}, [flexPort, layout, width, columns]);
|
|
70
70
|
useEffect(() => {
|
|
71
71
|
if (flexPort && layout) {
|
|
72
|
-
if (bodyWidth && bodyWidth !== widthRef.current) {
|
|
72
|
+
if (width && bodyWidth && bodyWidth !== widthRef.current) {
|
|
73
73
|
setLayout(new TuiTableLayout(width, bodyWidth, columns));
|
|
74
74
|
}
|
|
75
75
|
widthRef.current = bodyWidth;
|
|
@@ -10,5 +10,5 @@ type TuiTableBodyProps<T> = {
|
|
|
10
10
|
detailRenderer?: TuiTableRowDetailRenderer<T>;
|
|
11
11
|
children?: TuiTableCellRenderer<T>;
|
|
12
12
|
};
|
|
13
|
-
declare const TuiTableBody: <T>({ keyboard, layout, columns, onRowSelect, menuRenderer, detailRenderer, children }: TuiTableBodyProps<T>) => import("react
|
|
13
|
+
declare const TuiTableBody: <T>({ keyboard, layout, columns, onRowSelect, menuRenderer, detailRenderer, children }: TuiTableBodyProps<T>) => import("react").JSX.Element;
|
|
14
14
|
export default TuiTableBody;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AppListEmpty } from '@tui/core';
|
|
2
3
|
import { Collapse } from '@mui/material';
|
|
3
|
-
import AppListEmpty from '@cccsaurora/howler-ui/commons/components/display/AppListEmpty';
|
|
4
4
|
import { get } from 'lodash-es';
|
|
5
5
|
import { useCallback } from 'react';
|
|
6
6
|
import { TuiListElement } from '..';
|
|
@@ -4,5 +4,5 @@ type TuiTableHeaderProps = {
|
|
|
4
4
|
layout: TuiTableLayout;
|
|
5
5
|
columns: TuiTableColumn[];
|
|
6
6
|
};
|
|
7
|
-
declare const TuiTableHead: ({ layout, columns }: TuiTableHeaderProps) => import("react
|
|
7
|
+
declare const TuiTableHead: ({ layout, columns }: TuiTableHeaderProps) => import("react").JSX.Element;
|
|
8
8
|
export default TuiTableHead;
|
|
@@ -4,6 +4,6 @@ import { useContext } from 'react';
|
|
|
4
4
|
import TuiTableHeader from './TuiTableHeader';
|
|
5
5
|
const TuiTableHead = ({ layout, columns }) => {
|
|
6
6
|
const { state: { scrollTop } } = useContext(VSBoxContext);
|
|
7
|
-
return (_jsx("div", { "data-tuitable-header": "true", className: "tui-table-head tui-table-divider", style: { position: scrollTop ? 'sticky' :
|
|
7
|
+
return (_jsx("div", { "data-tuitable-header": "true", className: "tui-table-head tui-table-divider", style: { position: scrollTop ? 'sticky' : undefined, top: scrollTop || undefined }, children: columns.map(column => (_jsx(TuiTableHeader, { width: layout.getWidth(column.column, true), column: column }, column.column))) }));
|
|
8
8
|
};
|
|
9
9
|
export default TuiTableHead;
|
|
@@ -2,6 +2,6 @@ import type { TuiTableColumn } from '.';
|
|
|
2
2
|
declare const TuiTableHeader: ({ width, column }: {
|
|
3
3
|
width: number;
|
|
4
4
|
column: TuiTableColumn;
|
|
5
|
-
}) => import("react
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
6
6
|
declare const _default: import("react").MemoExoticComponent<typeof TuiTableHeader>;
|
|
7
7
|
export default _default;
|