@sassoftware/vi-api 1.5.0 → 1.9.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.
Files changed (82) hide show
  1. package/alert-reps/index.d.ts +1 -1
  2. package/alert-reps/package.json +5 -0
  3. package/component/bindings.d.ts +10 -4
  4. package/component/index.d.ts +11 -10
  5. package/component/index.js +1 -1
  6. package/component/package.json +9 -0
  7. package/config/config-api.d.ts +21 -2
  8. package/config/package.json +9 -0
  9. package/control/control-api.d.ts +40 -15
  10. package/control/package.json +9 -0
  11. package/control/restrictions.d.ts +5 -1
  12. package/current-user/package.json +9 -0
  13. package/event/event-api.d.ts +3 -1
  14. package/event/event-api.js +2 -0
  15. package/event/package.json +9 -0
  16. package/file/package.json +9 -0
  17. package/http/package.json +9 -0
  18. package/index.d.ts +4 -2
  19. package/localization/package.json +9 -0
  20. package/metadata/metadata-api.d.ts +17 -14
  21. package/metadata/package.json +9 -0
  22. package/object/object-api.d.ts +34 -21
  23. package/object/package.json +9 -0
  24. package/package.json +2 -1
  25. package/page-admin/package.json +9 -0
  26. package/page-admin/page-admin-api.d.ts +2 -2
  27. package/page-model/package.json +9 -0
  28. package/page-model/page-model-api.d.ts +92 -1
  29. package/page-state/package.json +9 -0
  30. package/page-state/page-state-api.d.ts +6 -33
  31. package/property/package.json +9 -0
  32. package/property/property-api.d.ts +6 -6
  33. package/property/property-api.js +2 -2
  34. package/reference-data/package.json +9 -0
  35. package/resource/package.json +9 -0
  36. package/score-reps/index.d.ts +1 -1
  37. package/score-reps/package.json +5 -0
  38. package/search/client/client-search-api.d.ts +24 -14
  39. package/search/package.json +9 -0
  40. package/search/search-api.d.ts +1 -1
  41. package/sheet/package.json +9 -0
  42. package/sheet/sheet-api.d.ts +6 -6
  43. package/shell-tabs/package.json +9 -0
  44. package/shell-tabs/public-api.d.ts +2 -0
  45. package/shell-tabs/public-api.js +2 -0
  46. package/shell-tabs/shell-tabs-api.d.ts +199 -0
  47. package/shell-tabs/shell-tabs-api.js +6 -0
  48. package/shell-tabs/shell-tabs-lifecycle-api.d.ts +69 -0
  49. package/shell-tabs/shell-tabs-lifecycle-api.js +14 -0
  50. package/svi-datahub/index.d.ts +295 -135
  51. package/svi-datahub/package.json +5 -0
  52. package/svi-sand/index.d.ts +31 -24
  53. package/svi-sand/package.json +5 -0
  54. package/tab/package.json +9 -0
  55. package/tab/tab-api.d.ts +1 -1
  56. package/theme/package.json +9 -0
  57. package/time-slider/index.d.ts +9 -0
  58. package/traversal/package.json +9 -0
  59. package/api-init.service.js +0 -86
  60. package/component/component-api.service.js +0 -161
  61. package/config/config-api.service.js +0 -54
  62. package/current-user/currentUser-api.service.js +0 -49
  63. package/event/event-api.service.js +0 -32
  64. package/file/file-api.service.js +0 -24
  65. package/http/http-api.service.js +0 -64
  66. package/localization/localization-api.service.js +0 -38
  67. package/metadata/admin/admin-metadata-api.service.js +0 -30
  68. package/metadata/metadata-api.service.js +0 -85
  69. package/object/object-api.service.js +0 -207
  70. package/page-admin/page-admin-api.service.js +0 -25
  71. package/page-model/page-model-api.service.js +0 -25
  72. package/page-state/page-state-api.service.js +0 -70
  73. package/property/property-api.service.js +0 -34
  74. package/reference-data/refData.service.js +0 -40
  75. package/resource/resource-api.service.js +0 -24
  76. package/search/client/client-search-api.service.js +0 -111
  77. package/search/search-api.service.js +0 -28
  78. package/sheet/network-menu-handler.service.js +0 -39
  79. package/sheet/sheet-api.service.js +0 -140
  80. package/tab/tab-api.service.js +0 -35
  81. package/theme/theme-api.service.js +0 -35
  82. package/traversal/traversal-api.service.js +0 -77
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@sassoftware/vi-api/sheet",
3
+ "files": [
4
+ "**/*.d.ts",
5
+ "**/*.js"
6
+ ],
7
+ "main": "public-api.js",
8
+ "types": "public-api.d.ts"
9
+ }
@@ -1,7 +1,7 @@
1
1
  import { ObjectIdentifier, ObjectSheetSettings, VIObject } from "../object/object-api";
2
2
  import { NetworkData, ResolvedObjectIdentifier, Visualization } from "../search/client/client-search-api";
3
3
  /**
4
- * This API pertains to functionality related to SAS Visual Investigators sheet capabilities.
4
+ * This API pertains to functionality related to SAS Visual Investigator's sheet capabilities.
5
5
  * Accessed from the window at window.sas.vi.sheet.
6
6
  */
7
7
  export interface SheetApi {
@@ -35,7 +35,7 @@ export interface SheetApi {
35
35
  * Creates and returns the list containing all Context Menu Items for a right-click on a network diagram node.
36
36
  * The menu is not rendered on the network diagram.
37
37
  * @param workspace {ClientSheet} Workspace containing the network. The workspace should not be manually constructed.
38
- * @param handleAddToWorkspaceFn {function} A callback to handle adding the selected nodes to a Workspace.
38
+ * @param handleAddToWorkspaceFn {function} A callback to handle adding the selected nodes to a workspace.
39
39
  * @param handleAddToInsightsFn {function} A callback to handle adding the NLD to an Insight.
40
40
  * @returns Promise resolving to the list containing all Context Menu Items.
41
41
  */
@@ -88,22 +88,22 @@ export interface SheetApi {
88
88
  * @param targetObject {VIObject} Object containing the existing workspace.
89
89
  * @param workspaceClientId {string} Client ID of the workspace to add to.
90
90
  * @param objectsToAdd {Array<ObjectIdentifier | ResolvedObjectIdentifier>} Objects to add. It is safe to pass objects that are already in the workspace.
91
- * @param [networkData] {NetworkData} If provided, network data that shall be merged into any existing network data on the workspace.
91
+ * @param [networkData] {NetworkData} If provided, network data that will be merged into any existing network data on the workspace.
92
92
  * @param [isUndoRedo] {boolean} Specifies if the function was called as part of an undo/redo operation.
93
93
  */
94
94
  addToExistingWorkspace(targetObject: VIObject, workspaceClientId: string, objectsToAdd: Array<ObjectIdentifier | ResolvedObjectIdentifier>, networkData?: NetworkData, isUndoRedo?: boolean): Promise<void>;
95
95
  }
96
96
  export interface AddAllObjectsToWorkspaceDialogOptions {
97
97
  /**
98
- * The visualization to initially display once the objects have been added
98
+ * The visualization to initially display after the objects have been added.
99
99
  */
100
100
  visualizationName?: Visualization;
101
101
  /**
102
- * The object the user is currently viewing. This is used as a visual aid in the dialog
102
+ * The object the user is currently viewing. This is used as a visual aid in the dialog.
103
103
  */
104
104
  currentObject?: ObjectIdentifier;
105
105
  /**
106
- * Network visualization data to be copied to the workspace
106
+ * Network visualization data to be copied to the workspace.
107
107
  */
108
108
  networkData?: NetworkData;
109
109
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@sassoftware/vi-api/shell-tabs",
3
+ "files": [
4
+ "**/*.d.ts",
5
+ "**/*.js"
6
+ ],
7
+ "main": "public-api.js",
8
+ "types": "public-api.d.ts"
9
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./shell-tabs-api";
2
+ export * from "./shell-tabs-lifecycle-api";
@@ -0,0 +1,2 @@
1
+ export * from "./shell-tabs-api";
2
+ export * from "./shell-tabs-lifecycle-api";
@@ -0,0 +1,199 @@
1
+ import { Observable } from "rxjs";
2
+ import { INavigationBarTabSaveOptions } from "./shell-tabs-lifecycle-api";
3
+ export interface WebElementData {
4
+ elementName: string;
5
+ doNotReuse?: boolean;
6
+ }
7
+ export interface INavigationBarTabs<D1 = any, D2 = D1> {
8
+ primary: INavigationBarTab<D1>;
9
+ secondary?: INavigationBarTab<D2>;
10
+ }
11
+ export interface INavigationBarTab<D = {
12
+ [key: string]: any;
13
+ }, SecondaryData = D> {
14
+ /** unique tab id */
15
+ id: string;
16
+ /** url relative to shell root e.g. /user/123 - this must start with a / */
17
+ routeUrl: string;
18
+ /** label for the tab, can be String or the resource.key (if .isLabelResourceKey:true) */
19
+ label: string;
20
+ /** a weight used during .sort to order the tabs; will default to the order the tabs came as
21
+ * doesnt mean their array index, as many can be the same, negatives, fractions
22
+ * */
23
+ sortIndex?: number;
24
+ /** when true, will use resourceService.get to resolve INavigationBarTab.label */
25
+ isLabelResourceKey?: boolean;
26
+ /** font icon */
27
+ icon?: string;
28
+ /** image url */
29
+ img?: string;
30
+ /** aria-controls id */
31
+ controlsId?: string;
32
+ /** list of secondary tabs which will be displayed under the top-level tab */
33
+ secondaryTabs?: Array<ISecondaryNavigationBarTab<SecondaryData>>;
34
+ /** keep track of the currently selected secondary tab */
35
+ selectedSecondaryTab?: ISecondaryNavigationBarTab<SecondaryData>;
36
+ /** callback to configure save confirm actions on close. */
37
+ getSaveOptions?(tab: INavigationBarTab): INavigationBarTabSaveOptions | undefined;
38
+ /** callback when tab is removed */
39
+ onClose?(tab: INavigationBarTab): Promise<boolean> | Observable<boolean> | boolean;
40
+ /** mark tab as dirty */
41
+ dirty?: boolean;
42
+ /** visually disable and make tab unselectable */
43
+ disabled?: boolean;
44
+ /** visually hide tab and make unselectable */
45
+ hidden?: boolean;
46
+ /** exclude tab from appearing in the navigation bar system tab menu */
47
+ excludedFromSystemMenu?: boolean;
48
+ /** visually hide secondary tabs bar for a tab */
49
+ hideSecondaryTabs?: boolean;
50
+ /** indicate that the tab is associated with some new object being created. */
51
+ creating?: boolean;
52
+ /** any extra data to be associated with the tab */
53
+ data?: D;
54
+ }
55
+ export declare type ISecondaryNavigationBarTab<D = {
56
+ [key: string]: any;
57
+ }> = Omit<INavigationBarTab<D>, "secondaryTabs" | "selectedSecondaryTab">;
58
+ export interface ExternalTabConfig<T = any, P = any> {
59
+ /**
60
+ * will try to place at this index, can be negative, fraction, etc to put before/between existing tabs
61
+ */
62
+ sortIndex?: number;
63
+ /**
64
+ * finds TabId, and adds this as a secondaryTab to that tab
65
+ */
66
+ mainTabId?: string;
67
+ /**
68
+ * this is the element/tag name that will get presented
69
+ */
70
+ elementName: string;
71
+ /**
72
+ * this is the URL that the tab will be registered under,
73
+ * technically it's just a unique ID as this will be used to unregister a route and close any related tab(s)
74
+ */
75
+ configUrl: string;
76
+ /**
77
+ * function to return {@link INavigationBarTab} , remember routeUrl is from baseURL with a leading /
78
+ * fullUrl is the full URL that relates to the tab, useful when catching wildcards
79
+ * params is constructed as of /:param1/:param2, so {param1: string, param2: string}
80
+ * be aware fullUrl/params will be undefined if buildOnRegister true
81
+ */
82
+ buildTab: (fullUrl?: string, params?: P) => INavigationBarTab<T>;
83
+ /**
84
+ * add as a systemTab?, if left out will default to applicationTab, ignored if mainTabId is defined
85
+ */
86
+ systemTab?: boolean;
87
+ /**
88
+ * set this to true if you want the component to reset every time you navigate away
89
+ */
90
+ doNotReuse?: boolean;
91
+ /**
92
+ * set this to true if you want buildTab to run when registered (e.g. for a system tab that's always there)
93
+ * if your buildTab takes params, this can not be provided and must be assumed undefined
94
+ * a secondaryTab (one that has mainTabId) will be created regardless of this flag.
95
+ */
96
+ buildOnRegister?: boolean;
97
+ }
98
+ export declare type ShellTabsApi = {
99
+ /**
100
+ * this is used to expose any {@link PotentialTabItem} hooks on a component up to the Tab Service
101
+ * @param context pass "this"
102
+ * @param elRef pass the ElementRef for the component
103
+ *
104
+ * onTabClose {@link OnTabClose}, optional, can be used to prevent closing of a tab or close async
105
+ * onAttachTab {@link OnAttachTab}, will always trigger when currentNavigationBarTab has set
106
+ * onAttachToolbar {@link TabWithToolbar}, optional, will set currentToolbar if there was a toolbar in the VI Router
107
+ * onTabEnter {@link OnTabEnter}, optional, will trigger when tab is entered
108
+ * onTabLeave {@link OnTabLeave}, optional, will trigger when tab is left
109
+ * onTabSaveConfirm {@link OnTabSaveConfirm}, optional, basic dialog can be created whe closing a dirty tab
110
+ */
111
+ createTabApiForElement: (context: any, nativeElement: HTMLElement) => void;
112
+ /**
113
+ * Use this function to register new routes for tabs
114
+ * @param tabsToAdd - see {@link ExternalTabConfig}
115
+ */
116
+ registerExternalTabs: (tab: ExternalTabConfig[]) => void;
117
+ /**
118
+ * Use this function to remove routes added via registerTabFn
119
+ * @param tabsToAdd - see {@link ExternalTabConfig}
120
+ */
121
+ unregisterExternalTabs: (tabsToRemove: ExternalTabConfig[]) => void;
122
+ /**
123
+ * this will return the current primary and secondary tabs
124
+ */
125
+ getSelectedTab: () => {
126
+ primaryTab: INavigationBarTab;
127
+ secondaryTab?: INavigationBarTab;
128
+ };
129
+ /**
130
+ * this stream will track the current top level tab
131
+ */
132
+ selectedPrimaryTabChanged$: Observable<INavigationBarTab>;
133
+ /**
134
+ * this stream will track the current second level tab
135
+ */
136
+ selectedSecondaryTabChanged$: Observable<INavigationBarTab | undefined>;
137
+ /**
138
+ * this stream will update after any additions/removals to either system or application tabs
139
+ */
140
+ openTabsChanged$: Observable<{
141
+ systemTabs: INavigationBarTab[];
142
+ applicationTabs: INavigationBarTab[];
143
+ }>;
144
+ /**
145
+ * this stream will emit any removed tabs
146
+ */
147
+ tabRemoved$: Observable<INavigationBarTab>;
148
+ /**
149
+ * @param tabId will be ID of an existing tab
150
+ */
151
+ getTabById: (tabId: string) => INavigationBarTab | undefined;
152
+ /**
153
+ * will return a slice of the current system and application tabs
154
+ */
155
+ getAllTabs: () => {
156
+ system: INavigationBarTab[];
157
+ application: INavigationBarTab[];
158
+ };
159
+ /**
160
+ * will move user to the default tab
161
+ */
162
+ selectDefaultTab: () => Promise<boolean>;
163
+ /**
164
+ * will attempt to open+select a matching INavigationBarTab and optional secondaryTab, returning false on failure
165
+ * in the event the tab doesn't exist already, it will add the tab assuming an appropriate route has been registered for it
166
+ * @param tabToSelect {@link INavigationBarTab}
167
+ * @param secondaryTab {@link INavigationBarTab} if left undefined, this will select the previously
168
+ * selected secondary tab of the primary tab or it's first index secondary tab
169
+ */
170
+ openTab: (tabToSelect: INavigationBarTab, secondaryTab?: INavigationBarTab) => Promise<boolean>;
171
+ /**
172
+ * will attempt to select a tab by its id, returning false on failure
173
+ * @param tabId will be ID of an existing tab
174
+ */
175
+ selectTabById: (tabId: string) => Promise<boolean>;
176
+ /**
177
+ * will remove an application tab, if allowed, and will trigger any closing and saving logic beforehand
178
+ * @param tabIdToRemove will be ID of an existing tab
179
+ * @param suppressNavigation if you are closing a tab that isn't open, you want to supressNavigation=true
180
+ */
181
+ removeApplicationTabById: (tabIdToRemove: string, suppressNavigation?: boolean) => Promise<boolean>;
182
+ /**
183
+ * will remove an existing application tab then replace with another, if {@link removeApplicationTabById} is unsuccessful this will fail
184
+ * use case can be saving a tab which has a temporary ID, and reopening it with a saved payload.
185
+ * @param tabId will be ID of an existing tab
186
+ * @param newTab {@link INavigationBarTab}
187
+ *
188
+ */
189
+ replaceApplicationTab: (tabId: string, newTab: INavigationBarTab) => Promise<boolean>;
190
+ /**
191
+ * will run {@link removeApplicationTabById} on all tabs, will stop if any fail to close, will wait for each close to complete
192
+ */
193
+ removeAllApplicationTabs: () => Promise<boolean>;
194
+ /**
195
+ * will run same as {@link removeAllApplicationTabs}, but not on the provided tabIdToKeep
196
+ * @param tabIdToKeep
197
+ */
198
+ removeOtherApplicationTabs: (tabIdToKeep?: string) => Promise<boolean>;
199
+ };
@@ -0,0 +1,6 @@
1
+ import { expectType } from "../../shared/util/helper-functions";
2
+ expectType(true);
3
+ expectType(true);
4
+ expectType(true);
5
+ expectType(true);
6
+ expectType(true);
@@ -0,0 +1,69 @@
1
+ import { OnDestroy } from "@angular/core";
2
+ import { INavigationBarTab, INavigationBarTabs } from "./shell-tabs-api";
3
+ import { Observable } from "rxjs";
4
+ export declare type PotentialTabItem<T = any, U = any> = Partial<OnAttachTab<T> & OnTabEnter & OnTabLeave & OnTabSaveConfirm & OnTabClose & TabWithToolbar<U> & OnDestroy>;
5
+ export interface OnAttachTab<T = any> {
6
+ currentNavigationBarTab?: INavigationBarTab<T>;
7
+ /**
8
+ * Runs when a navigation bar tab is first attached to the implementing component.
9
+ * If the tab is recycled, it will only run once.
10
+ */
11
+ onAttachTab?(): void;
12
+ }
13
+ export interface OnTabEnterParams {
14
+ from?: INavigationBarTab;
15
+ fromSecondary?: INavigationBarTab;
16
+ to: INavigationBarTab;
17
+ toSecondary?: INavigationBarTab;
18
+ recycled: boolean;
19
+ }
20
+ export declare type OnTabLeaveParams = Omit<OnTabEnterParams, "recycled">;
21
+ export interface OnTabEnter {
22
+ /**
23
+ * Function to run when the Tab is entered, this happens on first load as well
24
+ * @param params - from is previous tab (possibly undefined on first load), to is always this tab;
25
+ * type {@link INavigationBarTab}, recycled is whether the component was recycled or not
26
+ */
27
+ onTabEnter(params: OnTabEnterParams): void;
28
+ }
29
+ export interface OnTabLeave {
30
+ /**
31
+ * Function to run when the Tab is left
32
+ * @param params - from is always this tab, to is where the user is going; type {@link INavigationBarTab}
33
+ */
34
+ onTabLeave(params: OnTabLeaveParams): void;
35
+ }
36
+ export interface TabToolbarFor<T = any> {
37
+ currentComponentAndTab?: {
38
+ tab: INavigationBarTabs;
39
+ component: T;
40
+ };
41
+ onAttachComponent?(): void;
42
+ }
43
+ export interface TabWithToolbar<T> {
44
+ currentToolbar?: T;
45
+ onAttachToolbar?(): void;
46
+ }
47
+ export interface OnTabClose {
48
+ /**
49
+ * @param tab the current tab model that is closing.
50
+ */
51
+ onTabClose(tab: INavigationBarTab): boolean | Promise<boolean> | Observable<boolean>;
52
+ }
53
+ export interface OnTabSaveConfirm {
54
+ /**
55
+ * @param tab the current tab model that is closing.
56
+ */
57
+ onTabSaveConfirm(tab: INavigationBarTab): INavigationBarTabSaveOptions | undefined;
58
+ }
59
+ export interface INavigationBarTabSaveOptions {
60
+ dialogTitle: string;
61
+ dialogMessage: string;
62
+ saveFunction(): Promise<boolean> | Observable<boolean> | boolean;
63
+ }
64
+ export declare type WebElementTabApi<NavBarDataType = any, ComponentType = any> = Omit<PotentialTabItem<NavBarDataType, ComponentType>, "onAttachTab" | keyof TabWithToolbar<ComponentType>> & {
65
+ onAttachTab?(tab: INavigationBarTab<NavBarDataType>): void;
66
+ };
67
+ export declare type WebTabApiElement = HTMLElement & {
68
+ tabApi?: WebElementTabApi;
69
+ };
@@ -0,0 +1,14 @@
1
+ import { expectType } from "../../shared/util/helper-functions";
2
+ expectType(true);
3
+ expectType(true);
4
+ expectType(true);
5
+ expectType(true);
6
+ expectType(true);
7
+ expectType(true);
8
+ expectType(true);
9
+ expectType(true);
10
+ expectType(true);
11
+ expectType(true);
12
+ expectType(true);
13
+ expectType(true);
14
+ expectType(true);