@finsemble/finsemble-ui 6.1.3 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +20 -17
- package/react/actions/smartDesktopDesignerActions.d.ts +5 -4
- package/react/actions/smartDesktopDesignerActions.js.map +1 -1
- package/react/assets/css/defaultTheme.css +1 -1
- package/react/assets/css/notificationsCenter.css +1 -0
- package/react/assets/css/userPreferences.css +4 -2
- package/react/assets/css/windowTitleBar.css +1 -0
- package/react/assets/icons/check-square.svg +6 -0
- package/react/assets/icons/lock.svg +6 -0
- package/react/components/common/Button.d.ts +1 -0
- package/react/components/common/Button.js +2 -2
- package/react/components/common/Button.js.map +1 -1
- package/react/components/common/ButtonRow.d.ts +15 -0
- package/react/components/common/ButtonRow.js +32 -0
- package/react/components/common/ButtonRow.js.map +1 -0
- package/react/components/common/Checkbox.d.ts +8 -0
- package/react/components/common/Checkbox.js +22 -0
- package/react/components/common/Checkbox.js.map +1 -0
- package/react/components/common/FinsembleIcon.d.ts +1 -1
- package/react/components/common/FinsembleIcon.js +4 -0
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleSelect.d.ts +3 -2
- package/react/components/common/FinsembleSelect.js +2 -2
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/Tooltip.d.ts +4 -3
- package/react/components/common/Tooltip.js +3 -3
- package/react/components/common/Tooltip.js.map +1 -1
- package/react/components/common/css/tooltip.css +10 -0
- package/react/components/common/helpers.js +12 -0
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/ButtonRow.stories.d.ts +14 -0
- package/react/components/common/stories/ButtonRow.stories.js +39 -0
- package/react/components/common/stories/ButtonRow.stories.js.map +1 -0
- package/react/components/common/stories/Checkbox.stories.d.ts +13 -0
- package/react/components/common/stories/Checkbox.stories.js +29 -0
- package/react/components/common/stories/Checkbox.stories.js.map +1 -0
- package/react/components/common/stories/DropdownButton.stories.d.ts +22 -0
- package/react/components/common/stories/DropdownButton.stories.js +29 -0
- package/react/components/common/stories/DropdownButton.stories.js.map +1 -0
- package/react/components/common/stories/FinsembleIcon.stories.js +2 -0
- package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleSelect.stories.d.ts +1 -1
- package/react/components/common/stories/Tooltip.stories.d.ts +1 -1
- package/react/components/{shared/addProtocolToValidURL.spec.d.ts → common/tests/ButtonRow.spec.d.ts} +0 -0
- package/react/components/common/tests/ButtonRow.spec.js +25 -0
- package/react/components/common/tests/ButtonRow.spec.js.map +1 -0
- package/react/components/common/tests/Checkbox.spec.d.ts +1 -0
- package/react/components/common/tests/Checkbox.spec.js +33 -0
- package/react/components/common/tests/Checkbox.spec.js.map +1 -0
- package/react/components/fdc3Resolver/ResolverDialog.css +1 -0
- package/react/components/fdc3Resolver/ResolverDialog.js +4 -5
- package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.spec.js +1 -8
- package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.stories.js +45 -45
- package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerHeader.js +6 -6
- package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +32 -31
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +4 -6
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/views/ListView.js +1 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.js +3 -2
- package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
- package/react/components/notifications/constants.d.ts +13 -0
- package/react/components/notifications/constants.js.map +1 -1
- package/react/components/search/Highlight.js +13 -3
- package/react/components/search/Highlight.js.map +1 -1
- package/react/components/shared/DefaultDropdownButton.d.ts +1 -0
- package/react/components/shared/DefaultDropdownButton.js +14 -4
- package/react/components/shared/DefaultDropdownButton.js.map +1 -1
- package/react/components/shared/tests/DefaultDropdownButton.spec.d.ts +1 -0
- package/react/components/shared/tests/DefaultDropdownButton.spec.js +54 -0
- package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -0
- package/react/components/shared/tests/addProtocolToValidURL.spec.d.ts +1 -0
- package/react/components/shared/{addProtocolToValidURL.spec.js → tests/addProtocolToValidURL.spec.js} +1 -1
- package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -0
- package/react/components/smartDesktopDesigner/AppEditAccess.d.ts +15 -0
- package/react/components/smartDesktopDesigner/AppEditAccess.js +155 -0
- package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -0
- package/react/components/smartDesktopDesigner/AppEditPage.d.ts +7 -1
- package/react/components/smartDesktopDesigner/AppEditPage.js +5 -1
- package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
- package/react/components/smartDesktopDesigner/Application.d.ts +4 -1
- package/react/components/smartDesktopDesigner/Application.js +20 -10
- package/react/components/smartDesktopDesigner/Application.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +3 -0
- package/react/components/smartDesktopDesigner/ApplicationEdit.js +2 -2
- package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationList.js +11 -1
- package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationSetup.d.ts +6 -1
- package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +1 -1
- package/react/components/smartDesktopDesigner/Applications.d.ts +2 -0
- package/react/components/smartDesktopDesigner/Applications.js +2 -2
- package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/views.js +2 -0
- package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/css/applications.css +38 -0
- package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +18 -0
- package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +9 -0
- package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js +6 -2
- package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +71 -2
- package/react/components/smartDesktopDesigner/fixtures/apps.js +16 -5
- package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +1 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +20 -0
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Applications.stories.js +2 -1
- package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +1 -0
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Applications.spec.d.ts +1 -1
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js +84 -7
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.js +2 -3
- package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +23 -11
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/userPreferences/UserPreferences.js +8 -23
- package/react/components/userPreferences/UserPreferences.js.map +1 -1
- package/react/components/userPreferences/UserPreferencesBase.d.ts +3 -1
- package/react/components/userPreferences/UserPreferencesBase.js +5 -6
- package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
- package/react/components/userPreferences/UserPreferencesWrapper.d.ts +4 -0
- package/react/components/userPreferences/UserPreferencesWrapper.js +27 -0
- package/react/components/userPreferences/UserPreferencesWrapper.js.map +1 -0
- package/react/components/userPreferences/components/ContentSection.d.ts +18 -3
- package/react/components/userPreferences/components/ContentSection.js +4 -2
- package/react/components/userPreferences/components/ContentSection.js.map +1 -1
- package/react/components/userPreferences/components/LeftNav.d.ts +19 -4
- package/react/components/userPreferences/components/LeftNav.js +11 -10
- package/react/components/userPreferences/components/LeftNav.js.map +1 -1
- package/react/components/userPreferences/components/content/DashbarEditor.d.ts +20 -5
- package/react/components/userPreferences/components/content/DashbarEditor.js +11 -11
- package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
- package/react/components/userPreferences/components/content/DashbarEditorItem.d.ts +10 -0
- package/react/components/userPreferences/components/content/DashbarEditorItem.js +11 -0
- package/react/components/userPreferences/components/content/DashbarEditorItem.js.map +1 -0
- package/react/components/userPreferences/components/content/General.d.ts +10 -3
- package/react/components/userPreferences/components/content/General.js +2 -2
- package/react/components/userPreferences/components/content/General.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.js +39 -112
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +9 -11
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.d.ts +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js +9 -7
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.d.ts +3 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js +13 -12
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
- package/react/components/userPreferences/components/general/ScheduledRestart.d.ts +24 -7
- package/react/components/userPreferences/components/general/ScheduledRestart.js +71 -22
- package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.d.ts +9 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.js +5 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceComponents.d.ts +6 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js +8 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js.map +1 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.d.ts +45 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +82 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItemList.d.ts +8 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js +7 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js.map +1 -0
- package/react/components/userPreferences/index.d.ts +1 -1
- package/react/components/userPreferences/index.js +1 -1
- package/react/components/userPreferences/index.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +0 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.js +4 -9
- package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
- package/react/components/userPreferences/stories/DashbarEditor.stories.d.ts +2 -1
- package/react/components/userPreferences/stories/DashbarEditor.stories.js +35 -4
- package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
- package/react/components/userPreferences/stories/DashbarEditorItem.stories.d.ts +11 -0
- package/react/components/userPreferences/stories/DashbarEditorItem.stories.js +21 -0
- package/react/components/userPreferences/stories/DashbarEditorItem.stories.js.map +1 -0
- package/react/components/userPreferences/stories/General.stories.d.ts +9 -0
- package/react/components/userPreferences/stories/General.stories.js +16 -0
- package/react/components/userPreferences/stories/General.stories.js.map +1 -0
- package/react/components/userPreferences/stories/Notifications.stories.d.ts +9 -0
- package/react/components/userPreferences/stories/Notifications.stories.js +17 -0
- package/react/components/userPreferences/stories/Notifications.stories.js.map +1 -0
- package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.d.ts +9 -0
- package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js +20 -0
- package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js.map +1 -0
- package/react/components/userPreferences/stories/NotificationsSources.stories.d.ts +12 -0
- package/react/components/userPreferences/stories/NotificationsSources.stories.js +28 -0
- package/react/components/userPreferences/stories/NotificationsSources.stories.js.map +1 -0
- package/react/components/userPreferences/stories/UserPreferences.stories.d.ts +8 -0
- package/react/components/userPreferences/stories/UserPreferences.stories.js +53 -0
- package/react/components/userPreferences/stories/UserPreferences.stories.js.map +1 -0
- package/react/components/userPreferences/stories/WorkspaceButton.stories.d.ts +15 -0
- package/react/components/userPreferences/stories/WorkspaceButton.stories.js +13 -0
- package/react/components/userPreferences/stories/WorkspaceButton.stories.js.map +1 -0
- package/react/components/userPreferences/stories/WorkspaceComponents.stories.d.ts +13 -0
- package/react/components/userPreferences/stories/WorkspaceComponents.stories.js +26 -0
- package/react/components/userPreferences/stories/WorkspaceComponents.stories.js.map +1 -0
- package/react/components/userPreferences/stories/WorkspaceItem.stories.d.ts +9 -0
- package/react/components/userPreferences/stories/WorkspaceItem.stories.js +30 -0
- package/react/components/userPreferences/stories/WorkspaceItem.stories.js.map +1 -0
- package/react/components/userPreferences/stories/WorkspaceItemList.stories.d.ts +10 -0
- package/react/components/userPreferences/stories/WorkspaceItemList.stories.js +57 -0
- package/react/components/userPreferences/stories/WorkspaceItemList.stories.js.map +1 -0
- package/react/components/userPreferences/stories/Workspaces.stories.d.ts +9 -0
- package/react/components/userPreferences/stories/Workspaces.stories.js +44 -0
- package/react/components/userPreferences/stories/Workspaces.stories.js.map +1 -0
- package/react/components/userPreferences/tests/ContentSection.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/ContentSection.spec.js +41 -0
- package/react/components/userPreferences/tests/ContentSection.spec.js.map +1 -0
- package/react/components/userPreferences/tests/DashbarEditor.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/DashbarEditor.spec.js +37 -0
- package/react/components/userPreferences/tests/DashbarEditor.spec.js.map +1 -0
- package/react/components/userPreferences/tests/DashbarEditorItem.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/DashbarEditorItem.spec.js +38 -0
- package/react/components/userPreferences/tests/DashbarEditorItem.spec.js.map +1 -0
- package/react/components/userPreferences/tests/General.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/General.spec.js +28 -0
- package/react/components/userPreferences/tests/General.spec.js.map +1 -0
- package/react/components/userPreferences/tests/LeftNav.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/LeftNav.spec.js +12 -0
- package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -0
- package/react/components/userPreferences/tests/NotificationSourceTypes.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js +14 -0
- package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js.map +1 -0
- package/react/components/userPreferences/tests/Notifications.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/Notifications.spec.js +17 -0
- package/react/components/userPreferences/tests/Notifications.spec.js.map +1 -0
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js +39 -0
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -0
- package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js +22 -0
- package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js.map +1 -0
- package/react/components/userPreferences/tests/ScheduledRestart.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/ScheduledRestart.spec.js +70 -0
- package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -0
- package/react/components/userPreferences/tests/WorkspaceButton.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/WorkspaceButton.spec.js +24 -0
- package/react/components/userPreferences/tests/WorkspaceButton.spec.js.map +1 -0
- package/react/components/userPreferences/tests/WorkspaceComponents.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/WorkspaceComponents.spec.js +22 -0
- package/react/components/userPreferences/tests/WorkspaceComponents.spec.js.map +1 -0
- package/react/components/userPreferences/tests/WorkspaceItem.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/WorkspaceItem.spec.js +64 -0
- package/react/components/userPreferences/tests/WorkspaceItem.spec.js.map +1 -0
- package/react/components/userPreferences/tests/WorkspaceItemList.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/WorkspaceItemList.spec.js +45 -0
- package/react/components/userPreferences/tests/WorkspaceItemList.spec.js.map +1 -0
- package/react/hooks/useNotifications.d.ts +4 -0
- package/react/hooks/useNotifications.js +47 -40
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/hooks/usePubSub.js.map +1 -1
- package/react/hooks/useToolbar.js +71 -48
- package/react/hooks/useToolbar.js.map +1 -1
- package/react/reducers/rootReducer.d.ts +2 -2
- package/react/store.d.ts +4 -4
- package/react/types/dashbarTypes.d.ts +1 -1
- package/react/types/dashbarTypes.js.map +1 -1
- package/react/types/fdc3.d.ts +8 -22
- package/react/types/fdc3.js.map +1 -1
- package/react/types/smartDesktopDesignerTypes.d.ts +4 -1
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/components/shared/addProtocolToValidURL.spec.js.map +0 -1
- package/react/components/userPreferences/components/Checkbox.d.ts +0 -4
- package/react/components/userPreferences/components/Checkbox.js +0 -27
- package/react/components/userPreferences/components/Checkbox.js.map +0 -1
|
@@ -35,6 +35,11 @@ export const initFSBL = (windowObject) => {
|
|
|
35
35
|
return /^[a-zA-Z0-9 \-_.]{1,}$/.test(name) && /[a-zA-Z0-9]{1,}/.test(name);
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
|
+
ConfigClient: {
|
|
39
|
+
setPreference: () => { },
|
|
40
|
+
getValues: () => { },
|
|
41
|
+
getPreferences: () => { },
|
|
42
|
+
},
|
|
38
43
|
DialogManager: {
|
|
39
44
|
spawnDialog: (obj1) => {
|
|
40
45
|
console.table(obj1);
|
|
@@ -54,6 +59,7 @@ export const initFSBL = (windowObject) => {
|
|
|
54
59
|
},
|
|
55
60
|
RouterClient: {
|
|
56
61
|
transmit: () => { },
|
|
62
|
+
addListener: () => { },
|
|
57
63
|
},
|
|
58
64
|
StorageClient: {
|
|
59
65
|
save: () => { },
|
|
@@ -65,6 +71,12 @@ export const initFSBL = (windowObject) => {
|
|
|
65
71
|
WorkspaceClient: {
|
|
66
72
|
bringWindowsToFront: () => { },
|
|
67
73
|
minimizeAll: () => { },
|
|
74
|
+
activeWorkspace: {
|
|
75
|
+
name: " ",
|
|
76
|
+
},
|
|
77
|
+
getWorkspaceDefinition: (obj, cb) => {
|
|
78
|
+
cb(null, null);
|
|
79
|
+
},
|
|
68
80
|
},
|
|
69
81
|
},
|
|
70
82
|
onShutdown: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/components/common/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/components/common/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,UAAgB,EAAE,EAAE,CACrE,IAAI,OAAO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7B,CAAC,CAAC;SACH;QACD,mBAAmB,EAAE;YACpB,sBAAsB,EAAE,GAAG,EAAE,GAAE,CAAC;SAChC;KACM,CAAC;IAKT,MAAM,CAAC,IAAI,CAAC,OAAO,GAAG;QACrB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO;QACtB,YAAY,EAAE;YACb,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;SACX;KACR,CAAC;IAGF,MAAM,CAAC,eAAe,GAAG,YAAY,CAAC,eAAe,GAAG;QACvD,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;QACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;QAC1B,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;KAC7B,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAI,SAAmB,EAAE,IAAO;IAC1D,MAAM,QAAQ,GAAa,CAAC,KAAQ,EAAE,EAAE;QACvC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAEjB,OAAO,CACN,oBAAC,QAAQ,IAAC,KAAK,EAAE,WAAW,EAAE;YAC7B,oBAAC,SAAS,OAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,GAAI,CAC9B,CACX,CAAC;IACH,CAAC,CAAC;IAEF,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAErB,OAAO,QAAQ,CAAC;AACjB,CAAC","sourcesContent":["import React from \"react\";\r\nimport { FileInputUploadCb } from \"./FileInput\";\r\nimport { Story } from \"@storybook/react/types-6-0\";\r\n\r\nimport { SDServerInfo } from \"../../types/smartDesktopDesignerTypes\";\r\nimport { Provider } from \"react-redux\";\r\nimport { createStore } from \"../../store\";\r\n\r\nexport const uploadFunction: FileInputUploadCb = (fileObject: File) =>\r\n\tnew Promise((resolve) => {\r\n\t\tresolve({\r\n\t\t\terr: \"\",\r\n\t\t\tpath: fileObject.name,\r\n\t\t});\r\n\t});\r\n\r\nexport const initFSBL = (windowObject?: any) => {\r\n\tif (!windowObject) {\r\n\t\twindowObject = global.window = {} as any;\r\n\t} else {\r\n\t\twindowObject = window;\r\n\r\n\t\tsetTimeout(() => {\r\n\t\t\tconst event = window.document.createEvent(\"Event\");\r\n\r\n\t\t\tevent?.initEvent(\"FSBLReady\", true, true);\r\n\r\n\t\t\twindow.dispatchEvent(event);\r\n\t\t});\r\n\t}\r\n\r\n\tglobal.FSBL = windowObject.FSBL = {\r\n\t\taddEventListener: (name: String, callback: () => void) => {\r\n\t\t\tcallback();\r\n\t\t},\r\n\t\tClients: {\r\n\t\t\tSmartDesktopClient: {\r\n\t\t\t\tcheckValidURL(url: string) {\r\n\t\t\t\t\tif (url.length === 0) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn /^https?:\\/\\/[^\\s]+$/.test(url);\r\n\t\t\t\t},\r\n\t\t\t\tcheckValidProjectName(name: string) {\r\n\t\t\t\t\treturn /^[a-zA-Z0-9 \\-_.]{1,}$/.test(name) && /[a-zA-Z0-9]{1,}/.test(name);\r\n\t\t\t\t},\r\n\t\t\t} as unknown,\r\n\t\t\tConfigClient: {\r\n\t\t\t\tsetPreference: () => {},\r\n\t\t\t\tgetValues: () => {},\r\n\t\t\t\tgetPreferences: () => {},\r\n\t\t\t},\r\n\t\t\tDialogManager: {\r\n\t\t\t\tspawnDialog: (obj1: any) => {\r\n\t\t\t\t\tconsole.table(obj1);\r\n\t\t\t\t},\r\n\t\t\t\tregisterDialogCallback: () => {},\r\n\t\t\t\trespondToOpener: () => {},\r\n\t\t\t},\r\n\t\t\tLauncherClient: {\r\n\t\t\t\tshowWindow: () => {},\r\n\t\t\t},\r\n\t\t\tLogger: {\r\n\t\t\t\tlog: () => {},\r\n\t\t\t\terror: () => {},\r\n\t\t\t\tsystem: {\r\n\t\t\t\t\tdebug: () => {},\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t\tRouterClient: {\r\n\t\t\t\ttransmit: () => {},\r\n\t\t\t\taddListener: () => {},\r\n\t\t\t},\r\n\t\t\tStorageClient: {\r\n\t\t\t\tsave: () => {},\r\n\t\t\t\tclearCache: () => {},\r\n\t\t\t},\r\n\t\t\tWindowClient: {\r\n\t\t\t\tfitToDOM: () => {},\r\n\t\t\t},\r\n\t\t\tWorkspaceClient: {\r\n\t\t\t\tbringWindowsToFront: () => {},\r\n\t\t\t\tminimizeAll: () => {},\r\n\t\t\t\tactiveWorkspace: {\r\n\t\t\t\t\tname: \" \",\r\n\t\t\t\t},\r\n\t\t\t\tgetWorkspaceDefinition: (obj: Object, cb: Function) => {\r\n\t\t\t\t\tcb(null, null);\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t},\r\n\t\tonShutdown: () => {},\r\n\t\tSystem: {\r\n\t\t\tgetSDServerInfo: () =>\r\n\t\t\t\tnew Promise((resolve) => {\r\n\t\t\t\t\tresolve({} as SDServerInfo);\r\n\t\t\t\t}),\r\n\t\t},\r\n\t\tSystemManagerClient: {\r\n\t\t\tpublishCheckpointState: () => {},\r\n\t\t},\r\n\t} as any;\r\n\r\n\t// @todo imesner: 20210426: The following errors existed within the github actions build when WindowClient was declared above.\r\n\t// Error: src/components/common/helpers.tsx(84,4): error TS1117: An object literal cannot have multiple properties with the same name in strict mode.\r\n\t// Error: src/components/common/helpers.tsx(84,4): error TS2300: Duplicate identifier 'WindowClient'.\r\n\tglobal.FSBL.Clients = {\r\n\t\t...global.FSBL.Clients,\r\n\t\tWindowClient: {\r\n\t\t\tfitToDOM: () => {},\r\n\t\t} as any,\r\n\t};\r\n\r\n\t// @ts-ignore\r\n\tglobal.finsembleWindow = windowObject.finsembleWindow = {\r\n\t\tsetAlwaysOnTop: () => {},\r\n\t\taddEventListener: () => {},\r\n\t\tremoveEventListener: () => {},\r\n\t};\r\n};\r\n\r\nexport function createStory<T>(Component: Function, args: T) {\r\n\tconst template: Story<T> = (props: T) => {\r\n\t\tinitFSBL(window);\r\n\r\n\t\treturn (\r\n\t\t\t<Provider store={createStore()}>\r\n\t\t\t\t<Component {...{ ...args, ...props }} />\r\n\t\t\t</Provider>\r\n\t\t);\r\n\t};\r\n\r\n\ttemplate.args = args;\r\n\r\n\treturn template;\r\n}\r\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ButtonRowProps } from "../ButtonRow";
|
|
3
|
+
import "../../../assets/css/finsemble.css";
|
|
4
|
+
import "../css/styles.css";
|
|
5
|
+
import { Story } from "@storybook/react/types-6-0";
|
|
6
|
+
declare const _default: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: React.FC<ButtonRowProps>;
|
|
9
|
+
decorators: ((StoryDisplay: any) => JSX.Element)[];
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const Default: Story<ButtonRowProps>;
|
|
13
|
+
export declare const WithImage: Story<ButtonRowProps>;
|
|
14
|
+
export declare const ImageError: Story<ButtonRowProps>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ButtonRow from "../ButtonRow";
|
|
3
|
+
import "../../../assets/css/finsemble.css";
|
|
4
|
+
import "../css/styles.css";
|
|
5
|
+
export default {
|
|
6
|
+
title: "Common/Button/Row",
|
|
7
|
+
component: ButtonRow,
|
|
8
|
+
decorators: [
|
|
9
|
+
(StoryDisplay) => (React.createElement("div", { className: "row-section", style: { width: 300, height: 40 } },
|
|
10
|
+
React.createElement(StoryDisplay, null))),
|
|
11
|
+
],
|
|
12
|
+
};
|
|
13
|
+
const Template = (args) => React.createElement(ButtonRow, { ...args });
|
|
14
|
+
export const Default = Template.bind({});
|
|
15
|
+
Default.args = {
|
|
16
|
+
label: "Notification Sources",
|
|
17
|
+
onClick: () => { },
|
|
18
|
+
iconClass: "ff-caret-up rotate-90",
|
|
19
|
+
disabled: false,
|
|
20
|
+
};
|
|
21
|
+
export const WithImage = Template.bind({});
|
|
22
|
+
WithImage.args = {
|
|
23
|
+
label: "ChartIQ",
|
|
24
|
+
onClick: () => { },
|
|
25
|
+
iconClass: "ff-caret-up rotate-90",
|
|
26
|
+
disabled: false,
|
|
27
|
+
img: "https://documentation.chartiq.com/img/CIQ_logo_negative.png",
|
|
28
|
+
showDefaultIcon: false,
|
|
29
|
+
};
|
|
30
|
+
export const ImageError = Template.bind({});
|
|
31
|
+
ImageError.args = {
|
|
32
|
+
label: "Finsemble",
|
|
33
|
+
onClick: () => { },
|
|
34
|
+
iconClass: "ff-caret-up rotate-90",
|
|
35
|
+
disabled: false,
|
|
36
|
+
img: "https://thiswillresultinanerrorbutdontworrythatswhatwewant",
|
|
37
|
+
showDefaultIcon: false,
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=ButtonRow.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonRow.stories.js","sourceRoot":"","sources":["../../../../src/components/common/stories/ButtonRow.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAA6B,MAAM,cAAc,CAAC;AACzD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mBAAmB,CAAC;AAG3B,eAAe;IACd,KAAK,EAAE,mBAAmB;IAC1B,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE;QACX,CAAC,YAAiB,EAAE,EAAE,CAAC,CACtB,6BAAK,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;YAC7D,oBAAC,YAAY,OAAG,CACX,CACN;KACD;CACD,CAAC;AAEF,MAAM,QAAQ,GAA0B,CAAC,IAAoB,EAAE,EAAE,CAAC,oBAAC,SAAS,OAAK,IAAI,GAAI,CAAC;AAE1F,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACd,KAAK,EAAE,sBAAsB;IAC7B,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,SAAS,EAAE,uBAAuB;IAClC,QAAQ,EAAE,KAAK;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IAChB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,SAAS,EAAE,uBAAuB;IAClC,QAAQ,EAAE,KAAK;IACf,GAAG,EAAE,6DAA6D;IAClE,eAAe,EAAE,KAAK;CACtB,CAAC;AACF,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;IACjB,KAAK,EAAE,WAAW;IAClB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;IACjB,SAAS,EAAE,uBAAuB;IAClC,QAAQ,EAAE,KAAK;IACf,GAAG,EAAE,4DAA4D;IACjE,eAAe,EAAE,KAAK;CACtB,CAAC","sourcesContent":["import React from \"react\";\r\nimport ButtonRow, { ButtonRowProps } from \"../ButtonRow\";\r\nimport \"../../../assets/css/finsemble.css\";\r\nimport \"../css/styles.css\";\r\nimport { Story } from \"@storybook/react/types-6-0\";\r\n\r\nexport default {\r\n\ttitle: \"Common/Button/Row\",\r\n\tcomponent: ButtonRow,\r\n\tdecorators: [\r\n\t\t(StoryDisplay: any) => (\r\n\t\t\t<div className=\"row-section\" style={{ width: 300, height: 40 }}>\r\n\t\t\t\t<StoryDisplay />\r\n\t\t\t</div>\r\n\t\t),\r\n\t],\r\n};\r\n\r\nconst Template: Story<ButtonRowProps> = (args: ButtonRowProps) => <ButtonRow {...args} />;\r\n\r\nexport const Default = Template.bind({});\r\nDefault.args = {\r\n\tlabel: \"Notification Sources\",\r\n\tonClick: () => {},\r\n\ticonClass: \"ff-caret-up rotate-90\",\r\n\tdisabled: false,\r\n};\r\n\r\nexport const WithImage = Template.bind({});\r\nWithImage.args = {\r\n\tlabel: \"ChartIQ\",\r\n\tonClick: () => {},\r\n\ticonClass: \"ff-caret-up rotate-90\",\r\n\tdisabled: false,\r\n\timg: \"https://documentation.chartiq.com/img/CIQ_logo_negative.png\",\r\n\tshowDefaultIcon: false,\r\n};\r\nexport const ImageError = Template.bind({});\r\nImageError.args = {\r\n\tlabel: \"Finsemble\",\r\n\tonClick: () => {},\r\n\ticonClass: \"ff-caret-up rotate-90\",\r\n\tdisabled: false,\r\n\timg: \"https://thiswillresultinanerrorbutdontworrythatswhatwewant\",\r\n\tshowDefaultIcon: false,\r\n};\r\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CheckboxProps } from "../Checkbox";
|
|
3
|
+
import "../../../assets/css/finsemble.css";
|
|
4
|
+
import "../css/styles.css";
|
|
5
|
+
import { Story } from "@storybook/react/types-6-0";
|
|
6
|
+
declare const _default: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: React.FC<CheckboxProps>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
export declare const Unchecked: Story<CheckboxProps>;
|
|
12
|
+
export declare const Checked: Story<CheckboxProps>;
|
|
13
|
+
export declare const Disabled: Story<CheckboxProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Checkbox } from "../Checkbox";
|
|
3
|
+
import "../../../assets/css/finsemble.css";
|
|
4
|
+
import "../css/styles.css";
|
|
5
|
+
export default {
|
|
6
|
+
title: "Common/Checkbox",
|
|
7
|
+
component: Checkbox,
|
|
8
|
+
};
|
|
9
|
+
const Template = (args) => {
|
|
10
|
+
const [toggle, setToggle] = React.useState(args.checked);
|
|
11
|
+
return React.createElement(Checkbox, { ...args, onClick: () => setToggle((t) => !t), checked: toggle });
|
|
12
|
+
};
|
|
13
|
+
export const Unchecked = Template.bind({});
|
|
14
|
+
Unchecked.args = {
|
|
15
|
+
checked: false,
|
|
16
|
+
label: "Label",
|
|
17
|
+
};
|
|
18
|
+
export const Checked = Template.bind({});
|
|
19
|
+
Checked.args = {
|
|
20
|
+
checked: true,
|
|
21
|
+
label: "Label",
|
|
22
|
+
};
|
|
23
|
+
export const Disabled = Template.bind({});
|
|
24
|
+
Disabled.args = {
|
|
25
|
+
checked: false,
|
|
26
|
+
label: "Label",
|
|
27
|
+
disabled: true,
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=Checkbox.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.stories.js","sourceRoot":"","sources":["../../../../src/components/common/stories/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAC;AACtD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mBAAmB,CAAC;AAI3B,eAAe;IACd,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,QAAQ;CACnB,CAAC;AAEF,MAAM,QAAQ,GAAyB,CAAC,IAAmB,EAAE,EAAE;IAC9D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEzD,OAAO,oBAAC,QAAQ,OAAK,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,GAAI,CAAC;AACrF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3C,SAAS,CAAC,IAAI,GAAG;IAChB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,OAAO;CACd,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,IAAI,GAAG;IACd,OAAO,EAAE,IAAI;IACb,KAAK,EAAE,OAAO;CACd,CAAC;AACF,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1C,QAAQ,CAAC,IAAI,GAAG;IACf,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,IAAI;CACd,CAAC","sourcesContent":["import React from \"react\";\r\nimport { Checkbox, CheckboxProps } from \"../Checkbox\";\r\nimport \"../../../assets/css/finsemble.css\";\r\nimport \"../css/styles.css\";\r\nimport { Story } from \"@storybook/react/types-6-0\";\r\nimport { action } from \"@storybook/addon-actions\";\r\n\r\nexport default {\r\n\ttitle: \"Common/Checkbox\",\r\n\tcomponent: Checkbox,\r\n};\r\n\r\nconst Template: Story<CheckboxProps> = (args: CheckboxProps) => {\r\n\tconst [toggle, setToggle] = React.useState(args.checked);\r\n\r\n\treturn <Checkbox {...args} onClick={() => setToggle((t) => !t)} checked={toggle} />;\r\n};\r\n\r\nexport const Unchecked = Template.bind({});\r\nUnchecked.args = {\r\n\tchecked: false,\r\n\tlabel: \"Label\",\r\n};\r\nexport const Checked = Template.bind({});\r\nChecked.args = {\r\n\tchecked: true,\r\n\tlabel: \"Label\",\r\n};\r\nexport const Disabled = Template.bind({});\r\nDisabled.args = {\r\n\tchecked: false,\r\n\tlabel: \"Label\",\r\n\tdisabled: true,\r\n};\r\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "../../../assets/css/finsemble.css";
|
|
2
|
+
import "../css/styles.css";
|
|
3
|
+
import React from "react";
|
|
4
|
+
declare const _default: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: React.FunctionComponent<import("../DropdownButton").IFinsembleDropdownActionButtonProps>;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
export declare const dropdownButton: import("@storybook/react").Story<{
|
|
10
|
+
buttonLabel: string;
|
|
11
|
+
buttonOptions: {
|
|
12
|
+
buttonLabel: string;
|
|
13
|
+
}[];
|
|
14
|
+
}>;
|
|
15
|
+
export declare const defaultDropdownButton: import("@storybook/react").Story<{
|
|
16
|
+
buttonLabel: string;
|
|
17
|
+
buttonOptions: {
|
|
18
|
+
optionLabel: string;
|
|
19
|
+
}[];
|
|
20
|
+
caretLocation: string;
|
|
21
|
+
classNames: string;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import DropdownButton from "../DropdownButton";
|
|
2
|
+
import DefaultDropdownButton from "../../shared/DefaultDropdownButton";
|
|
3
|
+
import { createStory } from "../helpers";
|
|
4
|
+
import "../../../assets/css/finsemble.css";
|
|
5
|
+
import "../css/styles.css";
|
|
6
|
+
import React from "react";
|
|
7
|
+
export default {
|
|
8
|
+
title: "Common/DropdownButton",
|
|
9
|
+
component: DropdownButton,
|
|
10
|
+
};
|
|
11
|
+
export const dropdownButton = createStory(DropdownButton, {
|
|
12
|
+
buttonLabel: "Label",
|
|
13
|
+
buttonOptions: [{ buttonLabel: "Alpha" }, { buttonLabel: "Bravo" }, { buttonLabel: "Charlie" }],
|
|
14
|
+
});
|
|
15
|
+
dropdownButton.decorators = [
|
|
16
|
+
(Story) => (React.createElement("div", { style: { width: 80 } },
|
|
17
|
+
React.createElement(Story, null))),
|
|
18
|
+
];
|
|
19
|
+
export const defaultDropdownButton = createStory(DefaultDropdownButton, {
|
|
20
|
+
buttonLabel: "Label",
|
|
21
|
+
buttonOptions: [{ optionLabel: "Alpha" }, { optionLabel: "Bravo" }, { optionLabel: "Charlie" }],
|
|
22
|
+
caretLocation: "right",
|
|
23
|
+
classNames: "push-right",
|
|
24
|
+
});
|
|
25
|
+
defaultDropdownButton.decorators = [
|
|
26
|
+
(Story) => (React.createElement("div", { style: { width: 150 } },
|
|
27
|
+
React.createElement(Story, null))),
|
|
28
|
+
];
|
|
29
|
+
//# sourceMappingURL=DropdownButton.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DropdownButton.stories.js","sourceRoot":"","sources":["../../../../src/components/common/stories/DropdownButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,qBAAqB,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAe;IACd,KAAK,EAAE,uBAAuB;IAC9B,SAAS,EAAE,cAAc;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC,cAAc,EAAE;IACzD,WAAW,EAAE,OAAO;IACpB,aAAa,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;CAC/F,CAAC,CAAC;AACH,cAAc,CAAC,UAAU,GAAG;IAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,CACV,6BAAK,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACxB,oBAAC,KAAK,OAAG,CACJ,CACN;CACD,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC,qBAAqB,EAAE;IACvE,WAAW,EAAE,OAAO;IACpB,aAAa,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IAC/F,aAAa,EAAE,OAAO;IACtB,UAAU,EAAE,YAAY;CACxB,CAAC,CAAC;AACH,qBAAqB,CAAC,UAAU,GAAG;IAClC,CAAC,KAAK,EAAE,EAAE,CAAC,CACV,6BAAK,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;QACzB,oBAAC,KAAK,OAAG,CACJ,CACN;CACD,CAAC","sourcesContent":["import DropdownButton from \"../DropdownButton\";\r\nimport DefaultDropdownButton from \"../../shared/DefaultDropdownButton\";\r\nimport { createStory } from \"../helpers\";\r\nimport \"../../../assets/css/finsemble.css\";\r\nimport \"../css/styles.css\";\r\nimport React from \"react\";\r\n\r\nexport default {\r\n\ttitle: \"Common/DropdownButton\",\r\n\tcomponent: DropdownButton,\r\n};\r\n\r\nexport const dropdownButton = createStory(DropdownButton, {\r\n\tbuttonLabel: \"Label\",\r\n\tbuttonOptions: [{ buttonLabel: \"Alpha\" }, { buttonLabel: \"Bravo\" }, { buttonLabel: \"Charlie\" }],\r\n});\r\ndropdownButton.decorators = [\r\n\t(Story) => (\r\n\t\t<div style={{ width: 80 }}>\r\n\t\t\t<Story />\r\n\t\t</div>\r\n\t),\r\n];\r\nexport const defaultDropdownButton = createStory(DefaultDropdownButton, {\r\n\tbuttonLabel: \"Label\",\r\n\tbuttonOptions: [{ optionLabel: \"Alpha\" }, { optionLabel: \"Bravo\" }, { optionLabel: \"Charlie\" }],\r\n\tcaretLocation: \"right\",\r\n\tclassNames: \"push-right\",\r\n});\r\ndefaultDropdownButton.decorators = [\r\n\t(Story) => (\r\n\t\t<div style={{ width: 150 }}>\r\n\t\t\t<Story />\r\n\t\t</div>\r\n\t),\r\n];\r\n"]}
|
|
@@ -7,6 +7,7 @@ import { storiesOf } from "@storybook/react";
|
|
|
7
7
|
const stories = storiesOf("Common/FinsembleIcon", module);
|
|
8
8
|
[
|
|
9
9
|
"check",
|
|
10
|
+
"check-square",
|
|
10
11
|
"chevron-left",
|
|
11
12
|
"chevron-right",
|
|
12
13
|
"copy",
|
|
@@ -19,6 +20,7 @@ const stories = storiesOf("Common/FinsembleIcon", module);
|
|
|
19
20
|
"hdd",
|
|
20
21
|
"key",
|
|
21
22
|
"life-ring",
|
|
23
|
+
"lock",
|
|
22
24
|
"magic",
|
|
23
25
|
"moon",
|
|
24
26
|
"paint-roller",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FinsembleIcon.stories.js","sourceRoot":"","sources":["../../../../src/components/common/stories/FinsembleIcon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,+BAA+B,CAAC;AACvC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,OAAO,GAAG,SAAS,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AAGzD;IACC,OAAO;IACP,cAAc;IACd,eAAe;IACf,MAAM;IACN,oBAAoB;IACpB,eAAe;IACf,MAAM;IACN,QAAQ;IACR,MAAM;IACN,OAAO;IACP,KAAK;IACL,KAAK;IACL,WAAW;IACX,OAAO;IACP,MAAM;IACN,cAAc;IACd,QAAQ;IACR,MAAM;IACN,iBAAiB;IACjB,QAAQ;IACR,KAAK;IACL,OAAO;IACP,YAAY;IACZ,WAAW;IACX,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;CAET,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;IAClB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,oBAAC,aAAa,IAAC,SAAS,EAAC,qBAAqB,EAAC,IAAI,EAAE,IAAI,GAAkB,CAAC,CAAC;AACtG,CAAC,CAAC,CAAC","sourcesContent":["import React from \"react\";\r\nimport { FinsembleIcon } from \"../FinsembleIcon\";\r\nimport \"../../../assets/css/finsemble.css\";\r\nimport \"../fixtures/FinsembleIcon.css\";\r\nimport \"../css/styles.css\";\r\nimport { storiesOf } from \"@storybook/react\";\r\n\r\nconst stories = storiesOf(\"Common/FinsembleIcon\", module);\r\n\r\n(\r\n\t[\r\n\t\t\"check\",\r\n\t\t\"chevron-left\",\r\n\t\t\"chevron-right\",\r\n\t\t\"copy\",\r\n\t\t\"exclamation-circle\",\r\n\t\t\"external-link\",\r\n\t\t\"flag\",\r\n\t\t\"folder\",\r\n\t\t\"font\",\r\n\t\t\"globe\",\r\n\t\t\"hdd\",\r\n\t\t\"key\",\r\n\t\t\"life-ring\",\r\n\t\t\"magic\",\r\n\t\t\"moon\",\r\n\t\t\"paint-roller\",\r\n\t\t\"pencil\",\r\n\t\t\"plus\",\r\n\t\t\"question-circle\",\r\n\t\t\"search\",\r\n\t\t\"sun\",\r\n\t\t\"times\",\r\n\t\t\"toggle-off\",\r\n\t\t\"toggle-on\",\r\n\t\t\"tools\",\r\n\t\t\"trash\",\r\n\t\t\"upload\",\r\n\t\t\"window\",\r\n\t] as FinsembleIcon[]\r\n).forEach((icon) => {\r\n\tstories.add(icon, () => <FinsembleIcon className=\"test-finsemble-icon\" icon={icon}></FinsembleIcon>);\r\n});\r\n"]}
|
|
1
|
+
{"version":3,"file":"FinsembleIcon.stories.js","sourceRoot":"","sources":["../../../../src/components/common/stories/FinsembleIcon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,mCAAmC,CAAC;AAC3C,OAAO,+BAA+B,CAAC;AACvC,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,MAAM,OAAO,GAAG,SAAS,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;AAGzD;IACC,OAAO;IACP,cAAc;IACd,cAAc;IACd,eAAe;IACf,MAAM;IACN,oBAAoB;IACpB,eAAe;IACf,MAAM;IACN,QAAQ;IACR,MAAM;IACN,OAAO;IACP,KAAK;IACL,KAAK;IACL,WAAW;IACX,MAAM;IACN,OAAO;IACP,MAAM;IACN,cAAc;IACd,QAAQ;IACR,MAAM;IACN,iBAAiB;IACjB,QAAQ;IACR,KAAK;IACL,OAAO;IACP,YAAY;IACZ,WAAW;IACX,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;CAET,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;IAClB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,oBAAC,aAAa,IAAC,SAAS,EAAC,qBAAqB,EAAC,IAAI,EAAE,IAAI,GAAkB,CAAC,CAAC;AACtG,CAAC,CAAC,CAAC","sourcesContent":["import React from \"react\";\r\nimport { FinsembleIcon } from \"../FinsembleIcon\";\r\nimport \"../../../assets/css/finsemble.css\";\r\nimport \"../fixtures/FinsembleIcon.css\";\r\nimport \"../css/styles.css\";\r\nimport { storiesOf } from \"@storybook/react\";\r\n\r\nconst stories = storiesOf(\"Common/FinsembleIcon\", module);\r\n\r\n(\r\n\t[\r\n\t\t\"check\",\r\n\t\t\"check-square\",\r\n\t\t\"chevron-left\",\r\n\t\t\"chevron-right\",\r\n\t\t\"copy\",\r\n\t\t\"exclamation-circle\",\r\n\t\t\"external-link\",\r\n\t\t\"flag\",\r\n\t\t\"folder\",\r\n\t\t\"font\",\r\n\t\t\"globe\",\r\n\t\t\"hdd\",\r\n\t\t\"key\",\r\n\t\t\"life-ring\",\r\n\t\t\"lock\",\r\n\t\t\"magic\",\r\n\t\t\"moon\",\r\n\t\t\"paint-roller\",\r\n\t\t\"pencil\",\r\n\t\t\"plus\",\r\n\t\t\"question-circle\",\r\n\t\t\"search\",\r\n\t\t\"sun\",\r\n\t\t\"times\",\r\n\t\t\"toggle-off\",\r\n\t\t\"toggle-on\",\r\n\t\t\"tools\",\r\n\t\t\"trash\",\r\n\t\t\"upload\",\r\n\t\t\"window\",\r\n\t] as FinsembleIcon[]\r\n).forEach((icon) => {\r\n\tstories.add(icon, () => <FinsembleIcon className=\"test-finsemble-icon\" icon={icon}></FinsembleIcon>);\r\n});\r\n"]}
|
|
@@ -5,7 +5,7 @@ import "../css/styles.css";
|
|
|
5
5
|
import { Story } from "@storybook/react/types-6-0";
|
|
6
6
|
declare const _default: {
|
|
7
7
|
title: string;
|
|
8
|
-
component: ({ options, updateCallback, selected, size, values, showSearch, limit, }: FinsembleSelectProps) => JSX.Element;
|
|
8
|
+
component: ({ options, optionComponents, updateCallback, selected, size, values, showSearch, limit, }: FinsembleSelectProps) => JSX.Element;
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
|
11
11
|
export declare const Sample: Story<FinsembleSelectProps>;
|
|
@@ -5,7 +5,7 @@ import "../css/styles.css";
|
|
|
5
5
|
import "../css/tooltip.css";
|
|
6
6
|
declare const _default: {
|
|
7
7
|
title: string;
|
|
8
|
-
component: ({ type, position, children, altClassName }: TooltipProps) => JSX.Element;
|
|
8
|
+
component: ({ type, position, children, altClassName, onClick, }: TooltipProps) => JSX.Element;
|
|
9
9
|
argTypes: {
|
|
10
10
|
type: {
|
|
11
11
|
type: string;
|
package/react/components/{shared/addProtocolToValidURL.spec.d.ts → common/tests/ButtonRow.spec.d.ts}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { mount } from "enzyme";
|
|
3
|
+
import { describe, it } from "mocha";
|
|
4
|
+
import { expect } from "chai";
|
|
5
|
+
import ButtonRow from "../ButtonRow";
|
|
6
|
+
describe("<ButtonRow/>", () => {
|
|
7
|
+
it("should display the correct label", () => {
|
|
8
|
+
const wrapper = mount(React.createElement(ButtonRow, { onClick: () => { }, label: "Hello World" }));
|
|
9
|
+
expect(wrapper.find("span.row__lbl").text()).to.equal("Hello World");
|
|
10
|
+
});
|
|
11
|
+
it("should display the Finsemble Icon if showDefaultIcon is true even if there is an image", () => {
|
|
12
|
+
const wrapper = mount(React.createElement(ButtonRow, { onClick: () => { }, showDefaultIcon: true, img: "https://cosaic.io/wp-content/uploads/2020/07/cosiac-blog.png" }));
|
|
13
|
+
expect(wrapper.find(".ff-finsemble")).to.have.lengthOf(1);
|
|
14
|
+
});
|
|
15
|
+
it("should not display the Finsemble Icon if showDefaultIcon is false", () => {
|
|
16
|
+
const wrapper = mount(React.createElement(ButtonRow, { onClick: () => { }, showDefaultIcon: false }));
|
|
17
|
+
expect(wrapper.find(".ff-finsemble")).to.have.lengthOf(0);
|
|
18
|
+
});
|
|
19
|
+
it("should display given image and not display the Finsemble Icon if image url given does not result in error", () => {
|
|
20
|
+
const wrapper = mount(React.createElement(ButtonRow, { onClick: () => { }, showDefaultIcon: false, img: "https://cosaic.io/wp-content/uploads/2020/07/cosiac-blog.png" }));
|
|
21
|
+
expect(wrapper.find(".ff-finsemble")).to.have.lengthOf(0);
|
|
22
|
+
expect(wrapper.find("img")).to.have.lengthOf(1);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=ButtonRow.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonRow.spec.js","sourceRoot":"","sources":["../../../../src/components/common/tests/ButtonRow.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,SAAS,MAAM,cAAc,CAAC;AAErC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,SAAS,IAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,KAAK,EAAE,aAAa,GAAI,CAAC,CAAC;QAC9E,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IACtE,CAAC,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it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport ButtonRow from \"../ButtonRow\";\r\n\r\ndescribe(\"<ButtonRow/>\", () => {\r\n\tit(\"should display the correct label\", () => {\r\n\t\tconst wrapper = mount(<ButtonRow onClick={() => {}} label={\"Hello World\"} />);\r\n\t\texpect(wrapper.find(\"span.row__lbl\").text()).to.equal(\"Hello World\");\r\n\t});\r\n\tit(\"should display the Finsemble Icon if showDefaultIcon is true even if there is an image\", () => {\r\n\t\tconst wrapper = mount(\r\n\t\t\t<ButtonRow\r\n\t\t\t\tonClick={() => {}}\r\n\t\t\t\tshowDefaultIcon={true}\r\n\t\t\t\timg={\"https://cosaic.io/wp-content/uploads/2020/07/cosiac-blog.png\"}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\".ff-finsemble\")).to.have.lengthOf(1);\r\n\t});\r\n\tit(\"should not display the Finsemble Icon if showDefaultIcon is false\", () => {\r\n\t\tconst wrapper = mount(<ButtonRow onClick={() => {}} showDefaultIcon={false} />);\r\n\t\texpect(wrapper.find(\".ff-finsemble\")).to.have.lengthOf(0);\r\n\t});\r\n\tit(\"should display given image and not display the Finsemble Icon if image url given does not result in error\", () => {\r\n\t\tconst wrapper = mount(\r\n\t\t\t<ButtonRow\r\n\t\t\t\tonClick={() => {}}\r\n\t\t\t\tshowDefaultIcon={false}\r\n\t\t\t\timg={\"https://cosaic.io/wp-content/uploads/2020/07/cosiac-blog.png\"}\r\n\t\t\t/>\r\n\t\t);\r\n\t\texpect(wrapper.find(\".ff-finsemble\")).to.have.lengthOf(0);\r\n\t\texpect(wrapper.find(\"img\")).to.have.lengthOf(1);\r\n\t});\r\n});\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { mount } from "enzyme";
|
|
3
|
+
import { describe, it } from "mocha";
|
|
4
|
+
import { expect } from "chai";
|
|
5
|
+
import sinon from "sinon";
|
|
6
|
+
import { Checked, Unchecked, Disabled } from "../stories/Checkbox.stories";
|
|
7
|
+
import addons, { mockChannel } from "@storybook/addons";
|
|
8
|
+
addons.setChannel(mockChannel());
|
|
9
|
+
describe("<Checkbox/>", () => {
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
sinon.restore();
|
|
12
|
+
});
|
|
13
|
+
it("should be checked items if checked prop is updated after initial render", async () => {
|
|
14
|
+
const wrapper = mount(React.createElement(Unchecked, { ...Unchecked.args }));
|
|
15
|
+
wrapper.find(".complex-menu-checkbox-wrapper").at(0).simulate("click");
|
|
16
|
+
expect(wrapper.find(".ff-check-mark")).to.be.length(1);
|
|
17
|
+
});
|
|
18
|
+
it("should be unchecked items if checked prop is updated after initial render", async () => {
|
|
19
|
+
const wrapper = mount(React.createElement(Checked, { ...Checked.args }));
|
|
20
|
+
wrapper.find(".complex-menu-checkbox-wrapper").at(0).simulate("click");
|
|
21
|
+
expect(wrapper.find(".ff-check-mark")).to.be.length(0);
|
|
22
|
+
});
|
|
23
|
+
it("shouldn't be clickable when disabled", async () => {
|
|
24
|
+
const wrapper = mount(React.createElement(Disabled, { ...Disabled.args }));
|
|
25
|
+
wrapper.find(".complex-menu-checkbox-wrapper").at(0).simulate("click");
|
|
26
|
+
expect(wrapper.find(".ff-check-mark")).to.be.length(0);
|
|
27
|
+
});
|
|
28
|
+
it("should display a label", async () => {
|
|
29
|
+
const wrapper = mount(React.createElement(Checked, { ...Checked.args }));
|
|
30
|
+
expect(wrapper.find(".complex-menu-checkbox-label").at(0).text()).to.equal("Label");
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=Checkbox.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.spec.js","sourceRoot":"","sources":["../../../../src/components/common/tests/Checkbox.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,K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CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;QACrD,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,QAAQ,OAAM,QAAQ,CAAC,IAAsB,GAAI,CAAC,CAAC;QAE1E,OAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEvE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,OAAO,GAAG,KAAK,CAAC,oBAAC,OAAO,OAAM,OAAO,CAAC,IAAsB,GAAI,CAAC,CAAC;QAExE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount } from \"enzyme\";\r\nimport { describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport sinon from \"sinon\";\r\nimport { CheckboxProps } from \"../Checkbox\";\r\nimport { Checked, Unchecked, Disabled } from \"../stories/Checkbox.stories\";\r\n\r\n// Necessary to allow sinon to work with mocked actions (which are shown in the Actions panel in Storybook)\r\nimport addons, { mockChannel } from \"@storybook/addons\";\r\n\r\naddons.setChannel(mockChannel());\r\n\r\ndescribe(\"<Checkbox/>\", () => {\r\n\tafterEach(() => {\r\n\t\tsinon.restore();\r\n\t});\r\n\r\n\tit(\"should be checked items if checked prop is updated after initial render\", async () => {\r\n\t\tconst wrapper = mount(<Unchecked {...(Unchecked.args as CheckboxProps)} />);\r\n\r\n\t\twrapper.find(\".complex-menu-checkbox-wrapper\").at(0).simulate(\"click\");\r\n\r\n\t\texpect(wrapper.find(\".ff-check-mark\")).to.be.length(1);\r\n\t});\r\n\r\n\tit(\"should be unchecked items if checked prop is updated after initial render\", async () => {\r\n\t\tconst wrapper = mount(<Checked {...(Checked.args as CheckboxProps)} />);\r\n\r\n\t\twrapper.find(\".complex-menu-checkbox-wrapper\").at(0).simulate(\"click\");\r\n\r\n\t\texpect(wrapper.find(\".ff-check-mark\")).to.be.length(0);\r\n\t});\r\n\r\n\tit(\"shouldn't be clickable when disabled\", async () => {\r\n\t\tconst wrapper = mount(<Disabled {...(Disabled.args as CheckboxProps)} />);\r\n\r\n\t\twrapper.find(\".complex-menu-checkbox-wrapper\").at(0).simulate(\"click\");\r\n\r\n\t\texpect(wrapper.find(\".ff-check-mark\")).to.be.length(0);\r\n\t});\r\n\r\n\tit(\"should display a label\", async () => {\r\n\t\tconst wrapper = mount(<Checked {...(Checked.args as CheckboxProps)} />);\r\n\r\n\t\texpect(wrapper.find(\".complex-menu-checkbox-label\").at(0).text()).to.equal(\"Label\");\r\n\t});\r\n});\r\n"]}
|
|
@@ -6,7 +6,7 @@ export const ResolverDialog = ({ intentRaiser, onSend, onCancel, resolutionList
|
|
|
6
6
|
const [intentNumber, setIntentNumber] = useState(0);
|
|
7
7
|
const intent = resolutionList[intentNumber]?.intent?.displayName || "";
|
|
8
8
|
const contextType = resolutionList[intentNumber]?.context?.type ?? "data";
|
|
9
|
-
const receivingApps = resolutionList[intentNumber]?.
|
|
9
|
+
const receivingApps = resolutionList[intentNumber]?.launchableApps || [];
|
|
10
10
|
const openApps = (resolutionList[intentNumber]?.openApps || []).map((app, key) => {
|
|
11
11
|
return {
|
|
12
12
|
...app,
|
|
@@ -40,11 +40,11 @@ export const ResolverDialog = ({ intentRaiser, onSend, onCancel, resolutionList
|
|
|
40
40
|
"."),
|
|
41
41
|
React.createElement("p", null, "How do you want to handle this?"))),
|
|
42
42
|
React.createElement("h2", null, "Open a new app..."),
|
|
43
|
-
React.createElement("div", { className: "appListGrid" }, receivingApps.map((app, key) => (React.createElement(Tile, { key: key, text: app.name, callback: () => {
|
|
43
|
+
React.createElement("div", { className: "appListGrid" }, receivingApps.map((app, key) => (React.createElement(Tile, { key: key, text: app.meta.name, callback: () => {
|
|
44
44
|
onSend({
|
|
45
45
|
intent: resolutionList[intentNumber]?.intent?.name,
|
|
46
46
|
selectedApp: {
|
|
47
|
-
name: app.name,
|
|
47
|
+
name: app.meta.name,
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
} })))),
|
|
@@ -61,7 +61,6 @@ export const ResolverDialog = ({ intentRaiser, onSend, onCancel, resolutionList
|
|
|
61
61
|
React.createElement("div", { className: "actionGroupRight" },
|
|
62
62
|
React.createElement(Button, { fashion: "ghost", text: "Cancel", onClick: onCancel }))));
|
|
63
63
|
};
|
|
64
|
-
const tile_text_limit = 8;
|
|
65
64
|
const Tile = ({ text, callback }) => (React.createElement("button", { className: "appTile", onClick: callback, title: text },
|
|
66
|
-
React.createElement("span", { className: "tileHeader" }, text
|
|
65
|
+
React.createElement("span", { className: "tileHeader" }, text)));
|
|
67
66
|
//# sourceMappingURL=ResolverDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResolverDialog.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAiB5D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,YAAY,EAAE,M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CAAQ,SAAS,EAAC,SAAS,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI;IACzD,8BAAM,SAAS,EAAC,YAAY,IAAE,IAAI,CAAQ,CAClC,CACT,CAAC","sourcesContent":["import React, { useState } from \"react\";\r\nimport { Button } from \"../common/Button\";\r\nimport \"./ResolverDialog.css\";\r\nimport { ResolutionList } from \"../../types/fdc3\";\r\nimport { FinsembleSelect } from \"../common/FinsembleSelect\";\r\n\r\ntype openApp = {\r\n\tname: string;\r\n\tid: string;\r\n};\r\nexport type ReceivingAppType = {\r\n\tname: string;\r\n\topen: openApp[];\r\n};\r\nexport type ResolverProps = {\r\n\tintentRaiser: string;\r\n\tonSend: any;\r\n\tonCancel: any;\r\n\tresolutionList?: ResolutionList[];\r\n};\r\n\r\nexport const ResolverDialog = ({ intentRaiser, onSend, onCancel, resolutionList = [] }: ResolverProps) => {\r\n\tconst [intentNumber, setIntentNumber] = useState(0);\r\n\tconst intent = resolutionList[intentNumber]?.intent?.displayName || \"\";\r\n\tconst contextType = resolutionList[intentNumber]?.context?.type ?? \"data\";\r\n\tconst receivingApps = resolutionList[intentNumber]?.launchableApps || [];\r\n\tconst openApps = (resolutionList[intentNumber]?.openApps || []).map((app, key) => {\r\n\t\treturn {\r\n\t\t\t...app,\r\n\t\t\tindex: key,\r\n\t\t};\r\n\t});\r\n\r\n\treturn (\r\n\t\t<div className=\"resolverDialog\">\r\n\t\t\t{resolutionList.length > 1 ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<h3>\r\n\t\t\t\t\t\t<span className=\"sourceText\">{intentRaiser}</span> wants to send{\" \"}\r\n\t\t\t\t\t\t<span className=\"intentText\">"{contextType}"</span> to another app.\r\n\t\t\t\t\t</h3>\r\n\t\t\t\t\t<p>How do you want to handle this?</p>\r\n\r\n\t\t\t\t\t<h2>Choose an action:</h2>\r\n\r\n\t\t\t\t\t<FinsembleSelect\r\n\t\t\t\t\t\tselected={[`${intentNumber}`]}\r\n\t\t\t\t\t\toptions={resolutionList.map((item) => item.intent?.displayName || \"\")}\r\n\t\t\t\t\t\tvalues={resolutionList.map((item, key) => `${key}`)}\r\n\t\t\t\t\t\tupdateCallback={(values: string[]) => {\r\n\t\t\t\t\t\t\tsetIntentNumber(+values[0]);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tsize={Math.min(resolutionList.length, 5)}\r\n\t\t\t\t\t\tlimit={1}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</>\r\n\t\t\t) : (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<h3>\r\n\t\t\t\t\t\t<span className=\"sourceText\">{intentRaiser}</span> wants to{\" \"}\r\n\t\t\t\t\t\t<span className=\"intentText\">"{intent}"</span>.\r\n\t\t\t\t\t</h3>\r\n\t\t\t\t\t<p>How do you want to handle this?</p>\r\n\t\t\t\t</>\r\n\t\t\t)}\r\n\r\n\t\t\t<h2>Open a new app...</h2>\r\n\r\n\t\t\t<div className=\"appListGrid\">\r\n\t\t\t\t{receivingApps.map((app, key) => (\r\n\t\t\t\t\t<Tile\r\n\t\t\t\t\t\tkey={key}\r\n\t\t\t\t\t\ttext={app.meta.name}\r\n\t\t\t\t\t\tcallback={() => {\r\n\t\t\t\t\t\t\tonSend({\r\n\t\t\t\t\t\t\t\tintent: resolutionList[intentNumber]?.intent?.name,\r\n\t\t\t\t\t\t\t\tselectedApp: {\r\n\t\t\t\t\t\t\t\t\tname: app.meta.name,\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t))}\r\n\t\t\t</div>\r\n\r\n\t\t\t{openApps.length ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<h2>...or, send to a running app</h2>\r\n\r\n\t\t\t\t\t<div className=\"appSelector\">\r\n\t\t\t\t\t\t<ul>\r\n\t\t\t\t\t\t\t{openApps.map((app, index) => (\r\n\t\t\t\t\t\t\t\t<li\r\n\t\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\t\ttabIndex={0}\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tonSend({\r\n\t\t\t\t\t\t\t\t\t\t\tintent: resolutionList[intentNumber]?.intent?.name,\r\n\t\t\t\t\t\t\t\t\t\t\tselectedApp: { name: app.meta.name },\r\n\t\t\t\t\t\t\t\t\t\t\twindowName: app.windowName,\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{`${app.index + 1} - ${app.meta.name}`}\r\n\t\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</>\r\n\t\t\t) : (\r\n\t\t\t\t<></>\r\n\t\t\t)}\r\n\r\n\t\t\t<div className=\"actionGroupRight\">\r\n\t\t\t\t<Button fashion=\"ghost\" text=\"Cancel\" onClick={onCancel} />\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\ntype TileProps = {\r\n\ttext: string;\r\n\tcallback: () => void;\r\n};\r\n\r\nconst Tile = ({ text, callback }: TileProps) => (\r\n\t<button className=\"appTile\" onClick={callback} title={text}>\r\n\t\t<span className=\"tileHeader\">{text}</span>\r\n\t</button>\r\n);\r\n"]}
|
|
@@ -3,7 +3,7 @@ import { mount } from "enzyme";
|
|
|
3
3
|
import { afterEach, describe, it } from "mocha";
|
|
4
4
|
import { expect } from "chai";
|
|
5
5
|
import sinon from "sinon";
|
|
6
|
-
import {
|
|
6
|
+
import { Short } from "./ResolverDialog.stories";
|
|
7
7
|
import { accessibilityAssessor } from "../smartDesktopDesigner/tests/a11y_helper";
|
|
8
8
|
import addons, { mockChannel } from "@storybook/addons";
|
|
9
9
|
addons.setChannel(mockChannel());
|
|
@@ -47,12 +47,5 @@ describe("Resolver UI", () => {
|
|
|
47
47
|
wrapper.find(".button-container-ghost button").simulate("click");
|
|
48
48
|
expect(buttonSpy.calledOnce, "The send callback was called").to.be.true;
|
|
49
49
|
});
|
|
50
|
-
it("names longer than 8 letters should be truncated", () => {
|
|
51
|
-
const wrapper = mount(React.createElement(LongNames, { ...LongNames.args }));
|
|
52
|
-
expect(wrapper.find(".appTile").at(0).text(), "No ellipses on 7-character name").to.equal("jacuzzi");
|
|
53
|
-
expect(wrapper.find(".appTile").at(1).text(), "No ellipses on 8-character name").to.equal("blizzard");
|
|
54
|
-
expect(wrapper.find(".appTile").at(2).text(), "Ellipses on truncated name").to.equal("quizzica...");
|
|
55
|
-
expect(wrapper.find(".appTile").at(2).prop("title"), "Truncated name has title with full name").to.equal("quizzical");
|
|
56
|
-
});
|
|
57
50
|
});
|
|
58
51
|
//# sourceMappingURL=ResolverDialog.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResolverDialog.spec.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,
|
|
1
|
+
{"version":3,"file":"ResolverDialog.spec.js","sourceRoot":"","sources":["../../../src/components/fdc3Resolver/ResolverDialog.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO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I,CAAC;IACzE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { mount } from \"enzyme\";\r\nimport { afterEach, describe, it } from \"mocha\";\r\nimport { expect } from \"chai\";\r\nimport sinon from \"sinon\";\r\nimport { ResolverProps } from \"./ResolverDialog\";\r\nimport { LongNames, Short } from \"./ResolverDialog.stories\";\r\nimport { accessibilityAssessor } from \"../smartDesktopDesigner/tests/a11y_helper\";\r\n\r\n// Necessary to allow sinon to work with mocked actions (which are shown in the Actions panel in Storybook)\r\nimport addons, { mockChannel } from \"@storybook/addons\";\r\naddons.setChannel(mockChannel());\r\n\r\ndescribe(\"Resolver UI\", () => {\r\n\tafterEach(() => {\r\n\t\tsinon.restore();\r\n\t});\r\n\r\n\tit(\"should pass accessibility scans\", async () => {\r\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\r\n\r\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\r\n\t});\r\n\r\n\tit(\"should fill in data as expected\", () => {\r\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\r\n\r\n\t\texpect(wrapper.find(\".appTile\").length, \"Only show 2 tiles\").to.equal(2);\r\n\t\texpect(wrapper.find(\".appTile\").at(0).find(\".tileHeader\").text(), \"First tile says Chart\").to.equal(\"Chart\");\r\n\t\texpect(wrapper.find(\".appTile\").at(1).find(\".tileHeader\").text(), \"Second tile says Grid\").to.equal(\"Grid\");\r\n\t\texpect(wrapper.find(\".appSelector li\").length, \"App list should have 2 items\").to.equal(2);\r\n\t\texpect(wrapper.find(\".appSelector li\").at(0).text(), \"First app list item should say Chart #1\").to.equal(\r\n\t\t\t\"1 - Chart\"\r\n\t\t);\r\n\t});\r\n\r\n\tit(\"should include info in the Send payload - selecting new item\", () => {\r\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onSend\");\r\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\r\n\r\n\t\twrapper.find(\".appTile\").at(0).simulate(\"click\");\r\n\t\tconst { args }: { args: any[] } = buttonSpy.getCall(0);\r\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\r\n\t\texpect(args.length, \"Only 1 window was provided\").to.be.equal(1);\r\n\t\texpect(args[0].selectedApp.name, \"Provides name = Chart\").to.equal(\"Chart\");\r\n\t});\r\n\r\n\tit(\"should include the selected items in the Send payload\", () => {\r\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onSend\");\r\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\r\n\r\n\t\twrapper.find(\".appSelector li\").at(0).simulate(\"click\");\r\n\r\n\t\tconst { args }: { args: any[] } = buttonSpy.getCall(0);\r\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\r\n\t\texpect(args.length, \"Only 1 window was provided\").to.be.equal(1);\r\n\t\texpect(args[0].windowName, \"The name of the provided window was 'Chart-1-'Finsemble'\").to.equal(\r\n\t\t\t\"Chart-1-Finsemble\"\r\n\t\t);\r\n\t});\r\n\r\n\tit(\"should call the cancel function if the Cancel button is clicked\", () => {\r\n\t\tconst buttonSpy = sinon.spy(Short.args as ResolverProps, \"onCancel\");\r\n\t\tconst wrapper = mount(<Short {...(Short.args as ResolverProps)} />);\r\n\t\twrapper.find(\".button-container-ghost button\").simulate(\"click\");\r\n\t\texpect(buttonSpy.calledOnce, \"The send callback was called\").to.be.true;\r\n\t});\r\n});\r\n"]}
|