@sassoftware/vi-api 1.51.1 → 1.53.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/README.md +1 -1
- package/alert-reps/index.d.ts +70 -14
- package/alert-reps/package.json +1 -1
- package/api.module.js +4 -5
- package/component/bindings.js +1 -0
- package/config/standardPropertyTypes.js +4 -0
- package/control/control-api.d.ts +28 -17
- package/control/restrictions.d.ts +1 -0
- package/current-user/currentUser-api.js +1 -0
- package/elements/identity-select.js +1 -0
- package/index.d.ts +2 -0
- package/mcp/index.d.ts +1 -0
- package/mcp/index.js +1 -0
- package/mcp/mcp-api.d.ts +44 -0
- package/mcp/mcp-api.js +1 -0
- package/mcp/package.json +9 -0
- package/metadata/metadata-api.d.ts +1 -1
- package/package.json +3 -2
- package/page-model/page-model-api.d.ts +1 -1
- package/page-state/page-state-api.d.ts +2 -2
- package/page-template/page-template-api.d.ts +1 -1
- package/property/property-api.d.ts +1 -1
- package/score-reps/index.d.ts +1 -1
- package/score-reps/package.json +1 -1
- package/search/client/client-search-api.d.ts +7 -8
- package/shell-tabs/shell-tabs-api.d.ts +58 -58
- package/shell-tabs/shell-tabs-api.js +1 -0
- package/shell-tabs/shell-tabs-lifecycle-api.d.ts +7 -7
- package/shell-tabs/shell-tabs-lifecycle-api.js +1 -0
- package/svi-datahub/index.d.ts +37 -35
- package/svi-datahub/package.json +1 -1
- package/svi-sand/index.d.ts +1 -1
- package/svi-sand/package.json +1 -1
- package/init/init-api.d.ts +0 -26
- package/init/init-api.js +0 -83
|
@@ -12,45 +12,45 @@ export interface INavigationBarTabs<D1 = any, D2 = D1> {
|
|
|
12
12
|
export interface INavigationBarTab<D = {
|
|
13
13
|
[key: string]: any;
|
|
14
14
|
}, SecondaryData = D> {
|
|
15
|
-
/**
|
|
15
|
+
/** Unique tab identifier */
|
|
16
16
|
id: string;
|
|
17
|
-
/**
|
|
17
|
+
/** URL relative to shell root (e.g., /user/123) - must start with a forward slash */
|
|
18
18
|
routeUrl: string;
|
|
19
|
-
/**
|
|
19
|
+
/** Label for the tab, can be a string or resource key (if isLabelResourceKey is true) */
|
|
20
20
|
label: string;
|
|
21
|
-
/**
|
|
22
|
-
* doesn't
|
|
23
|
-
|
|
21
|
+
/** Weight used during sorting to order the tabs; defaults to the order in which tabs were added.
|
|
22
|
+
* This doesn't refer to array index, as many tabs can have the same value, including negatives and fractions.
|
|
23
|
+
*/
|
|
24
24
|
sortIndex?: number;
|
|
25
|
-
/**
|
|
25
|
+
/** When true, uses resourceService.get to resolve INavigationBarTab.label */
|
|
26
26
|
isLabelResourceKey?: boolean;
|
|
27
|
-
/**
|
|
27
|
+
/** Font icon */
|
|
28
28
|
icon?: string;
|
|
29
|
-
/**
|
|
29
|
+
/** Image URL */
|
|
30
30
|
img?: string;
|
|
31
|
-
/** aria-controls
|
|
31
|
+
/** aria-controls ID */
|
|
32
32
|
controlsId?: string;
|
|
33
|
-
/**
|
|
33
|
+
/** List of secondary tabs displayed under the top-level tab */
|
|
34
34
|
secondaryTabs?: Array<ISecondaryNavigationBarTab<SecondaryData>>;
|
|
35
|
-
/**
|
|
35
|
+
/** Currently selected secondary tab */
|
|
36
36
|
selectedSecondaryTab?: ISecondaryNavigationBarTab<SecondaryData>;
|
|
37
|
-
/**
|
|
37
|
+
/** Callback to configure save confirmation actions on close */
|
|
38
38
|
getSaveOptions?(tab: INavigationBarTab): INavigationBarTabSaveOptions | undefined;
|
|
39
|
-
/**
|
|
39
|
+
/** Callback executed when tab is removed */
|
|
40
40
|
onClose?(tab: INavigationBarTab): Promise<boolean> | Observable<boolean> | boolean;
|
|
41
|
-
/**
|
|
41
|
+
/** Mark tab as having unsaved changes */
|
|
42
42
|
dirty?: boolean;
|
|
43
|
-
/**
|
|
43
|
+
/** Visually disable and make tab unselectable */
|
|
44
44
|
disabled?: boolean;
|
|
45
|
-
/**
|
|
45
|
+
/** Visually hide tab and make it unselectable */
|
|
46
46
|
hidden?: boolean;
|
|
47
|
-
/**
|
|
47
|
+
/** Exclude tab from appearing in the navigation bar system tab menu */
|
|
48
48
|
excludedFromSystemMenu?: boolean;
|
|
49
|
-
/**
|
|
49
|
+
/** Visually hide secondary tabs bar for this tab */
|
|
50
50
|
hideSecondaryTabs?: boolean;
|
|
51
|
-
/**
|
|
51
|
+
/** Indicate that the tab is associated with a new object being created */
|
|
52
52
|
creating?: boolean;
|
|
53
|
-
/**
|
|
53
|
+
/** Any additional data to be associated with the tab */
|
|
54
54
|
data?: D;
|
|
55
55
|
}
|
|
56
56
|
export type ISecondaryNavigationBarTab<D = {
|
|
@@ -58,15 +58,15 @@ export type ISecondaryNavigationBarTab<D = {
|
|
|
58
58
|
}> = Omit<INavigationBarTab<D>, "secondaryTabs" | "selectedSecondaryTab">;
|
|
59
59
|
export interface SviShellTabData {
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
61
|
+
* Required user capabilities for the tab.
|
|
62
|
+
* If unmet, the tab is hidden and cannot be navigated to.
|
|
63
63
|
* @example
|
|
64
64
|
* { or: ["svi.administration.alerts", "svi.vsd.flow.view"] }
|
|
65
65
|
*/
|
|
66
66
|
requiredCapabilities?: RequiredResourcesExpression;
|
|
67
67
|
/**
|
|
68
68
|
* REST APIs required by the tab's content.
|
|
69
|
-
*
|
|
69
|
+
* If unavailable, the tab is hidden and cannot be navigated to.
|
|
70
70
|
* @example
|
|
71
71
|
* { and: ["svi-alert", "documentGeneratorAdapter"] }
|
|
72
72
|
*/
|
|
@@ -82,41 +82,41 @@ export interface SviShellTabData {
|
|
|
82
82
|
}
|
|
83
83
|
export interface ExternalTabConfig<T = SviShellTabData, P = any> {
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Will try to place at this index, can be negative, fraction, etc. to put before/between existing tabs.
|
|
86
86
|
*/
|
|
87
87
|
sortIndex?: number;
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* Finds TabId, and adds this as a secondaryTab to that tab.
|
|
90
90
|
*/
|
|
91
91
|
mainTabId?: string;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* This is the element/tag name that will be presented.
|
|
94
94
|
*/
|
|
95
95
|
elementName: string;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
97
|
+
* This is the URL that the tab will be registered under.
|
|
98
|
+
* Technically it's just a unique ID as this will be used to unregister a route and close any related tab(s).
|
|
99
99
|
*/
|
|
100
100
|
configUrl: string;
|
|
101
101
|
/**
|
|
102
|
-
*
|
|
103
|
-
* fullUrl is the full URL that relates to the tab, useful when catching wildcards
|
|
104
|
-
* params is constructed as of /:param1/:param2, so {param1: string, param2: string}
|
|
105
|
-
*
|
|
102
|
+
* Function to return {@link INavigationBarTab}. Remember routeUrl is from baseURL with a leading /.
|
|
103
|
+
* fullUrl is the full URL that relates to the tab, useful when catching wildcards.
|
|
104
|
+
* params is constructed as of /:param1/:param2, so {param1: string, param2: string}.
|
|
105
|
+
* Be aware fullUrl/params will be undefined if buildOnRegister is true.
|
|
106
106
|
*/
|
|
107
107
|
buildTab: (fullUrl?: string, params?: P) => INavigationBarTab<T>;
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
109
|
+
* Add as a system tab. If left out will default to application tab, ignored if mainTabId is defined.
|
|
110
110
|
*/
|
|
111
111
|
systemTab?: boolean;
|
|
112
112
|
/**
|
|
113
|
-
*
|
|
113
|
+
* Set this to true if you want the component to reset every time you navigate away.
|
|
114
114
|
*/
|
|
115
115
|
doNotReuse?: boolean;
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
117
|
+
* Set this to true if you want buildTab to run when registered (e.g. for a system tab that's always there).
|
|
118
|
+
* If your buildTab takes params, this cannot be provided and must be assumed undefined.
|
|
119
|
+
* A secondaryTab (one that has mainTabId) will be created regardless of this flag.
|
|
120
120
|
*/
|
|
121
121
|
buildOnRegister?: boolean;
|
|
122
122
|
}
|
|
@@ -132,27 +132,27 @@ export interface ShellTabsApi<T = SviShellTabData> {
|
|
|
132
132
|
/**
|
|
133
133
|
* @method
|
|
134
134
|
* @description This is used to expose any {@link PotentialTabItem} hooks on a component up to the Tab Service.
|
|
135
|
-
* @param {any} context
|
|
136
|
-
* @param {HTMLElement} nativeElement This will pass the ElementRef for the component
|
|
135
|
+
* @param {any} context Pass "this".
|
|
136
|
+
* @param {HTMLElement} nativeElement This will pass the ElementRef for the component.
|
|
137
137
|
*
|
|
138
|
-
* onTabClose {@link OnTabClose}, optional, can be used to prevent closing of a tab or close async
|
|
139
|
-
* onAttachTab {@link OnAttachTab}, will always trigger when currentNavigationBarTab
|
|
140
|
-
* onAttachToolbar {@link TabWithToolbar}, optional, will set currentToolbar if there was a toolbar in the VI Router
|
|
141
|
-
* onTabEnter {@link OnTabEnter}, optional, will trigger when tab is entered
|
|
142
|
-
* onTabLeave {@link OnTabLeave}, optional, will trigger when tab is left
|
|
143
|
-
* onTabSaveConfirm {@link OnTabSaveConfirm}, optional, basic dialog box can be created
|
|
138
|
+
* onTabClose {@link OnTabClose}, optional, can be used to prevent closing of a tab or close async.
|
|
139
|
+
* onAttachTab {@link OnAttachTab}, will always trigger when currentNavigationBarTab is set.
|
|
140
|
+
* onAttachToolbar {@link TabWithToolbar}, optional, will set currentToolbar if there was a toolbar in the VI Router.
|
|
141
|
+
* onTabEnter {@link OnTabEnter}, optional, will trigger when tab is entered.
|
|
142
|
+
* onTabLeave {@link OnTabLeave}, optional, will trigger when tab is left.
|
|
143
|
+
* onTabSaveConfirm {@link OnTabSaveConfirm}, optional, basic dialog box can be created when closing a dirty tab.
|
|
144
144
|
*/
|
|
145
145
|
createTabApiForElement: (context: any, nativeElement: HTMLElement) => void;
|
|
146
146
|
/**
|
|
147
147
|
* @method
|
|
148
148
|
* @description Use this function to register new routes for tabs.
|
|
149
|
-
* @param {ExternalTabConfig[]} tab See {@link ExternalTabConfig}
|
|
149
|
+
* @param {ExternalTabConfig[]} tab See {@link ExternalTabConfig}.
|
|
150
150
|
*/
|
|
151
151
|
registerExternalTabs: (tab: Array<ExternalTabConfig<T>>) => void;
|
|
152
152
|
/**
|
|
153
153
|
* @method
|
|
154
154
|
* @description Use this function to remove routes added via registerTabFn.
|
|
155
|
-
* @param {ExternalTabConfig[]} tabsToRemove See {@link ExternalTabConfig}
|
|
155
|
+
* @param {ExternalTabConfig[]} tabsToRemove See {@link ExternalTabConfig}.
|
|
156
156
|
*/
|
|
157
157
|
unregisterExternalTabs: (tabsToRemove: Array<ExternalTabConfig<T>>) => void;
|
|
158
158
|
/**
|
|
@@ -165,12 +165,12 @@ export interface ShellTabsApi<T = SviShellTabData> {
|
|
|
165
165
|
};
|
|
166
166
|
/**
|
|
167
167
|
* @method
|
|
168
|
-
* @description This stream will track the current top
|
|
168
|
+
* @description This stream will track the current top-level tab.
|
|
169
169
|
*/
|
|
170
170
|
selectedPrimaryTabChanged$: Observable<INavigationBarTab>;
|
|
171
171
|
/**
|
|
172
172
|
* @method
|
|
173
|
-
* @description This stream will track the current second
|
|
173
|
+
* @description This stream will track the current second-level tab.
|
|
174
174
|
*/
|
|
175
175
|
selectedSecondaryTabChanged$: Observable<INavigationBarTab | undefined>;
|
|
176
176
|
/**
|
|
@@ -188,7 +188,7 @@ export interface ShellTabsApi<T = SviShellTabData> {
|
|
|
188
188
|
tabRemoved$: Observable<INavigationBarTab>;
|
|
189
189
|
/**
|
|
190
190
|
* @method
|
|
191
|
-
* @description
|
|
191
|
+
* @description Get Tab by ID.
|
|
192
192
|
* @param [tabId] {string} This will be ID of an existing tab.
|
|
193
193
|
*/
|
|
194
194
|
getTabById: (tabId: string) => INavigationBarTab | undefined;
|
|
@@ -207,10 +207,10 @@ export interface ShellTabsApi<T = SviShellTabData> {
|
|
|
207
207
|
selectDefaultTab: () => Promise<boolean>;
|
|
208
208
|
/**
|
|
209
209
|
* @method
|
|
210
|
-
* @description This will attempt to open+select a matching INavigationBarTab and optional secondaryTab, returning false on failure
|
|
211
|
-
*
|
|
212
|
-
* @param [tabToSelect] {INavigationBarTab} See {@link INavigationBarTab}
|
|
213
|
-
* @param [secondaryTab] {INavigationBarTab} See {@link INavigationBarTab}
|
|
210
|
+
* @description This will attempt to open+select a matching INavigationBarTab and optional secondaryTab, returning false on failure.
|
|
211
|
+
* In the event the tab doesn't exist already, it will add the tab assuming an appropriate route has been registered for it.
|
|
212
|
+
* @param [tabToSelect] {INavigationBarTab} See {@link INavigationBarTab}.
|
|
213
|
+
* @param [secondaryTab] {INavigationBarTab} See {@link INavigationBarTab}. If left undefined, this will select the previously
|
|
214
214
|
* selected secondary tab of the primary tab or its first index secondary tab.
|
|
215
215
|
*/
|
|
216
216
|
openTab: (tabToSelect: INavigationBarTab, secondaryTab?: INavigationBarTab) => Promise<boolean>;
|
|
@@ -229,10 +229,10 @@ export interface ShellTabsApi<T = SviShellTabData> {
|
|
|
229
229
|
removeApplicationTabById: (tabIdToRemove: string, suppressNavigation?: boolean) => Promise<boolean>;
|
|
230
230
|
/**
|
|
231
231
|
* @method
|
|
232
|
-
* @description This will remove an existing application tab then replace with another
|
|
233
|
-
*
|
|
232
|
+
* @description This will remove an existing application tab then replace with another. If {@link removeApplicationTabById} is unsuccessful this will fail.
|
|
233
|
+
* Use case can be saving a tab which has a temporary ID, and reopening it with a saved payload.
|
|
234
234
|
* @param [tabId] {string} This will be ID of an existing tab.
|
|
235
|
-
* @param [newTab] {INavigationBarTab} See {@link INavigationBarTab}
|
|
235
|
+
* @param [newTab] {INavigationBarTab} See {@link INavigationBarTab}.
|
|
236
236
|
*
|
|
237
237
|
*/
|
|
238
238
|
replaceApplicationTab: (tabId: string, newTab: INavigationBarTab) => Promise<boolean>;
|
|
@@ -20,16 +20,16 @@ export interface OnTabEnterParams {
|
|
|
20
20
|
export type OnTabLeaveParams = Omit<OnTabEnterParams, "recycled">;
|
|
21
21
|
export interface OnTabEnter {
|
|
22
22
|
/**
|
|
23
|
-
* Function to run when the
|
|
24
|
-
* @param params - from is previous tab (possibly undefined on first load), to is always this tab;
|
|
25
|
-
* type {@link INavigationBarTab}, recycled
|
|
23
|
+
* Function to run when the tab is entered. This happens on first load as well.
|
|
24
|
+
* @param params - from is the previous tab (possibly undefined on first load), to is always this tab;
|
|
25
|
+
* type {@link INavigationBarTab}, recycled indicates whether the component was recycled or not.
|
|
26
26
|
*/
|
|
27
27
|
onTabEnter(params: OnTabEnterParams): void;
|
|
28
28
|
}
|
|
29
29
|
export interface OnTabLeave {
|
|
30
30
|
/**
|
|
31
|
-
* Function to run when the
|
|
32
|
-
* @param params - from is always this tab, to is where the user is going; type {@link INavigationBarTab}
|
|
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
33
|
*/
|
|
34
34
|
onTabLeave(params: OnTabLeaveParams): void;
|
|
35
35
|
}
|
|
@@ -46,13 +46,13 @@ export interface TabWithToolbar<T> {
|
|
|
46
46
|
}
|
|
47
47
|
export interface OnTabClose {
|
|
48
48
|
/**
|
|
49
|
-
* @param tab
|
|
49
|
+
* @param tab The current tab model that is closing.
|
|
50
50
|
*/
|
|
51
51
|
onTabClose(tab: INavigationBarTab): boolean | Promise<boolean> | Observable<boolean>;
|
|
52
52
|
}
|
|
53
53
|
export interface OnTabSaveConfirm {
|
|
54
54
|
/**
|
|
55
|
-
* @param tab
|
|
55
|
+
* @param tab The current tab model that is closing.
|
|
56
56
|
*/
|
|
57
57
|
onTabSaveConfirm(tab: INavigationBarTab): INavigationBarTabSaveOptions | undefined;
|
|
58
58
|
}
|