@finsemble/finsemble-ui 6.6.0 → 7.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +18 -32
- package/react/assets/css/button.css +1 -1
- package/react/assets/css/favorites.css +0 -47
- package/react/assets/css/finsemble.css +3 -0
- package/react/assets/css/linkerWindow.css +13 -1
- package/react/assets/css/menus.css +2 -2
- package/react/assets/css/notificationsCenter.css +32 -1
- package/react/assets/css/shared/common.css +40 -0
- package/react/assets/css/userPreferences.css +17 -12
- package/react/assets/css/windowTitleBar.css +7 -0
- package/react/assets/icons/server.svg +26 -0
- package/react/components/common/ButtonIcon.js +1 -1
- package/react/components/common/ButtonIcon.js.map +1 -1
- package/react/components/common/ButtonRow.js +2 -2
- package/react/components/common/ButtonRow.js.map +1 -1
- package/react/components/common/Checkbox.js +1 -1
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/ColorPicker.js +16 -15
- package/react/components/common/ColorPicker.js.map +1 -1
- package/react/components/common/ErrorBoundary.d.ts +16 -0
- package/react/components/common/ErrorBoundary.js +22 -0
- package/react/components/common/ErrorBoundary.js.map +1 -0
- package/react/components/common/FinsembleIcon.d.ts +3 -2
- package/react/components/common/FinsembleIcon.js +10 -3
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleLink.d.ts +6 -0
- package/react/components/common/FinsembleLink.js +12 -0
- package/react/components/common/FinsembleLink.js.map +1 -0
- package/react/components/common/FinsembleToggle.d.ts +1 -2
- package/react/components/common/FinsembleToggle.js +2 -6
- package/react/components/common/FinsembleToggle.js.map +1 -1
- package/react/components/common/FinsembleToggleButtonBar.d.ts +13 -0
- package/react/components/common/FinsembleToggleButtonBar.js +44 -0
- package/react/components/common/FinsembleToggleButtonBar.js.map +1 -0
- package/react/components/common/InputTable.d.ts +3 -3
- package/react/components/common/InputTable.js +13 -13
- package/react/components/common/InputTable.js.map +1 -1
- package/react/components/common/Tab.js +33 -5
- package/react/components/common/Tab.js.map +1 -1
- package/react/components/common/css/FinsembleToggle.css +22 -0
- package/react/components/common/css/application-edit-page.css +10 -2
- package/react/components/common/css/tab.css +8 -8
- package/react/components/common/css/time-select.css +1 -1
- package/react/components/common/css/toggle.css +2 -10
- package/react/components/common/helpers.js +6 -1
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/ColorPicker.stories.js +6 -11
- package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleToggle.stories.d.ts +1 -2
- package/react/components/common/stories/FinsembleToggle.stories.js +0 -7
- package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleToggleButtonBar.stories.d.ts +14 -0
- package/react/components/common/stories/FinsembleToggleButtonBar.stories.js +97 -0
- package/react/components/common/stories/FinsembleToggleButtonBar.stories.js.map +1 -0
- package/react/components/common/stories/InputTable.stories.d.ts +4 -3
- package/react/components/common/stories/InputTable.stories.js +18 -8
- package/react/components/common/stories/InputTable.stories.js.map +1 -1
- package/react/components/common/tests/ButtonRow.spec.js +5 -0
- package/react/components/common/tests/ButtonRow.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggle.spec.js +1 -6
- package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggleButtonBar.spec.d.ts +1 -0
- package/react/components/common/tests/FinsembleToggleButtonBar.spec.js +40 -0
- package/react/components/common/tests/FinsembleToggleButtonBar.spec.js.map +1 -0
- package/react/components/common/tests/InputTable.spec.js +3 -3
- package/react/components/common/tests/InputTable.spec.js.map +1 -1
- package/react/components/favorites/FavoriteMaker.js +1 -1
- package/react/components/favorites/FavoriteMaker.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverContainer.js +4 -7
- package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
- package/react/components/icon/Icon.d.ts +1 -1
- package/react/components/icon/Icon.js +8 -1
- package/react/components/icon/Icon.js.map +1 -1
- package/react/components/legacyControls/FinsembleDnDContext.js +7 -7
- package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
- package/react/components/linker/remoteRedux.js +1 -0
- package/react/components/linker/remoteRedux.js.map +1 -1
- package/react/components/menu/MenuItem.js +1 -1
- package/react/components/menu/MenuItem.js.map +1 -1
- package/react/components/menu/MenuPortal.js +12 -21
- package/react/components/menu/MenuPortal.js.map +1 -1
- package/react/components/menu/MenuToggle.js +1 -1
- package/react/components/menu/MenuToggle.js.map +1 -1
- package/react/components/menu/keyboardNavigation.d.ts +1 -22
- package/react/components/menu/keyboardNavigation.js +110 -160
- package/react/components/menu/keyboardNavigation.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerControls.js +39 -25
- package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +19 -6
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/shared/CheckButton.js +19 -8
- package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.js +2 -1
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js +2 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js +2 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
- package/react/components/notifications/components/views/CardView.js +5 -3
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.js +3 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/types.d.ts +3 -0
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitor.js +4 -1
- package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
- package/react/components/processMonitor/components/ProcessStatistics.js +1 -3
- package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
- package/react/components/processMonitor/helpers.js +4 -3
- package/react/components/processMonitor/helpers.js.map +1 -1
- package/react/components/processMonitor/helpers.spec.js +7 -3
- package/react/components/processMonitor/helpers.spec.js.map +1 -1
- package/react/components/sdd/AddApp.d.ts +4 -3
- package/react/components/sdd/AddApp.js +132 -30
- package/react/components/sdd/AddApp.js.map +1 -1
- package/react/components/sdd/AppEditAccess.d.ts +4 -3
- package/react/components/sdd/AppEditAccess.js.map +1 -1
- package/react/components/sdd/AppEditPage.d.ts +4 -3
- package/react/components/sdd/AppEditPage.js +141 -116
- package/react/components/sdd/AppEditPage.js.map +1 -1
- package/react/components/sdd/Appearance.d.ts +2 -1
- package/react/components/sdd/Appearance.js +15 -7
- package/react/components/sdd/Appearance.js.map +1 -1
- package/react/components/sdd/Application.d.ts +5 -4
- package/react/components/sdd/Application.js +61 -42
- package/react/components/sdd/Application.js.map +1 -1
- package/react/components/sdd/Applications.d.ts +12 -11
- package/react/components/sdd/Applications.js +23 -4
- package/react/components/sdd/Applications.js.map +1 -1
- package/react/components/sdd/Authentication.js +1 -6
- package/react/components/sdd/Authentication.js.map +1 -1
- package/react/components/sdd/AuthenticationProviderConfig.js +5 -3
- package/react/components/sdd/AuthenticationProviderConfig.js.map +1 -1
- package/react/components/sdd/EditPreload.d.ts +4 -3
- package/react/components/sdd/EditPreload.js +39 -22
- package/react/components/sdd/EditPreload.js.map +1 -1
- package/react/components/sdd/Export.d.ts +7 -6
- package/react/components/sdd/Export.js +3 -2
- package/react/components/sdd/Export.js.map +1 -1
- package/react/components/sdd/GettingStarted.js +3 -3
- package/react/components/sdd/GettingStarted.js.map +1 -1
- package/react/components/sdd/Navigation.js +28 -4
- package/react/components/sdd/Navigation.js.map +1 -1
- package/react/components/sdd/OptionalSettingsView.d.ts +6 -5
- package/react/components/sdd/OptionalSettingsView.js +2 -10
- package/react/components/sdd/OptionalSettingsView.js.map +1 -1
- package/react/components/sdd/ProjectErrors.js +1 -1
- package/react/components/sdd/ProjectErrors.js.map +1 -1
- package/react/components/sdd/Publish.js +2 -2
- package/react/components/sdd/Publish.js.map +1 -1
- package/react/components/sdd/SmartDesktopDesigner.d.ts +17 -16
- package/react/components/sdd/SmartDesktopDesigner.js +37 -34
- package/react/components/sdd/SmartDesktopDesigner.js.map +1 -1
- package/react/components/sdd/ThemePage.js +8 -5
- package/react/components/sdd/ThemePage.js.map +1 -1
- package/react/components/sdd/Themes.d.ts +2 -1
- package/react/components/sdd/Themes.js +2 -2
- package/react/components/sdd/Themes.js.map +1 -1
- package/react/components/sdd/Toolbar.d.ts +5 -4
- package/react/components/sdd/Toolbar.js +11 -9
- package/react/components/sdd/Toolbar.js.map +1 -1
- package/react/components/sdd/common/setPreloadDefaults.d.ts +1 -1
- package/react/components/sdd/common/setPreloadDefaults.js +5 -4
- package/react/components/sdd/common/setPreloadDefaults.js.map +1 -1
- package/react/components/sdd/common/views.js +7 -4
- package/react/components/sdd/common/views.js.map +1 -1
- package/react/components/sdd/css/addApp.css +52 -0
- package/react/components/sdd/css/applications.css +0 -26
- package/react/components/sdd/css/nav.css +3 -3
- package/react/components/sdd/fixtures/authenticationProps.js +15 -1
- package/react/components/sdd/fixtures/authenticationProps.js.map +1 -1
- package/react/components/sdd/fixtures/preloads.js +14 -12
- package/react/components/sdd/fixtures/preloads.js.map +1 -1
- package/react/components/sdd/smartDesktopClient.d.ts +163 -0
- package/react/components/sdd/smartDesktopClient.js +573 -0
- package/react/components/sdd/smartDesktopClient.js.map +1 -0
- package/react/components/sdd/smartDesktopClient.spec.d.ts +1 -0
- package/react/components/sdd/smartDesktopClient.spec.js +61 -0
- package/react/components/sdd/smartDesktopClient.spec.js.map +1 -0
- package/react/components/sdd/stories/AddApp.stories.d.ts +10 -0
- package/react/components/sdd/stories/AddApp.stories.js +18 -0
- package/react/components/sdd/stories/AddApp.stories.js.map +1 -0
- package/react/components/sdd/stories/AppEditPage.stories.d.ts +2 -0
- package/react/components/sdd/stories/AppEditPage.stories.js +2 -0
- package/react/components/sdd/stories/AppEditPage.stories.js.map +1 -1
- package/react/components/sdd/stories/Appearance.stories.d.ts +1 -1
- package/react/components/sdd/stories/Appearance.stories.js +1 -0
- package/react/components/sdd/stories/Appearance.stories.js.map +1 -1
- package/react/components/sdd/stories/Authentication.stories.js +2 -16
- package/react/components/sdd/stories/Authentication.stories.js.map +1 -1
- package/react/components/sdd/stories/OptionalSettingsView.stories.js +1 -1
- package/react/components/sdd/stories/OptionalSettingsView.stories.js.map +1 -1
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.d.ts +1 -1
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.js +3 -0
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.js.map +1 -1
- package/react/components/sdd/stories/Themes.stories.d.ts +1 -1
- package/react/components/sdd/stories/Themes.stories.js +1 -0
- package/react/components/sdd/stories/Themes.stories.js.map +1 -1
- package/react/components/sdd/tests/AddApp.spec.d.ts +1 -0
- package/react/components/sdd/tests/AddApp.spec.js +96 -0
- package/react/components/sdd/tests/AddApp.spec.js.map +1 -0
- package/react/components/sdd/tests/AppEditPage.spec.js +92 -23
- package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/sdd/tests/Application.spec.js +411 -24
- package/react/components/sdd/tests/Application.spec.js.map +1 -1
- package/react/components/sdd/tests/Applications.spec.js +1 -45
- package/react/components/sdd/tests/Applications.spec.js.map +1 -1
- package/react/components/sdd/tests/Authentication.spec.js +1 -1
- package/react/components/sdd/tests/Authentication.spec.js.map +1 -1
- package/react/components/sdd/tests/EditPreload.spec.js +50 -7
- package/react/components/sdd/tests/EditPreload.spec.js.map +1 -1
- package/react/components/sdd/tests/Navigation.spec.js +2 -2
- package/react/components/sdd/tests/Navigation.spec.js.map +1 -1
- package/react/components/sdd/tests/OptionalSettingsView.spec.js +235 -0
- package/react/components/sdd/tests/OptionalSettingsView.spec.js.map +1 -1
- package/react/components/sdd/tests/ProjectErrors.spec.js +1 -1
- package/react/components/sdd/tests/ProjectErrors.spec.js.map +1 -1
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js +2 -2
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js.map +1 -1
- package/react/components/search/Search.js +1 -1
- package/react/components/search/Search.js.map +1 -1
- package/react/components/shared/DefaultDropdownButton.js +12 -1
- package/react/components/shared/DefaultDropdownButton.js.map +1 -1
- package/react/components/shared/tests/DefaultDropdownButton.spec.js +12 -0
- package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +1 -16
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +0 -4
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
- package/react/components/toolbar/DragHandle.stories.js.map +1 -1
- package/react/components/toolbar/ToolbarIcon.js +2 -2
- package/react/components/toolbar/ToolbarIcon.js.map +1 -1
- package/react/components/toolbar/ToolbarSection.d.ts +1 -9
- package/react/components/toolbar/ToolbarSection.js +3 -7
- package/react/components/toolbar/ToolbarSection.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +21 -12
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/userPreferences/components/ContentSection.js +1 -1
- package/react/components/userPreferences/components/ContentSection.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +4 -3
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
- package/react/components/userPreferences/components/general/ScheduledClose.js +12 -3
- package/react/components/userPreferences/components/general/ScheduledClose.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.js +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +17 -2
- package/react/components/windowTitleBar/WindowTitleBarShell.js +160 -6
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js +7 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/components/windowTitleBar/components/windowTitle.js +10 -2
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js +11 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
- package/react/reducers/rootReducer.d.ts +2 -2
- package/react/store.d.ts +4 -4
- package/react/tsconfig.tsbuildinfo +1 -0
- package/react/types/smartDesktopDesignerTypes.d.ts +3 -0
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartDesktopDesigner.spec.js","sourceRoot":"","sources":["../../../../src/components/sdd/tests/SmartDesktopDesigner.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,wCAAwC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,UAAU,oBAAM,UAAU,CAAC,IAAkC,EAAI,CAAC,CAAC;QAE1F,MAAM,CAAC,MAAM,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH;QACC;YACC,GAAG,EAAE;gBACJ,EAAE,EAAE,uBAAuB;gBAC3B,KAAK,EAAE,aAAa;aACpB;SACD;QACD;YACC,GAAG,EAAE;gBACJ,EAAE,EAAE,gCAAgC;gBACpC,KAAK,EAAE,YAAY;aACnB;SACD;QACD;YACC,GAAG,EAAE;gBACJ,EAAE,EAAE,iBAAiB;gBACrB,KAAK,EAAE,OAAO;aACd;SACD;QACD;YACC,GAAG,EAAE;gBACJ,EAAE,EAAE,yBAAyB;gBAC7B,KAAK,EAAE,gBAAgB;aACvB;SACD;QACD;YACC,GAAG,EAAE;gBACJ,EAAE,EAAE,iBAAiB;gBACrB,KAAK,EAAE,SAAS;aAChB;SACD;KACD,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACpB,EAAE,CAAC,sBAAsB,MAAM,CAAC,GAAG,CAAC,KAAK,uBAAuB,EAAE,KAAK,IAAI,EAAE;YAC5E,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,UAAU,oBAAM,UAAU,CAAC,IAAkC,EAAI,CAAC,CAAC;YAE1F,MAAM,QAAQ,EAAE,CAAC;YACjB,OAAO,CAAC,MAAM,EAAE,CAAC;YAEjB,MAAM,CACL,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"SmartDesktopDesigner.spec.js","sourceRoot":"","sources":["../../../../src/components/sdd/tests/SmartDesktopDesigner.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MA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C;YAEjB,MAAM,CACL,OAAO,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC,MAAM,EAC9E,8BAA8B,CAC9B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAEd,OAAO,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAEpE,MAAM,QAAQ,EAAE,CAAC;YACjB,OAAO,CAAC,MAAM,EAAE,CAAC;YAEjB,MAAM,CACL,OAAO,CAAC,IAAI,CAAC,kCAAkC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,EACtE,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,YAAY,CAC5B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACd,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,kBAAkB,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,QAAQ,CACzG,MAAM,CAAC,GAAG,CAAC,KAAK,CAChB,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { mount } from \"enzyme\";\nimport { describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport { DefaultSDD } from \"../stories/SmartDesktopDesigner.stories\";\nimport { waitTick } from \"../sdd_helpers\";\nimport { SmartDesktopDesignerProps } from \"../SmartDesktopDesigner\";\nimport { accessibilityAssessor } from \"./a11y_helper\";\n\ndescribe(\"<SmartDesktopDesigner/>\", () => {\n\tit(\"should pass accessibility scans (Page)\", async () => {\n\t\tconst wrapper = mount(<DefaultSDD {...(DefaultSDD.args as SmartDesktopDesignerProps)} />);\n\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t});\n\n\t[\n\t\t{\n\t\t\tnav: {\n\t\t\t\tid: \"applications-nav-link\",\n\t\t\t\ttitle: \"Manage apps\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tnav: {\n\t\t\t\tid: \"applications-optional-nav-link\",\n\t\t\t\ttitle: \"Extensions\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tnav: {\n\t\t\t\tid: \"themes-nav-link\",\n\t\t\t\ttitle: \"Theme\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tnav: {\n\t\t\t\tid: \"authentication-nav-link\",\n\t\t\t\ttitle: \"Authentication\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tnav: {\n\t\t\t\tid: \"export-nav-link\",\n\t\t\t\ttitle: \"Publish\",\n\t\t\t},\n\t\t},\n\t].forEach((target) => {\n\t\tit(`should navigate to ${target.nav.title} from left navigation`, async () => {\n\t\t\tconst wrapper = mount(<DefaultSDD {...(DefaultSDD.args as SmartDesktopDesignerProps)} />);\n\n\t\t\tawait waitTick();\n\t\t\twrapper.update();\n\n\t\t\texpect(\n\t\t\t\twrapper.find(\".nav-item[aria-selected=true] #getting-started-nav-link\").length,\n\t\t\t\t\"Currently on Getting Started\"\n\t\t\t).to.equal(1);\n\n\t\t\twrapper.find(`.nav-item #${target.nav.id}`).at(0).simulate(\"click\");\n\n\t\t\tawait waitTick();\n\t\t\twrapper.update();\n\n\t\t\texpect(\n\t\t\t\twrapper.find(`.nav-item[aria-selected=true] #${target.nav.id}`).length,\n\t\t\t\t`${target.nav.id} is active`\n\t\t\t).to.equal(1);\n\t\t\texpect(wrapper.find(\".view-title .leftSide\").at(0).text(), `page title is \"${target.nav.title}\"`).contains(\n\t\t\t\ttarget.nav.title\n\t\t\t);\n\t\t});\n\t});\n});\n"]}
|
|
@@ -19,7 +19,7 @@ const Search = (_a) => {
|
|
|
19
19
|
var { width = 330, className = "search-menu", id = "SearchMenu" } = _a, otherProps = __rest(_a, ["width", "className", "id"]);
|
|
20
20
|
const completeProps = Object.assign(Object.assign({}, otherProps), { width,
|
|
21
21
|
className,
|
|
22
|
-
id, title: (_b = otherProps.title) !== null && _b !== void 0 ? _b : React.createElement("i", { className: "ff-search" }) });
|
|
22
|
+
id, title: (_b = otherProps.title) !== null && _b !== void 0 ? _b : React.createElement("i", { className: "ff-search", "aria-label": "Search" }) });
|
|
23
23
|
return (React.createElement(Menu, Object.assign({}, completeProps),
|
|
24
24
|
React.createElement(SearchInput, null),
|
|
25
25
|
React.createElement(SearchResults, null)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src/components/search/Search.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,6BAA6B,CAAC;AAErC,MAAM,MAAM,GAAuC,CAAC,EAKnD,EAAE,EAAE;;QAL+C,EACnD,KAAK,GAAG,GAAG,EACX,SAAS,GAAG,aAAa,EACzB,EAAE,GAAG,YAAY,OAEjB,EADG,UAAU,cAJsC,4BAKnD,CADa;IAEb,MAAM,aAAa,mCACf,UAAU,KACb,KAAK;QACL,SAAS;QACT,EAAE,EACF,KAAK,EAAE,MAAA,UAAU,CAAC,KAAK,mCAAI,2BAAG,SAAS,EAAC,WAAW,GAAK,
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../src/components/search/Search.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,6BAA6B,CAAC;AAErC,MAAM,MAAM,GAAuC,CAAC,EAKnD,EAAE,EAAE;;QAL+C,EACnD,KAAK,GAAG,GAAG,EACX,SAAS,GAAG,aAAa,EACzB,EAAE,GAAG,YAAY,OAEjB,EADG,UAAU,cAJsC,4BAKnD,CADa;IAEb,MAAM,aAAa,mCACf,UAAU,KACb,KAAK;QACL,SAAS;QACT,EAAE,EACF,KAAK,EAAE,MAAA,UAAU,CAAC,KAAK,mCAAI,2BAAG,SAAS,EAAC,WAAW,gBAAY,QAAQ,GAAK,GAC5E,CAAC;IAEF,OAAO,CACN,oBAAC,IAAI,oBAAK,aAAa;QACtB,oBAAC,WAAW,OAAG;QACf,oBAAC,aAAa,OAAG,CACX,CACP,CAAC;AACH,CAAC,CAAC;AACF,OAAO,EAAE,MAAM,EAAE,CAAC","sourcesContent":["import * as React from \"react\";\nimport { Menu } from \"../menu/Menu\";\nimport { MenuProps } from \"../menu/Menu\";\nimport { SearchResults } from \"./SearchResults\";\nimport { SearchInput } from \"./SearchInput\";\nimport \"../../assets/css/search.css\";\n\nconst Search: React.FunctionComponent<MenuProps> = ({\n\twidth = 330,\n\tclassName = \"search-menu\",\n\tid = \"SearchMenu\",\n\t...otherProps\n}) => {\n\tconst completeProps = {\n\t\t...otherProps,\n\t\twidth,\n\t\tclassName,\n\t\tid,\n\t\ttitle: otherProps.title ?? <i className=\"ff-search\" aria-label=\"Search\"></i>,\n\t};\n\n\treturn (\n\t\t<Menu {...completeProps}>\n\t\t\t<SearchInput />\n\t\t\t<SearchResults />\n\t\t</Menu>\n\t);\n};\nexport { Search };\n"]}
|
|
@@ -65,24 +65,35 @@ const DefaultDropdownButton = ({ allowEmpty = true, caretLocation = "left", clas
|
|
|
65
65
|
}
|
|
66
66
|
else if (e.key === "ArrowDown") {
|
|
67
67
|
setFocusIndex(focusIndex + 1 >= buttonOptions.length ? buttonOptions.length - 1 : focusIndex + 1);
|
|
68
|
+
e.preventDefault();
|
|
68
69
|
}
|
|
69
70
|
else if (e.key === "ArrowUp") {
|
|
70
71
|
setFocusIndex(focusIndex - 1 <= 0 ? 0 : focusIndex - 1);
|
|
72
|
+
e.preventDefault();
|
|
71
73
|
}
|
|
72
74
|
else if (e.key === "Escape") {
|
|
73
75
|
toggleOptionsPanel(false);
|
|
74
76
|
setFocusIndex(0);
|
|
77
|
+
e.preventDefault();
|
|
75
78
|
}
|
|
76
79
|
}
|
|
77
80
|
else {
|
|
78
81
|
if (e.key === "Enter" || e.key === " ") {
|
|
79
82
|
toggleOptionsPanel(!optionsVisible);
|
|
80
83
|
setFocusIndex(0);
|
|
84
|
+
e.preventDefault();
|
|
81
85
|
}
|
|
82
86
|
else if (e.key === "ArrowDown") {
|
|
83
|
-
|
|
87
|
+
if (e.altKey) {
|
|
88
|
+
toggleOptionsPanel(!optionsVisible);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
changeOptionByDirection("down");
|
|
92
|
+
}
|
|
93
|
+
e.preventDefault();
|
|
84
94
|
}
|
|
85
95
|
else if (e.key === "ArrowUp") {
|
|
96
|
+
e.preventDefault();
|
|
86
97
|
changeOptionByDirection("up");
|
|
87
98
|
}
|
|
88
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultDropdownButton.js","sourceRoot":"","sources":["../../../src/components/shared/DefaultDropdownButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAkB9E,MAAM,WAAW,GAAgD;IAChE,WAAW,EAAE,iBAAiB;IAC9B,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;CACtB,CAAC;AAEF,MAAM,qBAAqB,GAAkE,CA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AEN,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;oBAEvC,kBAAkB,CAAC,CAAC,cAAc,CAAC,CAAC;oBACpC,aAAa,CAAC,CAAC,CAAC,CAAC;iBACjB;qBAAM,IAAI,CAAC,CAAC,GAAG,KAAK,WAAW,EAAE;oBAEjC,uBAAuB,CAAC,MAAM,CAAC,CAAC;iBAChC;qBAAM,IAAI,CAAC,CAAC,GAAG,KAAK,SAAS,EAAE;oBAE/B,uBAAuB,CAAC,IAAI,CAAC,CAAC;iBAC9B;aACD;QACF,CAAC;QAEA,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,CAC3B;YACC,2BAAG,SAAS,EAAE,YAAY,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,GAAI;YAC9D,8BAAM,SAAS,EAAC,+BAA+B,IAC7C,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAC9D,CACL,CACH,CAAC,CAAC,CAAC,CACH;YACC,8BAAM,SAAS,EAAC,+BAA+B,IAC7C,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAC9D;YACP,2BAAG,SAAS,EAAE,YAAY,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,GAAI,CAC5D,CACH;QACA,cAAc,CAAC,CAAC,CAAC,CACjB,6BAAK,EAAE,EAAE,oBAAoB,QAAQ,EAAE,EAAE,SAAS,EAAC,iCAAiC,IAClF,OAAO,CACH,CACN,CAAC,CAAC,CAAC,IAAI,CACH,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport \"../../assets/css/button.css\";\nimport { useOutsideClickDetector } from \"../../hooks/useOutsideClickDetector\";\n\nexport interface IFinsembleDefaultDropdownButtonOptionsProps {\n\toptionLabel: string;\n\toptionValue?: any;\n\tclickHandler: Function;\n}\n\nexport interface IFinsembleDefaultDropdownButtonProps {\n\tallowEmpty?: boolean;\n\tbuttonLabel?: string;\n\tcaretLocation?: \"left\" | \"right\";\n\tclassNames?: string;\n\tbuttonOptions: Array<IFinsembleDefaultDropdownButtonOptionsProps>;\n\tdefaultSelection?: IFinsembleDefaultDropdownButtonOptionsProps | null;\n\tenabled?: boolean;\n}\n\nconst emptyOption: IFinsembleDefaultDropdownButtonOptionsProps = {\n\toptionLabel: \"Please select..\",\n\tclickHandler: () => {},\n};\n\nconst DefaultDropdownButton: React.FunctionComponent<IFinsembleDefaultDropdownButtonProps> = ({\n\tallowEmpty = true,\n\tcaretLocation = \"left\",\n\tclassNames = \"\",\n\tbuttonOptions = [],\n\tdefaultSelection = null,\n\tenabled = true,\n\tbuttonLabel = \"Select value\",\n}: IFinsembleDefaultDropdownButtonProps) => {\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\tconst uniqueId = useMemo(() => Math.random(), []);\n\tconst [optionsVisible, toggleOptionsPanel] = useState(false);\n\tconst [focusIndex, setFocusIndex] = useState(-1);\n\tuseOutsideClickDetector(wrapperRef, () => toggleOptionsPanel(false));\n\n\tconst [selectedValue, setSelectedValue] = useState<IFinsembleDefaultDropdownButtonOptionsProps | null>(\n\t\tdefaultSelection\n\t);\n\n\tuseEffect(() => {\n\t\tif (defaultSelection) {\n\t\t\tsetSelectedValue(defaultSelection);\n\t\t} else {\n\t\t\tif (allowEmpty) {\n\t\t\t\tif (!buttonOptions.includes(emptyOption)) buttonOptions.unshift(emptyOption);\n\t\t\t\tsetSelectedValue(emptyOption);\n\t\t\t} else {\n\t\t\t\tsetSelectedValue(buttonOptions[0]);\n\t\t\t}\n\t\t}\n\t}, [defaultSelection]);\n\n\tconst selectOptionByIndex = (index: number) => {\n\t\tsetSelectedValue(buttonOptions[index]);\n\t\tif (\"clickHandler\" in buttonOptions[index]) {\n\t\t\tbuttonOptions[index].clickHandler();\n\t\t}\n\t\ttoggleOptionsPanel(false);\n\t};\n\n\tconst changeOptionByDirection = (direction: \"up\" | \"down\") => {\n\t\tif (!selectedValue) {\n\t\t\tif (direction === \"down\") {\n\t\t\t\tselectOptionByIndex(0);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst optionLabels = buttonOptions.map((opt) => opt.optionLabel);\n\t\tconst currentOptionIndex = optionLabels.indexOf(selectedValue.optionLabel);\n\n\t\tif (direction === \"up\") {\n\t\t\tconst newIndex = currentOptionIndex - 1;\n\t\t\tselectOptionByIndex(Math.max(0, newIndex));\n\t\t} else {\n\t\t\tconst newIndex = currentOptionIndex + 1;\n\t\t\tselectOptionByIndex(Math.min(newIndex, buttonOptions.length - 1));\n\t\t}\n\t};\n\n\tconst options = buttonOptions.map((option, index) => (\n\t\t<div\n\t\t\tkey={index}\n\t\t\ttabIndex={0}\n\t\t\tclassName=\"finsemble-dropdown__btn-option\"\n\t\t\tonClick={() => {\n\t\t\t\tselectOptionByIndex(index);\n\t\t\t}}\n\t\t\trole=\"option\"\n\t\t\taria-selected={focusIndex === index}\n\t\t>\n\t\t\t{option.optionLabel}\n\t\t</div>\n\t));\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={enabled ? 0 : -1}\n\t\t\tref={wrapperRef}\n\t\t\trole=\"combobox\"\n\t\t\taria-haspopup={optionsVisible}\n\t\t\taria-expanded={optionsVisible}\n\t\t\taria-owns={`default-dropdown_${uniqueId}`}\n\t\t\taria-label={buttonLabel}\n\t\t\tclassName={`finsemble-dropdown__btn ${classNames} ${optionsVisible ? \"active\" : \"\"}`}\n\t\t\tonClick={enabled ? () => toggleOptionsPanel(!optionsVisible) : () => {}}\n\t\t\tonKeyDown={(e) => {\n\t\t\t\tif (!enabled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (optionsVisible) {\n\t\t\t\t\t// Keyboard navigation for the expanded combobox options\n\t\t\t\t\tif (e.key === \"Enter\" || e.key === \" \") {\n\t\t\t\t\t\t// Activate the selected option (equiv: click the hovered option)\n\t\t\t\t\t\tselectOptionByIndex(focusIndex);\n\t\t\t\t\t} else if (e.key === \"ArrowDown\") {\n\t\t\t\t\t\t// Select next option down (equiv: hover over the next option down)\n\t\t\t\t\t\tsetFocusIndex(focusIndex + 1 >= buttonOptions.length ? buttonOptions.length - 1 : focusIndex + 1);\n\t\t\t\t\t} else if (e.key === \"ArrowUp\") {\n\t\t\t\t\t\t// Select next option up (equiv: hover over the next option up)\n\t\t\t\t\t\tsetFocusIndex(focusIndex - 1 <= 0 ? 0 : focusIndex - 1);\n\t\t\t\t\t} else if (e.key === \"Escape\") {\n\t\t\t\t\t\t// Without activating anything, close the options. (equiv: clicking away)\n\t\t\t\t\t\ttoggleOptionsPanel(false);\n\t\t\t\t\t\tsetFocusIndex(0);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Keyboard navigation for a collapsed combobox\n\t\t\t\t\tif (e.key === \"Enter\" || e.key === \" \") {\n\t\t\t\t\t\t// Expand the combobox\n\t\t\t\t\t\ttoggleOptionsPanel(!optionsVisible);\n\t\t\t\t\t\tsetFocusIndex(0);\n\t\t\t\t\t} else if (e.key === \"ArrowDown\") {\n\t\t\t\t\t\t// Cycle between options (down)\n\t\t\t\t\t\tchangeOptionByDirection(\"down\");\n\t\t\t\t\t} else if (e.key === \"ArrowUp\") {\n\t\t\t\t\t\t// Cycle between options (up)\n\t\t\t\t\t\tchangeOptionByDirection(\"up\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{caretLocation === \"left\" ? (\n\t\t\t\t<>\n\t\t\t\t\t<i className={`ff-caret-${optionsVisible ? \"up\" : \"down\"}`} />\n\t\t\t\t\t<span className=\"finsemble-dropdown__btn-label\">\n\t\t\t\t\t\t{selectedValue ? selectedValue.optionLabel : emptyOption.optionLabel}\n\t\t\t\t\t</span>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span className=\"finsemble-dropdown__btn-label\">\n\t\t\t\t\t\t{selectedValue ? selectedValue.optionLabel : emptyOption.optionLabel}\n\t\t\t\t\t</span>\n\t\t\t\t\t<i className={`ff-caret-${optionsVisible ? \"up\" : \"down\"}`} />\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{optionsVisible ? (\n\t\t\t\t<div id={`default-dropdown_${uniqueId}`} className=\"finsemble-dropdown__btn-options\">\n\t\t\t\t\t{options}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t);\n};\n\nexport default DefaultDropdownButton;\n"]}
|
|
1
|
+
{"version":3,"file":"DefaultDropdownButton.js","sourceRoot":"","sources":["../../../src/components/shared/DefaultDropdownButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAkB9E,MAAM,WAAW,GAAgD;IAChE,WAAW,EAAE,iBAAiB;IAC9B,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;CACtB,CAAC;AAEF,MAAM,qBAAqB,GAAkE,CAAC,EAC7F,UAAU,GAAG,IAAI,EACjB,aAAa,GAAG,MAAM,EACtB,UAAU,GAAG,EAAE,EACf,aAAa,GAAG,EAAE,EAClB,gBAAgB,GAAG,IAAI,EACvB,OAAO,GAAG,IAAI,EACd,WAAW,GAAG,cAAc,GACU,EAAE,EAAE;IAC1C,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;IAClD,MAAM,CAAC,cAAc,EAAE,kBAAkB,C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C,CAAC,MAAM,EAAE;wBACb,kBAAkB,CAAC,CAAC,cAAc,CAAC,CAAC;qBACpC;yBAAM;wBAEN,uBAAuB,CAAC,MAAM,CAAC,CAAC;qBAChC;oBACD,CAAC,CAAC,cAAc,EAAE,CAAC;iBACnB;qBAAM,IAAI,CAAC,CAAC,GAAG,KAAK,SAAS,EAAE;oBAE/B,CAAC,CAAC,cAAc,EAAE,CAAC;oBACnB,uBAAuB,CAAC,IAAI,CAAC,CAAC;iBAC9B;aACD;QACF,CAAC;QAEA,aAAa,KAAK,MAAM,CAAC,CAAC,CAAC,CAC3B;YACC,2BAAG,SAAS,EAAE,YAAY,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,GAAI;YAC9D,8BAAM,SAAS,EAAC,+BAA+B,IAC7C,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAC9D,CACL,CACH,CAAC,CAAC,CAAC,CACH;YACC,8BAAM,SAAS,EAAC,+BAA+B,IAC7C,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAC9D;YACP,2BAAG,SAAS,EAAE,YAAY,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,GAAI,CAC5D,CACH;QACA,cAAc,CAAC,CAAC,CAAC,CACjB,6BAAK,EAAE,EAAE,oBAAoB,QAAQ,EAAE,EAAE,SAAS,EAAC,iCAAiC,IAClF,OAAO,CACH,CACN,CAAC,CAAC,CAAC,IAAI,CACH,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC","sourcesContent":["import React, { useEffect, useMemo, useRef, useState } from \"react\";\nimport \"../../assets/css/button.css\";\nimport { useOutsideClickDetector } from \"../../hooks/useOutsideClickDetector\";\n\nexport interface IFinsembleDefaultDropdownButtonOptionsProps {\n\toptionLabel: string;\n\toptionValue?: any;\n\tclickHandler: Function;\n}\n\nexport interface IFinsembleDefaultDropdownButtonProps {\n\tallowEmpty?: boolean;\n\tbuttonLabel?: string;\n\tcaretLocation?: \"left\" | \"right\";\n\tclassNames?: string;\n\tbuttonOptions: Array<IFinsembleDefaultDropdownButtonOptionsProps>;\n\tdefaultSelection?: IFinsembleDefaultDropdownButtonOptionsProps | null;\n\tenabled?: boolean;\n}\n\nconst emptyOption: IFinsembleDefaultDropdownButtonOptionsProps = {\n\toptionLabel: \"Please select..\",\n\tclickHandler: () => {},\n};\n\nconst DefaultDropdownButton: React.FunctionComponent<IFinsembleDefaultDropdownButtonProps> = ({\n\tallowEmpty = true,\n\tcaretLocation = \"left\",\n\tclassNames = \"\",\n\tbuttonOptions = [],\n\tdefaultSelection = null,\n\tenabled = true,\n\tbuttonLabel = \"Select value\",\n}: IFinsembleDefaultDropdownButtonProps) => {\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\tconst uniqueId = useMemo(() => Math.random(), []);\n\tconst [optionsVisible, toggleOptionsPanel] = useState(false);\n\tconst [focusIndex, setFocusIndex] = useState(-1);\n\tuseOutsideClickDetector(wrapperRef, () => toggleOptionsPanel(false));\n\n\tconst [selectedValue, setSelectedValue] = useState<IFinsembleDefaultDropdownButtonOptionsProps | null>(\n\t\tdefaultSelection\n\t);\n\n\tuseEffect(() => {\n\t\tif (defaultSelection) {\n\t\t\tsetSelectedValue(defaultSelection);\n\t\t} else {\n\t\t\tif (allowEmpty) {\n\t\t\t\tif (!buttonOptions.includes(emptyOption)) buttonOptions.unshift(emptyOption);\n\t\t\t\tsetSelectedValue(emptyOption);\n\t\t\t} else {\n\t\t\t\tsetSelectedValue(buttonOptions[0]);\n\t\t\t}\n\t\t}\n\t}, [defaultSelection]);\n\n\tconst selectOptionByIndex = (index: number) => {\n\t\tsetSelectedValue(buttonOptions[index]);\n\t\tif (\"clickHandler\" in buttonOptions[index]) {\n\t\t\tbuttonOptions[index].clickHandler();\n\t\t}\n\t\ttoggleOptionsPanel(false);\n\t};\n\n\tconst changeOptionByDirection = (direction: \"up\" | \"down\") => {\n\t\tif (!selectedValue) {\n\t\t\tif (direction === \"down\") {\n\t\t\t\tselectOptionByIndex(0);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst optionLabels = buttonOptions.map((opt) => opt.optionLabel);\n\t\tconst currentOptionIndex = optionLabels.indexOf(selectedValue.optionLabel);\n\n\t\tif (direction === \"up\") {\n\t\t\tconst newIndex = currentOptionIndex - 1;\n\t\t\tselectOptionByIndex(Math.max(0, newIndex));\n\t\t} else {\n\t\t\tconst newIndex = currentOptionIndex + 1;\n\t\t\tselectOptionByIndex(Math.min(newIndex, buttonOptions.length - 1));\n\t\t}\n\t};\n\n\tconst options = buttonOptions.map((option, index) => (\n\t\t<div\n\t\t\tkey={index}\n\t\t\ttabIndex={0}\n\t\t\tclassName=\"finsemble-dropdown__btn-option\"\n\t\t\tonClick={() => {\n\t\t\t\tselectOptionByIndex(index);\n\t\t\t}}\n\t\t\trole=\"option\"\n\t\t\taria-selected={focusIndex === index}\n\t\t>\n\t\t\t{option.optionLabel}\n\t\t</div>\n\t));\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={enabled ? 0 : -1}\n\t\t\tref={wrapperRef}\n\t\t\trole=\"combobox\"\n\t\t\taria-haspopup={optionsVisible}\n\t\t\taria-expanded={optionsVisible}\n\t\t\taria-owns={`default-dropdown_${uniqueId}`}\n\t\t\taria-label={buttonLabel}\n\t\t\tclassName={`finsemble-dropdown__btn ${classNames} ${optionsVisible ? \"active\" : \"\"}`}\n\t\t\tonClick={enabled ? () => toggleOptionsPanel(!optionsVisible) : () => {}}\n\t\t\tonKeyDown={(e) => {\n\t\t\t\tif (!enabled) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (optionsVisible) {\n\t\t\t\t\t// Keyboard navigation for the expanded combobox options\n\t\t\t\t\tif (e.key === \"Enter\" || e.key === \" \") {\n\t\t\t\t\t\t// Activate the selected option (equiv: click the hovered option)\n\t\t\t\t\t\tselectOptionByIndex(focusIndex);\n\t\t\t\t\t} else if (e.key === \"ArrowDown\") {\n\t\t\t\t\t\t// Select next option down (equiv: hover over the next option down)\n\t\t\t\t\t\tsetFocusIndex(focusIndex + 1 >= buttonOptions.length ? buttonOptions.length - 1 : focusIndex + 1);\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t} else if (e.key === \"ArrowUp\") {\n\t\t\t\t\t\t// Select next option up (equiv: hover over the next option up)\n\t\t\t\t\t\tsetFocusIndex(focusIndex - 1 <= 0 ? 0 : focusIndex - 1);\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t} else if (e.key === \"Escape\") {\n\t\t\t\t\t\t// Without activating anything, close the options. (equiv: clicking away)\n\t\t\t\t\t\ttoggleOptionsPanel(false);\n\t\t\t\t\t\tsetFocusIndex(0);\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Keyboard navigation for a collapsed combobox\n\t\t\t\t\tif (e.key === \"Enter\" || e.key === \" \") {\n\t\t\t\t\t\t// Expand the combobox\n\t\t\t\t\t\ttoggleOptionsPanel(!optionsVisible);\n\t\t\t\t\t\tsetFocusIndex(0);\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t} else if (e.key === \"ArrowDown\") {\n\t\t\t\t\t\tif (e.altKey) {\n\t\t\t\t\t\t\ttoggleOptionsPanel(!optionsVisible);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Cycle between options (down)\n\t\t\t\t\t\t\tchangeOptionByDirection(\"down\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t} else if (e.key === \"ArrowUp\") {\n\t\t\t\t\t\t// Cycle between options (up)\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tchangeOptionByDirection(\"up\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{caretLocation === \"left\" ? (\n\t\t\t\t<>\n\t\t\t\t\t<i className={`ff-caret-${optionsVisible ? \"up\" : \"down\"}`} />\n\t\t\t\t\t<span className=\"finsemble-dropdown__btn-label\">\n\t\t\t\t\t\t{selectedValue ? selectedValue.optionLabel : emptyOption.optionLabel}\n\t\t\t\t\t</span>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<span className=\"finsemble-dropdown__btn-label\">\n\t\t\t\t\t\t{selectedValue ? selectedValue.optionLabel : emptyOption.optionLabel}\n\t\t\t\t\t</span>\n\t\t\t\t\t<i className={`ff-caret-${optionsVisible ? \"up\" : \"down\"}`} />\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t{optionsVisible ? (\n\t\t\t\t<div id={`default-dropdown_${uniqueId}`} className=\"finsemble-dropdown__btn-options\">\n\t\t\t\t\t{options}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t);\n};\n\nexport default DefaultDropdownButton;\n"]}
|
|
@@ -15,6 +15,18 @@ describe("<DefaultDropdownButton/>", () => {
|
|
|
15
15
|
wrapper.find(".finsemble-dropdown__btn").simulate("click");
|
|
16
16
|
expect(wrapper.find(".finsemble-dropdown__btn-options")).to.have.lengthOf(1);
|
|
17
17
|
});
|
|
18
|
+
it("should display options when not displaying options and passed the keys ALT+DOWN", () => {
|
|
19
|
+
const buttonOptions = [
|
|
20
|
+
{ optionLabel: "one", clickHandler: () => { } },
|
|
21
|
+
{ optionLabel: "two", clickHandler: () => { } },
|
|
22
|
+
];
|
|
23
|
+
const wrapper = mount(React.createElement(DefaultDropdownButton, { buttonOptions: buttonOptions }));
|
|
24
|
+
wrapper.find(".finsemble-dropdown__btn").simulate("keyDown", {
|
|
25
|
+
altKey: true,
|
|
26
|
+
key: "ArrowDown",
|
|
27
|
+
});
|
|
28
|
+
expect(wrapper.find(".finsemble-dropdown__btn-options")).to.have.lengthOf(1);
|
|
29
|
+
});
|
|
18
30
|
it("should not display options when currently displaying options and clicked on", () => {
|
|
19
31
|
const buttonOptions = [
|
|
20
32
|
{ optionLabel: "one", clickHandler: () => { } },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultDropdownButton.spec.js","sourceRoot":"","sources":["../../../../src/components/shared/tests/DefaultDropdownButton.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC5E,MAAM,aAAa,GAAG;YACrB,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;YAC9C,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE;SAC9C,CAAC;QACF,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,qBAAqB,IAAC,aAAa,EAAE,aAAa,GAAI,CAAC,CAAC;QAC/E,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC3D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6EAA6E,EAAE,GAAG,EAAE;QACtF,MAAM,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,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { mount } from \"enzyme\";\nimport { describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport DefaultDropdownButton from \"./../DefaultDropdownButton\";\nimport * as sinon from \"sinon\";\nimport { accessibilityAssessor } from \"../../sdd/tests/a11y_helper\";\n\ndescribe(\"<DefaultDropdownButton/>\", () => {\n\tit(\"should display options when not displaying options and clicked on\", () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\texpect(wrapper.find(\".finsemble-dropdown__btn-options\")).to.have.lengthOf(1);\n\t});\n\n\tit(\"should not display options when currently displaying options and clicked on\", () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\texpect(wrapper.find(\".finsemble-dropdown__btn-options\")).to.have.lengthOf(0);\n\t});\n\n\tit(\"should not display options when clicked on and not enabled\", () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} enabled={false} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\texpect(wrapper.find(\".finsemble-dropdown__btn-options\")).to.have.lengthOf(0);\n\t});\n\n\tit(\"should perform the specific clickHandler function corresponding to its option\", () => {\n\t\tlet spy = sinon.spy(console, \"log\");\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{\n\t\t\t\toptionLabel: \"two\",\n\t\t\t\tclickHandler: () => {\n\t\t\t\t\tconsole.log(\"Hello World\");\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\twrapper.find(\".finsemble-dropdown__btn-option\").at(2).simulate(\"click\");\n\t\texpect(spy.calledWith(\"Hello World\")).to.be.true;\n\t\tspy.restore();\n\t});\n\n\tit(\"should pass accessibility scans\", async () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t});\n});\n"]}
|
|
1
|
+
{"version":3,"file":"DefaultDropdownButton.spec.js","sourceRoot":"","sources":["../../../../src/components/shared/tests/DefaultDropdownButton.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACzC,EAAE,CAAC,mEAAmE,EAAE,GAAG,EAAE;QAC5E,MAAM,aAAa,GAAG;YACrB,EA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\nimport { describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport DefaultDropdownButton from \"./../DefaultDropdownButton\";\nimport * as sinon from \"sinon\";\nimport { accessibilityAssessor } from \"../../sdd/tests/a11y_helper\";\n\ndescribe(\"<DefaultDropdownButton/>\", () => {\n\tit(\"should display options when not displaying options and clicked on\", () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\texpect(wrapper.find(\".finsemble-dropdown__btn-options\")).to.have.lengthOf(1);\n\t});\n\tit(\"should display options when not displaying options and passed the keys ALT+DOWN\", () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"keyDown\", {\n\t\t\taltKey: true,\n\t\t\tkey: \"ArrowDown\",\n\t\t});\n\t\texpect(wrapper.find(\".finsemble-dropdown__btn-options\")).to.have.lengthOf(1);\n\t});\n\n\tit(\"should not display options when currently displaying options and clicked on\", () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\texpect(wrapper.find(\".finsemble-dropdown__btn-options\")).to.have.lengthOf(0);\n\t});\n\n\tit(\"should not display options when clicked on and not enabled\", () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} enabled={false} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\texpect(wrapper.find(\".finsemble-dropdown__btn-options\")).to.have.lengthOf(0);\n\t});\n\n\tit(\"should perform the specific clickHandler function corresponding to its option\", () => {\n\t\tlet spy = sinon.spy(console, \"log\");\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{\n\t\t\t\toptionLabel: \"two\",\n\t\t\t\tclickHandler: () => {\n\t\t\t\t\tconsole.log(\"Hello World\");\n\t\t\t\t},\n\t\t\t},\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\twrapper.find(\".finsemble-dropdown__btn\").simulate(\"click\");\n\t\twrapper.find(\".finsemble-dropdown__btn-option\").at(2).simulate(\"click\");\n\t\texpect(spy.calledWith(\"Hello World\")).to.be.true;\n\t\tspy.restore();\n\t});\n\n\tit(\"should pass accessibility scans\", async () => {\n\t\tconst buttonOptions = [\n\t\t\t{ optionLabel: \"one\", clickHandler: () => {} },\n\t\t\t{ optionLabel: \"two\", clickHandler: () => {} },\n\t\t];\n\t\tconst wrapper = mount(<DefaultDropdownButton buttonOptions={buttonOptions} />);\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t});\n});\n"]}
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2017 - 2020 by ChartIQ, Inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
*/
|
|
5
1
|
/// <reference types="react" />
|
|
6
|
-
export declare
|
|
7
|
-
views: any[];
|
|
8
|
-
getConfig: typeof FSBL.Clients.ConfigClient.getValues;
|
|
9
|
-
resetProject: typeof FSBL.Clients.SmartDesktopClient.prototype.resetProject;
|
|
10
|
-
getSDServerInfo: typeof FSBL.Clients.SmartDesktopClient.prototype.getSDServerInfo;
|
|
11
|
-
getProjectSettings: typeof FSBL.Clients.SmartDesktopClient.prototype.getProjectSettings;
|
|
12
|
-
updateProjectSettings?: typeof FSBL.Clients.SmartDesktopClient.prototype.updateProjectSettings;
|
|
13
|
-
onThemeUpdated: typeof FSBL.Clients.SmartDesktopClient.onThemeUpdated;
|
|
14
|
-
selectProjectPath?: typeof FSBL.Clients.SmartDesktopClient.prototype.selectProjectPath;
|
|
15
|
-
restartFinsemble?: () => void;
|
|
16
|
-
};
|
|
17
|
-
export declare const SmartDesktopDesigner: (props: SmartDesktopDesignerProps) => JSX.Element;
|
|
2
|
+
export declare const SmartDesktopDesigner: (props: any) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartDesktopDesigner.js","sourceRoot":"","sources":["../../../src/components/smartDesktopDesigner/SmartDesktopDesigner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SmartDesktopDesigner.js","sourceRoot":"","sources":["../../../src/components/smartDesktopDesigner/SmartDesktopDesigner.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,yCAAK,CAAC","sourcesContent":["/**\n * This class is a dummy class that exists only for build compatibility with LTS seed projects.\n *\n * If you rename \"SmartDesktopDesigner\" to something else (it's been Maker UI, Jumpstart, and DesktopProjectEditor in the past), grep for the following terms (case insensitive):\n * \"SmartDesktop\", \"Smart Desktop\", \"SDD\", \"SDServer\", \"SMART_DESKTOP\"\n */\nimport React from \"react\";\n\nexport const SmartDesktopDesigner = (props: any) => <></>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragHandle.stories.js","sourceRoot":"","sources":["../../../src/components/toolbar/DragHandle.stories.tsx"],"names":[],"mappings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OAAO,CAAC,YAAY,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC;IAE3D,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAgB,GAAG,KAAK,EAAE,GAAW,EAAE,EAAE;QACnE,IAAI,GAAG,KAAK,gDAAgD,EAAE;YAC7D,OAAO;gBACN,GAAG,EAAE,IAAI;gBACT,IAAI,EAAE,IAAI,CAAC,mBAAmB;aAC9B,CAAC;SACF;QACD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAClC,CAAC,CAAC;IAEF,OAAO,CACN,oBAAC,iBAAiB;QACjB,oBAAC,UAAU,OAAG,CACK,CACpB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,KAAK,CAAC,IAAI,GAAG;IACZ,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC;IACjC,mBAAmB,EAAE,IAAI;CACzB,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChD,cAAc,CAAC,IAAI,GAAG;IACrB,WAAW,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC;IACjC,mBAAmB,EAAE,KAAK;CAC1B,CAAC","sourcesContent":["import React from \"react\";\nimport { DragHandle } from \"./DragHandle\";\nimport { Story } from \"@storybook/react/types-6-0\";\nimport { initFSBL } from \"../common/helpers\";\nimport { FinsembleProvider } from \"../FinsembleProvider\";\nimport { action } from \"@storybook/addon-actions\";\nimport \"../../assets/css/toolbar.css\";\n\nexport default {\n\ttitle: \"Toolbar/DragHandle\",\n\tcomponent: DragHandle,\n};\n\nconst Template: Story<any> = (args: any) => {\n\tinitFSBL(window);\n\n\t// Overwrite mockup for testing purposes\n\tFSBL.Clients.WindowClient.startMovingWindow = args.actionStart;\n\tFSBL.Clients.WindowClient.stopMovingWindow = args.actionEnd;\n\n\t(FSBL.Clients.ConfigClient.getValue as any) = async (str: string) => {\n\t\tif (str === \"finsemble-electron-adapter.useDOMBasedMovement\") {\n\t\t\treturn {\n\t\t\t\terr: null,\n\t\t\t\tdata: args.useDOMBasedMovement,\n\t\t\t};\n\t\t}\n\t\treturn { err: null, data: null };\n\t};\n\n\treturn (\n\t\t<FinsembleProvider>\n\t\t\t<DragHandle />\n\t\t</FinsembleProvider>\n\t);\n};\n\nexport const Basic = Template.bind({});\nBasic.args = {\n\tactionStart: action(\"start dragging\"),\n\tactionEnd: action(\"end dragging\"),\n\tuseDOMBasedMovement: true,\n};\nexport const NativeMovement = Template.bind({});\nNativeMovement.args = {\n\tactionStart: action(\"start dragging\"),\n\tactionEnd: action(\"end dragging\"),\n\tuseDOMBasedMovement: false,\n};\n"]}
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import * as React from "react";
|
|
13
13
|
import { useState, useEffect } from "react";
|
|
14
14
|
export const ToolbarIcon = (_a) => {
|
|
15
|
-
var { src, children } = _a, other = __rest(_a, ["src", "children"]);
|
|
15
|
+
var { src, children, alt = "File menu" } = _a, other = __rest(_a, ["src", "children", "alt"]);
|
|
16
16
|
const [uniqueSrc, setSrc] = useState(src);
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
const handler = () => {
|
|
@@ -23,6 +23,6 @@ export const ToolbarIcon = (_a) => {
|
|
|
23
23
|
FSBL.Clients.RouterClient.removeListener("Finsemble-ui-change.toolbarIconUpdate", handler);
|
|
24
24
|
};
|
|
25
25
|
}, [src]);
|
|
26
|
-
return (React.createElement("img", Object.assign({ src: uniqueSrc }, other), children));
|
|
26
|
+
return (React.createElement("img", Object.assign({ src: uniqueSrc, alt: alt }, other), children));
|
|
27
27
|
};
|
|
28
28
|
//# sourceMappingURL=ToolbarIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarIcon.js","sourceRoot":"","sources":["../../../src/components/toolbar/ToolbarIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAM5C,MAAM,CAAC,MAAM,WAAW,GAAiC,CAAC,
|
|
1
|
+
{"version":3,"file":"ToolbarIcon.js","sourceRoot":"","sources":["../../../src/components/toolbar/ToolbarIcon.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAM5C,MAAM,CAAC,MAAM,WAAW,GAAiC,CAAC,EAA8C,EAAO,EAAE;QAAvD,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,GAAG,WAAW,OAAY,EAAP,KAAK,cAA5C,0BAA8C,CAAF;IACrG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAE1C,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,OAAO,GAAG,GAAG,EAAE;YACpB,MAAM,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,uCAAuC,EAAE,OAAO,CAAC,CAAC;QACxF,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,uCAAuC,EAAE,OAAO,CAAC,CAAC;QAC5F,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,OAAO,CACN,2CAAK,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,IAAM,KAAK,GACtC,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { useState, useEffect } from \"react\";\n\n/**\n * Returns an image that will reload itself based on messages on the \"Finsemble-ui-change.toolbarIconUpdate\" topic. This\n * is useful for dynamic theming. Otherwise this behaves just like an <img> tag.\n */\nexport const ToolbarIcon: React.FunctionComponent<any> = ({ src, children, alt = \"File menu\", ...other }): any => {\n\tconst [uniqueSrc, setSrc] = useState(src);\n\n\tuseEffect(() => {\n\t\tconst handler = () => {\n\t\t\tsetSrc(`${src}?${Date.now()}`);\n\t\t};\n\t\tFSBL.Clients.RouterClient.addListener(\"Finsemble-ui-change.toolbarIconUpdate\", handler);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"Finsemble-ui-change.toolbarIconUpdate\", handler);\n\t\t};\n\t}, [src]);\n\n\treturn (\n\t\t<img src={uniqueSrc} alt={alt} {...other}>\n\t\t\t{children}\n\t\t</img>\n\t);\n};\n"]}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import * as PropTypes from "prop-types";
|
|
3
2
|
declare type props = {
|
|
4
3
|
hideBelowWidth?: number;
|
|
5
4
|
className?: string;
|
|
6
5
|
style?: React.CSSProperties;
|
|
7
6
|
children?: React.ReactNode;
|
|
8
7
|
};
|
|
9
|
-
export declare const ToolbarSection: {
|
|
10
|
-
({ children, hideBelowWidth, className, style }: props): JSX.Element;
|
|
11
|
-
propTypes: {
|
|
12
|
-
hideBelowWidth: PropTypes.Requireable<number>;
|
|
13
|
-
className: PropTypes.Requireable<string>;
|
|
14
|
-
style: PropTypes.Requireable<object>;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
8
|
+
export declare const ToolbarSection: ({ children, hideBelowWidth, className, style }: props) => JSX.Element;
|
|
17
9
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import { ErrorBoundary } from "../common/ErrorBoundary";
|
|
3
3
|
const { useState, useEffect, createRef } = React;
|
|
4
4
|
export const ToolbarSection = ({ children, hideBelowWidth, className, style = {} }) => {
|
|
5
5
|
const [shouldRender, setShouldRender] = useState(true);
|
|
@@ -18,11 +18,7 @@ export const ToolbarSection = ({ children, hideBelowWidth, className, style = {}
|
|
|
18
18
|
}
|
|
19
19
|
return () => { };
|
|
20
20
|
}, []);
|
|
21
|
-
return (React.createElement("div", { ref: wrapperRef, className: `finsemble-toolbar-section ${className}`, style: style },
|
|
22
|
-
|
|
23
|
-
ToolbarSection.propTypes = {
|
|
24
|
-
hideBelowWidth: PropTypes.number,
|
|
25
|
-
className: PropTypes.string,
|
|
26
|
-
style: PropTypes.object,
|
|
21
|
+
return (React.createElement("div", { ref: wrapperRef, className: `finsemble-toolbar-section ${className}`, style: style },
|
|
22
|
+
React.createElement(ErrorBoundary, null, shouldRender && children)));
|
|
27
23
|
};
|
|
28
24
|
//# sourceMappingURL=ToolbarSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolbarSection.js","sourceRoot":"","sources":["../../../src/components/toolbar/ToolbarSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"ToolbarSection.js","sourceRoot":"","sources":["../../../src/components/toolbar/ToolbarSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;AAejD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,GAAG,EAAE,EAAS,EAAE,EAAE;IAC5F,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,SAAS,EAAkB,CAAC;IAK/C,MAAM,QAAQ,GAAG,CAAC,OAA8B,EAAE,EAAE;QACnD,IAAI,OAAO,CAAC,MAAM,EAAE;YAEnB,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAa,CAAC;YAIjD,IAAI,WAAW,IAAI,cAAc,EAAE;gBAClC,eAAe,CAAC,WAAW,GAAG,cAAc,CAAC,CAAC;aAC9C;SACD;IACF,CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,UAAU,CAAC,OAAO,EAAE;YACvB,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACzD;QACD,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CACN,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,6BAA6B,SAAS,EAAE,EAAE,KAAK,EAAE,KAAK;QACtF,oBAAC,aAAa,QAGZ,YAAY,IAAI,QAAQ,CAEV,CACX,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { ErrorBoundary } from \"../common/ErrorBoundary\";\n\nconst { useState, useEffect, createRef } = React;\n\ntype props = {\n\thideBelowWidth?: number;\n\tclassName?: string;\n\tstyle?: React.CSSProperties;\n\tchildren?: React.ReactNode;\n};\n/**\n * A container element for defining sections in a toolbar.\n * This component exists because css flex-box does provide \"hideBelowWidth\" functionality.\n * @param {number} [hideBelowWidth] - Below this width the component will hide itself\n * @param {string} [className] - The className for a customized look of the toolbar section\n * @param {string} [style] - The CSS style for a customized look of the toolbar section\n */\nexport const ToolbarSection = ({ children, hideBelowWidth, className, style = {} }: props) => {\n\tconst [shouldRender, setShouldRender] = useState(true);\n\t// We will use this to access the section element.\n\tconst wrapperRef = createRef<HTMLDivElement>();\n\t/**\n\t * This is called by ResizerObserver whenever the size of\n\t * the section changes due to toolbar shrinkage.\n\t */\n\tconst onResize = (entries: ResizeObserverEntry[]) => {\n\t\tif (entries.length) {\n\t\t\t// Get the calculated width\n\t\t\tconst { offsetWidth } = entries[0].target as any;\n\t\t\t// If the developer specified a minimum width (hideBelowWidth)\n\t\t\t// and the section width is greater than the minimum\n\t\t\t// we should render all children by setting shouldRender to true.\n\t\t\tif (offsetWidth && hideBelowWidth) {\n\t\t\t\tsetShouldRender(offsetWidth > hideBelowWidth);\n\t\t\t}\n\t\t}\n\t};\n\tuseEffect(() => {\n\t\tif (wrapperRef.current) {\n\t\t\tnew ResizeObserver(onResize).observe(wrapperRef.current);\n\t\t}\n\t\treturn () => {};\n\t}, []);\n\treturn (\n\t\t<div ref={wrapperRef} className={`finsemble-toolbar-section ${className}`} style={style}>\n\t\t\t<ErrorBoundary>\n\t\t\t\t{\n\t\t\t\t\t// Render children if shouldRender is true\n\t\t\t\t\tshouldRender && children\n\t\t\t\t}\n\t\t\t</ErrorBoundary>\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -210,7 +210,7 @@ function refreshAppDefinitions(componentList) {
|
|
|
210
210
|
if (component && component.component) {
|
|
211
211
|
const launchableByUser = (_c = (_b = (_a = component === null || component === void 0 ? void 0 : component.foreign) === null || _a === void 0 ? void 0 : _a.components) === null || _b === void 0 ? void 0 : _b["App Launcher"]) === null || _c === void 0 ? void 0 : _c.launchableByUser;
|
|
212
212
|
const displayName = (_d = component.component.displayName) !== null && _d !== void 0 ? _d : componentType;
|
|
213
|
-
const iconObject = iconFromConfig((_f = (_e = component === null || component === void 0 ? void 0 : component.foreign) === null || _e === void 0 ? void 0 : _e.components) === null || _f === void 0 ? void 0 : _f.Toolbar, displayName);
|
|
213
|
+
const iconObject = iconFromConfig((_f = (_e = component === null || component === void 0 ? void 0 : component.foreign) === null || _e === void 0 ? void 0 : _e.components) === null || _f === void 0 ? void 0 : _f.Toolbar, displayName, component === null || component === void 0 ? void 0 : component.appDConfig);
|
|
214
214
|
if (launchableByUser && !component.component.isUserDefined) {
|
|
215
215
|
data.configComponents[componentType] = {
|
|
216
216
|
appID: componentType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreActions.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/stores/StoreActions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIpD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC/B,IAAI,UAAgB,CAAC;AACrB,IAAI,IAAS,CAAC;AACd,IAAI,YAAiB,CAAC;AAsCtB,eAAe;IACd,UAAU;IACV,MAAM;IACN,YAAY;IACZ,cAAc;IACd,mBAAmB;IACnB,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,SAAS;IACT,cAAc;IACd,UAAU;IACV,cAAc;IACd,mBAAmB;IACnB,eAAe;IACf,eAAe;IACf,cAAc;IACd,UAAU;IACV,oBAAoB;IACpB,aAAa;IACb,aAAa;IACb,SAAS;IACT,MAAM;IACN,OAAO;IACP,MAAM;IACN,eAAe;IACf,YAAY;IACZ,cAAc;IACd,OAAO;IACP,qBAAqB;CACrB,CAAC;AAEF,IAAI,IAAI,GAAa,EAAE,CAAC;AACxB,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AACtD,MAAM,eAAe,GAAG,YAAY,CAAC;AAErC,SAAS,YAAY;IACpB,MAAM,UAAU,GAAG,YAAY,CAAC;IAChC,MAAM,SAAS,GAAG,WAAW,CAAC;IAC9B,OAAO,EAAE,qBAAqB,EAA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G,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,MAAM,CAAC,GAAW;IAE1B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAElD,SAAS,CAAC,oBAAoB,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,SAAS,CAAC,GAAW;IAE7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5C,SAAS,CAAC,oBAAoB,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AACtD,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\nimport { findIndex } from \"lodash\";\nimport { getStore } from \"./LauncherStore\";\nimport AppDirectory from \"../modules/AppDirectory\";\nimport FDC3 from \"../modules/FDC3\";\nimport { iconFromConfig } from \"../../../icon/Icon\";\nimport { FoldersType, FolderAppType } from \"../../../../types/advancedAppLauncherTypes\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport sortFunctions from \"../utils/sort-functions\";\nconst async = require(\"async\");\nlet FDC3Client: FDC3;\nlet appd: any;\nlet appDEndpoint: any;\n\ntype ComponentDescriptor = Record<string, any>;\ntype ComponentList = Record<string, ComponentDescriptor>;\n\ntype AppsType = {\n\tappID: string;\n\ttags: string[];\n\tname: string;\n\turl: string;\n\ttype: string;\n\tcanDelete: boolean;\n\tdisplayName?: string;\n};\ntype ConfigType = {\n\tappID: string;\n\ticon: any;\n\tname: string;\n\tdisplayName: string;\n\tsource: string;\n\ttags: string[];\n};\ntype DataType = {\n\tfolders: FoldersType[\"folders\"];\n\tfoldersList: FoldersType[\"list\"];\n\tapps: {\n\t\t[field: string]: AppsType;\n\t};\n\ttags: string[];\n\tactiveFolder: string;\n\tfilterText: string;\n\tsortBy: keyof typeof sortFunctions;\n\tisFormVisible: boolean;\n\tconfigComponents: {\n\t\t[field: string]: ConfigType;\n\t};\n};\n\nexport default {\n\tinitialize,\n\taddApp,\n\taddNewFolder,\n\taddAppToFolder,\n\tremoveAppFromFolder,\n\trenameFolder,\n\tdeleteFolder,\n\tdeleteApp,\n\tdeleteTag,\n\treorderFolders,\n\tgetFolders,\n\tgetFoldersList,\n\tgetActiveFolderName,\n\tgetActiveFolder,\n\tgetSingleFolder,\n\tgetAllAppsTags,\n\tgetAllApps,\n\tgetAllAppsFromFolder,\n\tgetFormStatus,\n\tgetSearchText,\n\tgetSortBy,\n\taddTag,\n\tgetTags,\n\tgetApp,\n\tgetDragDisabled,\n\tgetConstants,\n\tfindAppByField,\n\tgetApps,\n\trefreshAppDefinitions,\n};\n\nlet data = <DataType>{};\nconst ADVANCED_APP_LAUNCHER = \"Advanced App Launcher\";\nconst NEW_FOLDER_NAME = \"New folder\";\n// returns names of default folders.\nfunction getConstants() {\n\tconst DASHBOARDS = \"Dashboards\";\n\tconst FAVORITES = \"Favorites\";\n\treturn { ADVANCED_APP_LAUNCHER, DASHBOARDS, FAVORITES };\n}\n\n// Add to here if you want to disable dragging on a folder.\nfunction getDragDisabled() {\n\tconst { DASHBOARDS, FAVORITES } = getConstants();\n\treturn [ADVANCED_APP_LAUNCHER, DASHBOARDS, FAVORITES];\n}\n\nfunction initialize(callback = Function.prototype) {\n\tFSBL.Clients.ConfigClient.getValue({ field: \"finsemble.appDirectoryEndpoint\" }, (_, appDirectoryEndpoint) => {\n\t\t// cache value globally to be used in the event that we need to fetch data for a given component.\n\t\tappDEndpoint = appDirectoryEndpoint;\n\t\tconst store = getStore();\n\t\tdata.folders = store?.values.appFolders.folders;\n\t\tdata.foldersList = store?.values.appFolders.list;\n\t\tvalidateFolderDataStructure();\n\t\tdata.apps = store?.values.appDefinitions;\n\t\tdata.tags = store?.values.activeLauncherTags;\n\t\tdata.activeFolder = store?.values.activeFolder;\n\t\tdata.filterText = store?.values.filterText;\n\t\tdata.sortBy = store?.values.sortBy;\n\t\tdata.isFormVisible = store?.values.isFormVisible;\n\t\tdata.configComponents = {};\n\n\t\t// Add listeners to keep our copy up to date\n\t\tstore?.addListener({ field: \"appFolders.folders\" }, (foldersErr, dt) => {\n\t\t\tdata.folders = dt.value;\n\t\t});\n\t\tstore?.addListener({ field: \"appFolders.list\" }, (folderListErr, dt) => (data.foldersList = dt.value));\n\t\tstore?.addListener({ field: \"appDefinitions\" }, (appDefinitionsErr, dt) => (data.apps = dt.value));\n\t\tstore?.addListener({ field: \"activeFolder\" }, (activeFolderErr, dt) => {\n\t\t\tdata.activeFolder = dt.value;\n\t\t});\n\t\tstore?.addListener({ field: \"isFormVisible\" }, (visibilityErr, dt) => (data.isFormVisible = dt.value));\n\t\tstore?.addListener({ field: \"sortBy\" }, (sortErr, dt) => (data.sortBy = dt.value));\n\t\tstore?.addListener({ field: \"activeLauncherTags\" }, (launcherTagsErr, dt) => (data.tags = dt.value));\n\t\tstore?.addListener({ field: \"filterText\" }, (filterTextErr, dt) => (data.filterText = dt.value));\n\n\t\tFSBL.Clients.RouterClient.subscribe(\"Launcher.update\", (err, response) => {\n\t\t\tFSBL.Clients.Logger.debug(\"list updated\", err, response);\n\t\t\tif (err) {\n\t\t\t\treturn console.error(err);\n\t\t\t}\n\t\t\trefreshAppDefinitions(response.data.componentList);\n\t\t});\n\n\t\t// @deprecate in favor of SystemManagerClient.waitForStartup()\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.Service.State.launcherService\", (unsubscribeErr) => {\n\t\t\tif (unsubscribeErr) {\n\t\t\t\tFSBL.Clients.Logger.error(\n\t\t\t\t\t\"App Launcher encountered an error unsubscribing from the launcher service\",\n\t\t\t\t\tunsubscribeErr\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tloadInstalledComponentsFromStore(() => {\n\t\t\t\t// We load our stored components(config driven) here\n\t\t\t\tloadInstalledConfigComponents(() => {\n\t\t\t\t\tupdateAppsInFolders(callback);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}\n\n// This gets a specific app in FDC3 and returns the results\nfunction getApp(appID: string, cb = Function.prototype) {\n\tappd\n\t\t.get(appID)\n\t\t.then((app: any) => cb(null, app))\n\t\t.catch((err: StandardError) => cb(err));\n}\n/**\n * Ensures all 'apps' properties on folders conform\n * to the new structure (Array vs object)\n */\nfunction validateFolderDataStructure() {\n\tObject.keys(data.folders).forEach((folderName) => {\n\t\tconst folder = data.folders[folderName];\n\t\tif (!Array.isArray(folder.apps)) {\n\t\t\tconst warning =\n\t\t\t\t\"Application Launcher Persistent Store has data stored in deprecated format. Please check distributedStore configs\";\n\t\t\t// If the structure is wrong, notify the user in hopes that the foundation will be fixed\n\t\t\tFSBL.Clients.Logger.warn(warning);\n\t\t\tFSBL.UserNotification.alert(\"system\", \"ONCE-SINCE-STARTUP\", \"Distributed Store Type Mismatch\", warning);\n\t\t\tlet newApps: FolderAppType[] = [];\n\t\t\tObject.values(folder.apps).forEach((app: any) => {\n\t\t\t\tnewApps.push(app);\n\t\t\t});\n\t\t\tfolder.apps = newApps;\n\t\t}\n\t});\n\t_setFolders();\n}\n\n// Update apps in folders with updated config information\nfunction updateAppsInFolders(cb = Function.prototype) {\n\t// Loop through folders and update apps with new info\n\tconst { ADVANCED_APP_LAUNCHER: advancedAppLauncherFolderName } = getConstants();\n\tObject.keys(data.folders).forEach((folderName) => {\n\t\tif (folderName === advancedAppLauncherFolderName) return;\n\t\telse {\n\t\t\tconst folder = data.folders[folderName];\n\t\t\tObject.values(data.configComponents).forEach((configComp) => {\n\t\t\t\tlet index = -1;\n\t\t\t\tfolder.apps.forEach((folderApp, i) => {\n\t\t\t\t\tif (folderApp.appID.toString().trim() === configComp.appID.toString().trim()) {\n\t\t\t\t\t\tindex = i;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (index > -1) {\n\t\t\t\t\tdata.folders[folderName].apps.splice(index, 1, configComp);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\t_setFolders(cb);\n}\n\n/**\n * Given a component config, will return tags, or an empty array.\n *\n * @param {*} componentConfig\n * @returns\n */\nfunction extractTagsFromFinsembleComponentConfig(componentConfig: ComponentDescriptor) {\n\tif (!componentConfig.foreign) return [];\n\tif (!componentConfig.foreign.components) return [];\n\tif (!componentConfig.foreign.components[\"App Launcher\"]) return [];\n\n\tconst { tags } = componentConfig.foreign.components[\"App Launcher\"];\n\n\tif (tags) {\n\t\tif (typeof tags === \"string\") {\n\t\t\treturn [tags];\n\t\t}\n\t\treturn tags;\n\t}\n\n\treturn [];\n}\n/**\n * Instantiates classes needed to interact with the appD server.\n * Only done when needed. If there are no components with source 'FDC3', this code will not execute.\n */\nfunction lazyLoadAppD() {\n\tif (!FDC3Client) FDC3Client = new FDC3({ url: appDEndpoint });\n\tif (!appd) appd = new AppDirectory(FDC3Client) as FDC3;\n}\n\n/**\n * Here we load apps from FDC3\n * @param {*} cb\n */\nfunction loadInstalledComponentsFromStore(cb = Function.prototype) {\n\tasync.map(\n\t\tObject.values(data.apps),\n\t\t(component: any, componentDone: any) => {\n\t\t\t// Load FDC3 components here\n\t\t\tif (component.source && component.source === \"FDC3\") {\n\t\t\t\tlazyLoadAppD();\n\t\t\t\t// get the app info so we can load it into the launcher\n\t\t\t\treturn getApp(component.appID, (err: StandardError) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\t// don't want to kill this;\n\t\t\t\t\t\tdeleteApp(component.appID);\n\t\t\t\t\t\tconsole.error(\"there was an error loading from FDC3\", component, err);\n\t\t\t\t\t}\n\t\t\t\t\treturn componentDone();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Assumption - component is always a user defined component\n\t\t\t// when testing I was never able to get any other component types in this method\n\t\t\tFSBL.Clients.LauncherClient.addUserDefinedComponent(component, (compAddErr) => {\n\t\t\t\tif (compAddErr) {\n\t\t\t\t\tconsole.warn(\"Failed to add new app:\", compAddErr);\n\t\t\t\t}\n\t\t\t\tcomponentDone(compAddErr);\n\t\t\t});\n\t\t},\n\t\t(err: StandardError) => {\n\t\t\tcb(err);\n\t\t}\n\t);\n}\n\n// We load our apps that were loaded from the config.\nfunction loadInstalledConfigComponents(cb = Function.prototype) {\n\t// Get the list of components from the launcher service\n\tFSBL.Clients.LauncherClient.getComponentList((err, componentList) => {\n\t\t/*\n\t\t * Update the folders under the \"App\" menu and delete any apps in the folder\n\t\t * that are no longer in the config and are not user defined components.\n\t\t */\n\t\trefreshAppDefinitions(componentList || {});\n\t\tcb();\n\t});\n}\n\nfunction getApps() {\n\treturn data.apps;\n}\n\nfunction refreshAppDefinitions(componentList: ComponentList) {\n\tconst componentTypeList = Object.keys(componentList);\n\n\tconst { folders } = data;\n\t// Get the user defined apps\n\tconst apps = Object.keys(data.apps);\n\tObject.keys(folders).forEach((folderName) => {\n\t\tfolders[folderName].apps.forEach((configDefinedApp, i) => {\n\t\t\tconst { name, appID } = configDefinedApp;\n\t\t\t// If the component is not in the config component list and is not a user defined component\n\t\t\tif (!componentTypeList.includes(name) && !apps.includes(appID)) {\n\t\t\t\t// Delete app from the folder\n\t\t\t\tfolders[folderName].apps.splice(i, 1);\n\t\t\t}\n\t\t});\n\t});\n\n\tcomponentTypeList.forEach((componentType) => {\n\t\tconst component = componentList?.[componentType];\n\t\tif (component && component.component) {\n\t\t\tconst launchableByUser = component?.foreign?.components?.[\"App Launcher\"]?.launchableByUser;\n\n\t\t\tconst displayName = component.component.displayName ?? componentType;\n\t\t\tconst iconObject = iconFromConfig(component?.foreign?.components?.Toolbar, displayName);\n\t\t\t// Make sure the app is launchable by user\n\t\t\tif (launchableByUser && !component.component.isUserDefined) {\n\t\t\t\tdata.configComponents[componentType] = {\n\t\t\t\t\tappID: componentType,\n\t\t\t\t\ticon: iconObject,\n\t\t\t\t\tname: componentType,\n\t\t\t\t\tdisplayName,\n\t\t\t\t\tsource: \"config\",\n\t\t\t\t\ttags: extractTagsFromFinsembleComponentConfig(component),\n\t\t\t\t};\n\t\t\t} else if (!launchableByUser && data.configComponents[componentType]) {\n\t\t\t\tdelete data.configComponents[componentType];\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction _setValue(field: string, value: any, cb: any) {\n\tgetStore()?.setValue(\n\t\t{\n\t\t\tfield: field,\n\t\t\tvalue: value,\n\t\t},\n\t\t(error) => {\n\t\t\tif (error) {\n\t\t\t\tFSBL.Clients.Logger.error(`Advanced App Launcher: Failed to save: ${field}:${value}`);\n\t\t\t} else {\n\t\t\t\tcb && cb();\n\t\t\t}\n\t\t}\n\t);\n}\n\nfunction _setFolders(cb = Function.prototype) {\n\t_setValue(\"appFolders.folders\", data.folders, (err: StandardError) => {\n\t\tif (err) {\n\t\t\tFSBL.Clients.Logger.error(`Advanced App Launcher: Failed to set folders: ${err}`);\n\t\t\treturn;\n\t\t}\n\n\t\tcb();\n\t});\n}\n\nfunction _findAppIndexInFolders(appID: string, folderName: string) {\n\treturn findIndex(data.folders[folderName].apps, (app) => app.appID === appID);\n}\n\nfunction getFolders() {\n\treturn data.folders;\n}\n\nfunction getFoldersList() {\n\treturn data.foldersList;\n}\n\nfunction getAllApps() {\n\treturn Object.assign({}, data.apps, data.configComponents);\n}\n\nfunction getFormStatus() {\n\treturn data.isFormVisible;\n}\n\nfunction getSingleFolder(folderName: string) {\n\treturn data.folders[folderName];\n}\n\nfunction reorderFolders(destIndex: number, srcIndex: number) {\n\t// There are two types of folders: Those that can be arranged, and those that cannot. We don't want to reorder the folders relative to the unorderable folders. Split them out, and then combine them after doing the filtering/swapping.\n\tconst dragDisabled = getDragDisabled();\n\tconst unorderableFolders = data.foldersList.filter((folderName) => dragDisabled.includes(folderName));\n\tconst orderableFolders = data.foldersList.filter((folderName) => !dragDisabled.includes(folderName));\n\tconst movedFolder = orderableFolders[destIndex];\n\tconst remainingItems = orderableFolders.filter((item, index) => index !== destIndex);\n\tdata.foldersList = [\n\t\t...unorderableFolders,\n\t\t...remainingItems.slice(0, srcIndex),\n\t\tmovedFolder,\n\t\t...remainingItems.slice(srcIndex),\n\t];\n\t_setValue(\"appFolders.list\", data.foldersList, () => {});\n\treturn data.foldersList;\n}\n\nfunction addApp(app = <AppsType>{}, cb: any) {\n\tconst appID = `${new Date().getTime()}`;\n\tconst folder = data.activeFolder;\n\tconst newAppData = {\n\t\tappID,\n\t\ttags: app.tags,\n\t\tname: app.name,\n\t\turl: app.url,\n\t\ttype: \"component\",\n\t\tcanDelete: true,\n\t};\n\n\t/**\n\t * Note, the advanced app launcher can currently only keep track of apps that\n\t * are added by itself. Apps added by the basic launcher, or any other means,\n\t * will not be detected. A reconciliation process would need to be added that\n\t * listens on the distributed store similar to how the basic app launcher works.\n\t *\n\t * FSBL.Clients.RouterClient.subscribe(\"Launcher.update\", (err, response) => {\n\t\t\tFSBL.Clients.Logger.debug(\"list updated\", err, response);\n\t\t\tif (err) {\n\t\t\t\treturn console.error(err);\n\t\t\t}\n\t\t\tself.filterComponents(response.data.componentList);\n\t\t});\n\t */\n\tFSBL.Clients.LauncherClient.addUserDefinedComponent(newAppData, (compAddErr) => {\n\t\tif (compAddErr) {\n\t\t\tcb({ code: \"failed_to_add_app\", message: compAddErr });\n\t\t\tconsole.warn(\"Failed to add new app:\", compAddErr);\n\t\t\treturn;\n\t\t}\n\t\tdata.apps[appID] = newAppData;\n\n\t\t// Add to ADVANCED_APP_LAUNCHER folder\n\t\tdata.folders[ADVANCED_APP_LAUNCHER].apps.push(newAppData);\n\n\t\t// Check if we need to add to another folder as well\n\t\tif (folder !== ADVANCED_APP_LAUNCHER) {\n\t\t\tdata.folders[folder].apps.push(newAppData);\n\t\t}\n\t\t// Save appDefinitions and then folders\n\t\t_setValue(\"appDefinitions\", data.apps, () => {\n\t\t\t_setFolders();\n\t\t\tcb && cb();\n\t\t});\n\t});\n}\n\nfunction deleteApp(appID: string) {\n\t// Delete app from any folder that has it\n\tfor (const key in data.folders) {\n\t\tconst appIndex = _findAppIndexInFolders(appID, key);\n\t\tdata.folders[key].apps.splice(appIndex, 1);\n\t}\n\n\t// Delete app from the apps list\n\tFSBL.Clients.LauncherClient.removeUserDefinedComponent(data.apps[appID], () => {\n\t\tdelete data.apps[appID];\n\t\t// Save appDefinitions and then folders\n\t\t_setValue(\"appDefinitions\", data.apps, () => {\n\t\t\t_setFolders();\n\t\t});\n\t});\n}\n\nfunction addNewFolder(name?: string) {\n\t// Each new folder is given a number, lets store them here\n\t// to get the highest one and then increment\n\t// result of this will be [0, 1, 2] etc\n\tconst newFoldersNums = [\n\t\t0,\n\t\t// Find folders that have a name of \"New folder\" or \"New folder #\"\n\t\t...data.foldersList\n\t\t\t.filter((folder) => folder.startsWith(NEW_FOLDER_NAME))\n\t\t\t.map((folder) => {\n\t\t\t\tconst numbers: any[] = folder.match(/\\d+/g) || [];\n\t\t\t\treturn Math.max(...numbers);\n\t\t\t}),\n\t];\n\tconst highestFolderNumber = Math.max(...newFoldersNums);\n\tconst folderName: string = name ?? `${NEW_FOLDER_NAME} ${highestFolderNumber + 1}`;\n\tconst newFolder = {\n\t\tdisableUserRemove: true,\n\t\ticon: \"ff-adp-hamburger\",\n\t\tcanEdit: true,\n\t\tcanDelete: true,\n\t\tapps: [],\n\t};\n\tdata.folders[folderName] = newFolder;\n\t_setFolders(() => {\n\t\t// Update folders order if adding was successful\n\t\tdata.foldersList.push(folderName);\n\t\t_setValue(\"appFolders.list\", data.foldersList, () => {});\n\t});\n}\n\nfunction deleteFolder(folderName: string) {\n\t// Check if user is trying to delete the active folder\n\tif (folderName === data.activeFolder) {\n\t\tdata.activeFolder = ADVANCED_APP_LAUNCHER;\n\t\t_setValue(\"activeFolder\", data.activeFolder, () => {});\n\t}\n\n\tdelete data.folders[folderName] &&\n\t\t_setFolders(() => {\n\t\t\t// Update the order of folders\n\t\t\tconst index = data.foldersList.indexOf(folderName);\n\t\t\tdata.foldersList.splice(index, 1);\n\t\t\t_setValue(\"appFolders.list\", data.foldersList, () => {});\n\t\t});\n}\n\nfunction renameFolder(oldName: string, newName: string) {\n\tlet indexOfOld = data.foldersList.findIndex((folderName) => folderName === oldName);\n\n\tif (indexOfOld > -1) {\n\t\tlet oldFolder = data.folders[oldName];\n\t\tdata.folders[newName] = oldFolder;\n\t\tdata.foldersList.splice(indexOfOld, 1, newName);\n\n\t\t_setFolders(() => {\n\t\t\t_setValue(\"appFolders.list\", data.foldersList, () => {});\n\n\t\t\tif (data.activeFolder === oldName) {\n\t\t\t\t_setValue(\"activeFolder\", newName, () => {});\n\t\t\t}\n\n\t\t\tdelete data.folders[oldName];\n\t\t});\n\t}\n}\n\nfunction addAppToFolder(folderName: string, app: FolderAppType) {\n\tconst appIndex = _findAppIndexInFolders(app.appID, folderName);\n\n\tif (appIndex < 0) {\n\t\tdata.folders[folderName].apps.push({\n\t\t\tname: app.name,\n\t\t\tdisplayName: app.displayName,\n\t\t\tappID: app.appID,\n\t\t});\n\t\t_setFolders();\n\t}\n}\n\nfunction removeAppFromFolder(folderName: string, app: FolderAppType) {\n\tconst appIndex = _findAppIndexInFolders(app.appID, folderName);\n\tdata.folders[folderName].apps.splice(appIndex, 1);\n\t_setFolders();\n}\n\nfunction getAllAppsFromFolder(folderName: string) {\n\treturn data.folders[folderName].apps;\n}\n\n/**\n * Given a field, search through FDC3 apps and apps pulled in via config and return that app.\n * */\nfunction findAppByField(field: keyof AppsType | keyof ConfigType, value: any) {\n\treturn (\n\t\tObject.values(data.apps).find((app) => (app ? (app as any)[field] === value : false)) ||\n\t\tObject.values(data.configComponents).find((app) => (app ? (app as any)[field] === value : false))\n\t);\n}\n\nfunction getActiveFolder() {\n\tconst folder = data.folders[data.activeFolder];\n\n\tif (!folder) {\n\t\tFSBL.Clients.Logger.error(`activeFolder:\"${data.activeFolder}\" not found! Defaulting to empty folder`);\n\t\treturn {\n\t\t\tname: data.activeFolder,\n\t\t\tapps: [],\n\t\t};\n\t}\n\n\tObject.values(folder.apps).forEach((app) => {\n\t\tconst appData = findAppByField(\"appID\", app.appID);\n\t\tif (!appData) {\n\t\t\tapp.tags = [];\n\t\t} else {\n\t\t\tapp.tags = appData.tags;\n\t\t}\n\t});\n\t// Need a name for the AppDefinition/AppActionsMenu rendering\n\tfolder.name = data.activeFolder;\n\treturn folder;\n}\n\nfunction getActiveFolderName() {\n\treturn data.activeFolder;\n}\n\nfunction getSearchText() {\n\treturn data.filterText;\n}\n\nfunction getSortBy() {\n\treturn data.sortBy;\n}\n\nfunction getTags() {\n\treturn data.tags;\n}\n\nfunction getAllAppsTags() {\n\tlet tags: any[] = [];\n\t// Pull tags from applications installed via FDC3 and the component config.\n\tconst apps = Object.values(data.apps).concat(Object.values(data.configComponents) as any);\n\n\tapps.forEach((app) => {\n\t\ttags = tags.concat(app.tags);\n\t});\n\t// return unique ones only\n\treturn tags.filter((tag, index) => tags.indexOf(tag) === index);\n}\n\nfunction addTag(tag: string) {\n\t// Push new tag to list\n\tdata.tags.indexOf(tag) < 0 && data.tags.push(tag);\n\t// Update tags in store\n\t_setValue(\"activeLauncherTags\", data.tags, () => {});\n}\n\nfunction deleteTag(tag: string) {\n\t// Push new tag to list\n\tdata.tags.splice(data.tags.indexOf(tag), 1);\n\t// Update tags in store\n\t_setValue(\"activeLauncherTags\", data.tags, () => {});\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StoreActions.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/advancedAppLauncher/stores/StoreActions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,MAAM,yBAAyB,CAAC;AACnD,OAAO,IAAI,MA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,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,SAAS,CAAC,GAAW;IAE7B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5C,SAAS,CAAC,oBAAoB,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AACtD,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-use-before-define */\nimport { findIndex } from \"lodash\";\nimport { getStore } from \"./LauncherStore\";\nimport AppDirectory from \"../modules/AppDirectory\";\nimport FDC3 from \"../modules/FDC3\";\nimport { iconFromConfig } from \"../../../icon/Icon\";\nimport { FoldersType, FolderAppType } from \"../../../../types/advancedAppLauncherTypes\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport sortFunctions from \"../utils/sort-functions\";\nconst async = require(\"async\");\nlet FDC3Client: FDC3;\nlet appd: any;\nlet appDEndpoint: any;\n\ntype ComponentDescriptor = Record<string, any>;\ntype ComponentList = Record<string, ComponentDescriptor>;\n\ntype AppsType = {\n\tappID: string;\n\ttags: string[];\n\tname: string;\n\turl: string;\n\ttype: string;\n\tcanDelete: boolean;\n\tdisplayName?: string;\n};\ntype ConfigType = {\n\tappID: string;\n\ticon: any;\n\tname: string;\n\tdisplayName: string;\n\tsource: string;\n\ttags: string[];\n};\ntype DataType = {\n\tfolders: FoldersType[\"folders\"];\n\tfoldersList: FoldersType[\"list\"];\n\tapps: {\n\t\t[field: string]: AppsType;\n\t};\n\ttags: string[];\n\tactiveFolder: string;\n\tfilterText: string;\n\tsortBy: keyof typeof sortFunctions;\n\tisFormVisible: boolean;\n\tconfigComponents: {\n\t\t[field: string]: ConfigType;\n\t};\n};\n\nexport default {\n\tinitialize,\n\taddApp,\n\taddNewFolder,\n\taddAppToFolder,\n\tremoveAppFromFolder,\n\trenameFolder,\n\tdeleteFolder,\n\tdeleteApp,\n\tdeleteTag,\n\treorderFolders,\n\tgetFolders,\n\tgetFoldersList,\n\tgetActiveFolderName,\n\tgetActiveFolder,\n\tgetSingleFolder,\n\tgetAllAppsTags,\n\tgetAllApps,\n\tgetAllAppsFromFolder,\n\tgetFormStatus,\n\tgetSearchText,\n\tgetSortBy,\n\taddTag,\n\tgetTags,\n\tgetApp,\n\tgetDragDisabled,\n\tgetConstants,\n\tfindAppByField,\n\tgetApps,\n\trefreshAppDefinitions,\n};\n\nlet data = <DataType>{};\nconst ADVANCED_APP_LAUNCHER = \"Advanced App Launcher\";\nconst NEW_FOLDER_NAME = \"New folder\";\n// returns names of default folders.\nfunction getConstants() {\n\tconst DASHBOARDS = \"Dashboards\";\n\tconst FAVORITES = \"Favorites\";\n\treturn { ADVANCED_APP_LAUNCHER, DASHBOARDS, FAVORITES };\n}\n\n// Add to here if you want to disable dragging on a folder.\nfunction getDragDisabled() {\n\tconst { DASHBOARDS, FAVORITES } = getConstants();\n\treturn [ADVANCED_APP_LAUNCHER, DASHBOARDS, FAVORITES];\n}\n\nfunction initialize(callback = Function.prototype) {\n\tFSBL.Clients.ConfigClient.getValue({ field: \"finsemble.appDirectoryEndpoint\" }, (_, appDirectoryEndpoint) => {\n\t\t// cache value globally to be used in the event that we need to fetch data for a given component.\n\t\tappDEndpoint = appDirectoryEndpoint;\n\t\tconst store = getStore();\n\t\tdata.folders = store?.values.appFolders.folders;\n\t\tdata.foldersList = store?.values.appFolders.list;\n\t\tvalidateFolderDataStructure();\n\t\tdata.apps = store?.values.appDefinitions;\n\t\tdata.tags = store?.values.activeLauncherTags;\n\t\tdata.activeFolder = store?.values.activeFolder;\n\t\tdata.filterText = store?.values.filterText;\n\t\tdata.sortBy = store?.values.sortBy;\n\t\tdata.isFormVisible = store?.values.isFormVisible;\n\t\tdata.configComponents = {};\n\n\t\t// Add listeners to keep our copy up to date\n\t\tstore?.addListener({ field: \"appFolders.folders\" }, (foldersErr, dt) => {\n\t\t\tdata.folders = dt.value;\n\t\t});\n\t\tstore?.addListener({ field: \"appFolders.list\" }, (folderListErr, dt) => (data.foldersList = dt.value));\n\t\tstore?.addListener({ field: \"appDefinitions\" }, (appDefinitionsErr, dt) => (data.apps = dt.value));\n\t\tstore?.addListener({ field: \"activeFolder\" }, (activeFolderErr, dt) => {\n\t\t\tdata.activeFolder = dt.value;\n\t\t});\n\t\tstore?.addListener({ field: \"isFormVisible\" }, (visibilityErr, dt) => (data.isFormVisible = dt.value));\n\t\tstore?.addListener({ field: \"sortBy\" }, (sortErr, dt) => (data.sortBy = dt.value));\n\t\tstore?.addListener({ field: \"activeLauncherTags\" }, (launcherTagsErr, dt) => (data.tags = dt.value));\n\t\tstore?.addListener({ field: \"filterText\" }, (filterTextErr, dt) => (data.filterText = dt.value));\n\n\t\tFSBL.Clients.RouterClient.subscribe(\"Launcher.update\", (err, response) => {\n\t\t\tFSBL.Clients.Logger.debug(\"list updated\", err, response);\n\t\t\tif (err) {\n\t\t\t\treturn console.error(err);\n\t\t\t}\n\t\t\trefreshAppDefinitions(response.data.componentList);\n\t\t});\n\n\t\t// @deprecate in favor of SystemManagerClient.waitForStartup()\n\t\tFSBL.Clients.RouterClient.subscribe(\"Finsemble.Service.State.launcherService\", (unsubscribeErr) => {\n\t\t\tif (unsubscribeErr) {\n\t\t\t\tFSBL.Clients.Logger.error(\n\t\t\t\t\t\"App Launcher encountered an error unsubscribing from the launcher service\",\n\t\t\t\t\tunsubscribeErr\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tloadInstalledComponentsFromStore(() => {\n\t\t\t\t// We load our stored components(config driven) here\n\t\t\t\tloadInstalledConfigComponents(() => {\n\t\t\t\t\tupdateAppsInFolders(callback);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}\n\n// This gets a specific app in FDC3 and returns the results\nfunction getApp(appID: string, cb = Function.prototype) {\n\tappd\n\t\t.get(appID)\n\t\t.then((app: any) => cb(null, app))\n\t\t.catch((err: StandardError) => cb(err));\n}\n/**\n * Ensures all 'apps' properties on folders conform\n * to the new structure (Array vs object)\n */\nfunction validateFolderDataStructure() {\n\tObject.keys(data.folders).forEach((folderName) => {\n\t\tconst folder = data.folders[folderName];\n\t\tif (!Array.isArray(folder.apps)) {\n\t\t\tconst warning =\n\t\t\t\t\"Application Launcher Persistent Store has data stored in deprecated format. Please check distributedStore configs\";\n\t\t\t// If the structure is wrong, notify the user in hopes that the foundation will be fixed\n\t\t\tFSBL.Clients.Logger.warn(warning);\n\t\t\tFSBL.UserNotification.alert(\"system\", \"ONCE-SINCE-STARTUP\", \"Distributed Store Type Mismatch\", warning);\n\t\t\tlet newApps: FolderAppType[] = [];\n\t\t\tObject.values(folder.apps).forEach((app: any) => {\n\t\t\t\tnewApps.push(app);\n\t\t\t});\n\t\t\tfolder.apps = newApps;\n\t\t}\n\t});\n\t_setFolders();\n}\n\n// Update apps in folders with updated config information\nfunction updateAppsInFolders(cb = Function.prototype) {\n\t// Loop through folders and update apps with new info\n\tconst { ADVANCED_APP_LAUNCHER: advancedAppLauncherFolderName } = getConstants();\n\tObject.keys(data.folders).forEach((folderName) => {\n\t\tif (folderName === advancedAppLauncherFolderName) return;\n\t\telse {\n\t\t\tconst folder = data.folders[folderName];\n\t\t\tObject.values(data.configComponents).forEach((configComp) => {\n\t\t\t\tlet index = -1;\n\t\t\t\tfolder.apps.forEach((folderApp, i) => {\n\t\t\t\t\tif (folderApp.appID.toString().trim() === configComp.appID.toString().trim()) {\n\t\t\t\t\t\tindex = i;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (index > -1) {\n\t\t\t\t\tdata.folders[folderName].apps.splice(index, 1, configComp);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n\t_setFolders(cb);\n}\n\n/**\n * Given a component config, will return tags, or an empty array.\n *\n * @param {*} componentConfig\n * @returns\n */\nfunction extractTagsFromFinsembleComponentConfig(componentConfig: ComponentDescriptor) {\n\tif (!componentConfig.foreign) return [];\n\tif (!componentConfig.foreign.components) return [];\n\tif (!componentConfig.foreign.components[\"App Launcher\"]) return [];\n\n\tconst { tags } = componentConfig.foreign.components[\"App Launcher\"];\n\n\tif (tags) {\n\t\tif (typeof tags === \"string\") {\n\t\t\treturn [tags];\n\t\t}\n\t\treturn tags;\n\t}\n\n\treturn [];\n}\n/**\n * Instantiates classes needed to interact with the appD server.\n * Only done when needed. If there are no components with source 'FDC3', this code will not execute.\n */\nfunction lazyLoadAppD() {\n\tif (!FDC3Client) FDC3Client = new FDC3({ url: appDEndpoint });\n\tif (!appd) appd = new AppDirectory(FDC3Client) as FDC3;\n}\n\n/**\n * Here we load apps from FDC3\n * @param {*} cb\n */\nfunction loadInstalledComponentsFromStore(cb = Function.prototype) {\n\tasync.map(\n\t\tObject.values(data.apps),\n\t\t(component: any, componentDone: any) => {\n\t\t\t// Load FDC3 components here\n\t\t\tif (component.source && component.source === \"FDC3\") {\n\t\t\t\tlazyLoadAppD();\n\t\t\t\t// get the app info so we can load it into the launcher\n\t\t\t\treturn getApp(component.appID, (err: StandardError) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\t// don't want to kill this;\n\t\t\t\t\t\tdeleteApp(component.appID);\n\t\t\t\t\t\tconsole.error(\"there was an error loading from FDC3\", component, err);\n\t\t\t\t\t}\n\t\t\t\t\treturn componentDone();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Assumption - component is always a user defined component\n\t\t\t// when testing I was never able to get any other component types in this method\n\t\t\tFSBL.Clients.LauncherClient.addUserDefinedComponent(component, (compAddErr) => {\n\t\t\t\tif (compAddErr) {\n\t\t\t\t\tconsole.warn(\"Failed to add new app:\", compAddErr);\n\t\t\t\t}\n\t\t\t\tcomponentDone(compAddErr);\n\t\t\t});\n\t\t},\n\t\t(err: StandardError) => {\n\t\t\tcb(err);\n\t\t}\n\t);\n}\n\n// We load our apps that were loaded from the config.\nfunction loadInstalledConfigComponents(cb = Function.prototype) {\n\t// Get the list of components from the launcher service\n\tFSBL.Clients.LauncherClient.getComponentList((err, componentList) => {\n\t\t/*\n\t\t * Update the folders under the \"App\" menu and delete any apps in the folder\n\t\t * that are no longer in the config and are not user defined components.\n\t\t */\n\t\trefreshAppDefinitions(componentList || {});\n\t\tcb();\n\t});\n}\n\nfunction getApps() {\n\treturn data.apps;\n}\n\nfunction refreshAppDefinitions(componentList: ComponentList) {\n\tconst componentTypeList = Object.keys(componentList);\n\n\tconst { folders } = data;\n\t// Get the user defined apps\n\tconst apps = Object.keys(data.apps);\n\tObject.keys(folders).forEach((folderName) => {\n\t\tfolders[folderName].apps.forEach((configDefinedApp, i) => {\n\t\t\tconst { name, appID } = configDefinedApp;\n\t\t\t// If the component is not in the config component list and is not a user defined component\n\t\t\tif (!componentTypeList.includes(name) && !apps.includes(appID)) {\n\t\t\t\t// Delete app from the folder\n\t\t\t\tfolders[folderName].apps.splice(i, 1);\n\t\t\t}\n\t\t});\n\t});\n\n\tcomponentTypeList.forEach((componentType) => {\n\t\tconst component = componentList?.[componentType];\n\t\tif (component && component.component) {\n\t\t\tconst launchableByUser = component?.foreign?.components?.[\"App Launcher\"]?.launchableByUser;\n\n\t\t\tconst displayName = component.component.displayName ?? componentType;\n\t\t\tconst iconObject = iconFromConfig(component?.foreign?.components?.Toolbar, displayName, component?.appDConfig);\n\t\t\t// Make sure the app is launchable by user\n\t\t\tif (launchableByUser && !component.component.isUserDefined) {\n\t\t\t\tdata.configComponents[componentType] = {\n\t\t\t\t\tappID: componentType,\n\t\t\t\t\ticon: iconObject,\n\t\t\t\t\tname: componentType,\n\t\t\t\t\tdisplayName,\n\t\t\t\t\tsource: \"config\",\n\t\t\t\t\ttags: extractTagsFromFinsembleComponentConfig(component),\n\t\t\t\t};\n\t\t\t} else if (!launchableByUser && data.configComponents[componentType]) {\n\t\t\t\tdelete data.configComponents[componentType];\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction _setValue(field: string, value: any, cb: any) {\n\tgetStore()?.setValue(\n\t\t{\n\t\t\tfield: field,\n\t\t\tvalue: value,\n\t\t},\n\t\t(error) => {\n\t\t\tif (error) {\n\t\t\t\tFSBL.Clients.Logger.error(`Advanced App Launcher: Failed to save: ${field}:${value}`);\n\t\t\t} else {\n\t\t\t\tcb && cb();\n\t\t\t}\n\t\t}\n\t);\n}\n\nfunction _setFolders(cb = Function.prototype) {\n\t_setValue(\"appFolders.folders\", data.folders, (err: StandardError) => {\n\t\tif (err) {\n\t\t\tFSBL.Clients.Logger.error(`Advanced App Launcher: Failed to set folders: ${err}`);\n\t\t\treturn;\n\t\t}\n\n\t\tcb();\n\t});\n}\n\nfunction _findAppIndexInFolders(appID: string, folderName: string) {\n\treturn findIndex(data.folders[folderName].apps, (app) => app.appID === appID);\n}\n\nfunction getFolders() {\n\treturn data.folders;\n}\n\nfunction getFoldersList() {\n\treturn data.foldersList;\n}\n\nfunction getAllApps() {\n\treturn Object.assign({}, data.apps, data.configComponents);\n}\n\nfunction getFormStatus() {\n\treturn data.isFormVisible;\n}\n\nfunction getSingleFolder(folderName: string) {\n\treturn data.folders[folderName];\n}\n\nfunction reorderFolders(destIndex: number, srcIndex: number) {\n\t// There are two types of folders: Those that can be arranged, and those that cannot. We don't want to reorder the folders relative to the unorderable folders. Split them out, and then combine them after doing the filtering/swapping.\n\tconst dragDisabled = getDragDisabled();\n\tconst unorderableFolders = data.foldersList.filter((folderName) => dragDisabled.includes(folderName));\n\tconst orderableFolders = data.foldersList.filter((folderName) => !dragDisabled.includes(folderName));\n\tconst movedFolder = orderableFolders[destIndex];\n\tconst remainingItems = orderableFolders.filter((item, index) => index !== destIndex);\n\tdata.foldersList = [\n\t\t...unorderableFolders,\n\t\t...remainingItems.slice(0, srcIndex),\n\t\tmovedFolder,\n\t\t...remainingItems.slice(srcIndex),\n\t];\n\t_setValue(\"appFolders.list\", data.foldersList, () => {});\n\treturn data.foldersList;\n}\n\nfunction addApp(app = <AppsType>{}, cb: any) {\n\tconst appID = `${new Date().getTime()}`;\n\tconst folder = data.activeFolder;\n\tconst newAppData = {\n\t\tappID,\n\t\ttags: app.tags,\n\t\tname: app.name,\n\t\turl: app.url,\n\t\ttype: \"component\",\n\t\tcanDelete: true,\n\t};\n\n\t/**\n\t * Note, the advanced app launcher can currently only keep track of apps that\n\t * are added by itself. Apps added by the basic launcher, or any other means,\n\t * will not be detected. A reconciliation process would need to be added that\n\t * listens on the distributed store similar to how the basic app launcher works.\n\t *\n\t * FSBL.Clients.RouterClient.subscribe(\"Launcher.update\", (err, response) => {\n\t\t\tFSBL.Clients.Logger.debug(\"list updated\", err, response);\n\t\t\tif (err) {\n\t\t\t\treturn console.error(err);\n\t\t\t}\n\t\t\tself.filterComponents(response.data.componentList);\n\t\t});\n\t */\n\tFSBL.Clients.LauncherClient.addUserDefinedComponent(newAppData, (compAddErr) => {\n\t\tif (compAddErr) {\n\t\t\tcb({ code: \"failed_to_add_app\", message: compAddErr });\n\t\t\tconsole.warn(\"Failed to add new app:\", compAddErr);\n\t\t\treturn;\n\t\t}\n\t\tdata.apps[appID] = newAppData;\n\n\t\t// Add to ADVANCED_APP_LAUNCHER folder\n\t\tdata.folders[ADVANCED_APP_LAUNCHER].apps.push(newAppData);\n\n\t\t// Check if we need to add to another folder as well\n\t\tif (folder !== ADVANCED_APP_LAUNCHER) {\n\t\t\tdata.folders[folder].apps.push(newAppData);\n\t\t}\n\t\t// Save appDefinitions and then folders\n\t\t_setValue(\"appDefinitions\", data.apps, () => {\n\t\t\t_setFolders();\n\t\t\tcb && cb();\n\t\t});\n\t});\n}\n\nfunction deleteApp(appID: string) {\n\t// Delete app from any folder that has it\n\tfor (const key in data.folders) {\n\t\tconst appIndex = _findAppIndexInFolders(appID, key);\n\t\tdata.folders[key].apps.splice(appIndex, 1);\n\t}\n\n\t// Delete app from the apps list\n\tFSBL.Clients.LauncherClient.removeUserDefinedComponent(data.apps[appID], () => {\n\t\tdelete data.apps[appID];\n\t\t// Save appDefinitions and then folders\n\t\t_setValue(\"appDefinitions\", data.apps, () => {\n\t\t\t_setFolders();\n\t\t});\n\t});\n}\n\nfunction addNewFolder(name?: string) {\n\t// Each new folder is given a number, lets store them here\n\t// to get the highest one and then increment\n\t// result of this will be [0, 1, 2] etc\n\tconst newFoldersNums = [\n\t\t0,\n\t\t// Find folders that have a name of \"New folder\" or \"New folder #\"\n\t\t...data.foldersList\n\t\t\t.filter((folder) => folder.startsWith(NEW_FOLDER_NAME))\n\t\t\t.map((folder) => {\n\t\t\t\tconst numbers: any[] = folder.match(/\\d+/g) || [];\n\t\t\t\treturn Math.max(...numbers);\n\t\t\t}),\n\t];\n\tconst highestFolderNumber = Math.max(...newFoldersNums);\n\tconst folderName: string = name ?? `${NEW_FOLDER_NAME} ${highestFolderNumber + 1}`;\n\tconst newFolder = {\n\t\tdisableUserRemove: true,\n\t\ticon: \"ff-adp-hamburger\",\n\t\tcanEdit: true,\n\t\tcanDelete: true,\n\t\tapps: [],\n\t};\n\tdata.folders[folderName] = newFolder;\n\t_setFolders(() => {\n\t\t// Update folders order if adding was successful\n\t\tdata.foldersList.push(folderName);\n\t\t_setValue(\"appFolders.list\", data.foldersList, () => {});\n\t});\n}\n\nfunction deleteFolder(folderName: string) {\n\t// Check if user is trying to delete the active folder\n\tif (folderName === data.activeFolder) {\n\t\tdata.activeFolder = ADVANCED_APP_LAUNCHER;\n\t\t_setValue(\"activeFolder\", data.activeFolder, () => {});\n\t}\n\n\tdelete data.folders[folderName] &&\n\t\t_setFolders(() => {\n\t\t\t// Update the order of folders\n\t\t\tconst index = data.foldersList.indexOf(folderName);\n\t\t\tdata.foldersList.splice(index, 1);\n\t\t\t_setValue(\"appFolders.list\", data.foldersList, () => {});\n\t\t});\n}\n\nfunction renameFolder(oldName: string, newName: string) {\n\tlet indexOfOld = data.foldersList.findIndex((folderName) => folderName === oldName);\n\n\tif (indexOfOld > -1) {\n\t\tlet oldFolder = data.folders[oldName];\n\t\tdata.folders[newName] = oldFolder;\n\t\tdata.foldersList.splice(indexOfOld, 1, newName);\n\n\t\t_setFolders(() => {\n\t\t\t_setValue(\"appFolders.list\", data.foldersList, () => {});\n\n\t\t\tif (data.activeFolder === oldName) {\n\t\t\t\t_setValue(\"activeFolder\", newName, () => {});\n\t\t\t}\n\n\t\t\tdelete data.folders[oldName];\n\t\t});\n\t}\n}\n\nfunction addAppToFolder(folderName: string, app: FolderAppType) {\n\tconst appIndex = _findAppIndexInFolders(app.appID, folderName);\n\n\tif (appIndex < 0) {\n\t\tdata.folders[folderName].apps.push({\n\t\t\tname: app.name,\n\t\t\tdisplayName: app.displayName,\n\t\t\tappID: app.appID,\n\t\t});\n\t\t_setFolders();\n\t}\n}\n\nfunction removeAppFromFolder(folderName: string, app: FolderAppType) {\n\tconst appIndex = _findAppIndexInFolders(app.appID, folderName);\n\tdata.folders[folderName].apps.splice(appIndex, 1);\n\t_setFolders();\n}\n\nfunction getAllAppsFromFolder(folderName: string) {\n\treturn data.folders[folderName].apps;\n}\n\n/**\n * Given a field, search through FDC3 apps and apps pulled in via config and return that app.\n * */\nfunction findAppByField(field: keyof AppsType | keyof ConfigType, value: any) {\n\treturn (\n\t\tObject.values(data.apps).find((app) => (app ? (app as any)[field] === value : false)) ||\n\t\tObject.values(data.configComponents).find((app) => (app ? (app as any)[field] === value : false))\n\t);\n}\n\nfunction getActiveFolder() {\n\tconst folder = data.folders[data.activeFolder];\n\n\tif (!folder) {\n\t\tFSBL.Clients.Logger.error(`activeFolder:\"${data.activeFolder}\" not found! Defaulting to empty folder`);\n\t\treturn {\n\t\t\tname: data.activeFolder,\n\t\t\tapps: [],\n\t\t};\n\t}\n\n\tObject.values(folder.apps).forEach((app) => {\n\t\tconst appData = findAppByField(\"appID\", app.appID);\n\t\tif (!appData) {\n\t\t\tapp.tags = [];\n\t\t} else {\n\t\t\tapp.tags = appData.tags;\n\t\t}\n\t});\n\t// Need a name for the AppDefinition/AppActionsMenu rendering\n\tfolder.name = data.activeFolder;\n\treturn folder;\n}\n\nfunction getActiveFolderName() {\n\treturn data.activeFolder;\n}\n\nfunction getSearchText() {\n\treturn data.filterText;\n}\n\nfunction getSortBy() {\n\treturn data.sortBy;\n}\n\nfunction getTags() {\n\treturn data.tags;\n}\n\nfunction getAllAppsTags() {\n\tlet tags: any[] = [];\n\t// Pull tags from applications installed via FDC3 and the component config.\n\tconst apps = Object.values(data.apps).concat(Object.values(data.configComponents) as any);\n\n\tapps.forEach((app) => {\n\t\ttags = tags.concat(app.tags);\n\t});\n\t// return unique ones only\n\treturn tags.filter((tag, index) => tags.indexOf(tag) === index);\n}\n\nfunction addTag(tag: string) {\n\t// Push new tag to list\n\tdata.tags.indexOf(tag) < 0 && data.tags.push(tag);\n\t// Update tags in store\n\t_setValue(\"activeLauncherTags\", data.tags, () => {});\n}\n\nfunction deleteTag(tag: string) {\n\t// Push new tag to list\n\tdata.tags.splice(data.tags.indexOf(tag), 1);\n\t// Update tags in store\n\t_setValue(\"activeLauncherTags\", data.tags, () => {});\n}\n"]}
|