@sassoftware/vi-api 0.0.29 → 1.5.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/LICENSE.txt +333 -0
- package/README.md +9 -0
- package/alert-reps/index.d.ts +5 -1
- package/api-init.service.js +86 -0
- package/api.module.js +72 -0
- package/component/bindings.d.ts +5 -3
- package/component/component-api.service.js +161 -0
- package/config/config-api.d.ts +2 -1
- package/config/config-api.service.js +54 -0
- package/control/control-api.d.ts +21 -9
- package/control/data-types.d.ts +6 -1
- package/control/page.d.ts +14 -0
- package/control/toolbar-property-api.d.ts +2 -1
- package/current-user/currentUser-api.service.js +49 -0
- package/event/event-api.d.ts +1 -0
- package/event/event-api.js +1 -0
- package/event/event-api.service.js +32 -0
- package/file/file-api.service.js +24 -0
- package/http/http-api.service.js +64 -0
- package/localization/localization-api.service.js +38 -0
- package/metadata/admin/admin-metadata-api.service.js +30 -0
- package/metadata/metadata-api.d.ts +3 -0
- package/metadata/metadata-api.service.js +85 -0
- package/object/object-api.d.ts +9 -20
- package/object/object-api.service.js +207 -0
- package/package.json +24 -2
- package/page-admin/page-admin-api.service.js +25 -0
- package/page-model/page-model-api.d.ts +21 -13
- package/page-model/page-model-api.service.js +25 -0
- package/page-state/page-state-api.d.ts +23 -0
- package/page-state/page-state-api.service.js +70 -0
- package/property/property-api.d.ts +62 -2
- package/property/property-api.service.js +34 -0
- package/reference-data/refData.service.js +40 -0
- package/resource/resource-api.service.js +24 -0
- package/score-reps/index.d.ts +1 -1
- package/search/client/client-search-api.d.ts +8 -4
- package/search/client/client-search-api.js +1 -1
- package/search/client/client-search-api.service.js +111 -0
- package/search/search-api.d.ts +6 -6
- package/search/search-api.service.js +28 -0
- package/sheet/network-menu-handler.service.js +39 -0
- package/sheet/sheet-api.d.ts +35 -3
- package/sheet/sheet-api.js +9 -1
- package/sheet/sheet-api.service.js +140 -0
- package/svi-datahub/index.d.ts +203 -171
- package/svi-sand/index.d.ts +10 -10
- package/tab/tab-api.service.js +35 -0
- package/theme/theme-api.d.ts +1 -1
- package/theme/theme-api.js +1 -1
- package/theme/theme-api.service.js +35 -0
- package/time-slider/index.d.ts +6 -0
- package/traversal/traversal-api.d.ts +7 -1
- package/traversal/traversal-api.service.js +77 -0
- package/alert-reps/package.json +0 -5
- package/component/package.json +0 -9
- package/config/package.json +0 -9
- package/control/package.json +0 -9
- package/current-user/package.json +0 -9
- package/event/package.json +0 -9
- package/file/package.json +0 -9
- package/http/package.json +0 -9
- package/localization/package.json +0 -9
- package/metadata/package.json +0 -9
- package/object/package.json +0 -9
- package/page-admin/package.json +0 -9
- package/page-model/package.json +0 -9
- package/page-state/package.json +0 -9
- package/property/package.json +0 -9
- package/reference-data/package.json +0 -9
- package/resource/package.json +0 -9
- package/score-reps/package.json +0 -5
- package/search/package.json +0 -9
- package/sheet/package.json +0 -9
- package/svi-datahub/package.json +0 -5
- package/svi-sand/package.json +0 -5
- package/tab/package.json +0 -9
- package/theme/package.json +0 -9
- package/traversal/package.json +0 -9
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@angular/core";
|
|
8
|
+
import { each, get, isFunction, noop, set } from "lodash-es";
|
|
9
|
+
import { compileAngularJsComponent, getAngularJsInjectable } from "../../commons/angular-angularjs-utils";
|
|
10
|
+
import { TimeSliderComponent } from "../../commons/time-slider/time-slider.component";
|
|
11
|
+
import { SandSearchInputComponent } from "../../sand/search-input/sand-search-input.component";
|
|
12
|
+
import { ControlCollectionComponent } from "../../spb/page-viewer/control-collection/control-collection.component";
|
|
13
|
+
import { zoneWrap } from "../../commons/api-utils";
|
|
14
|
+
import { SearchAndSelectWithPreviewComponent } from "../../sand/search-and-select-with-preview/search-and-select-with-preview.component";
|
|
15
|
+
/* The details of our supported components. This maps each SviComponent to its associated selector
|
|
16
|
+
or Angular Component class. This indirection allows us to change implementation details at a later
|
|
17
|
+
date. */
|
|
18
|
+
export const components = {
|
|
19
|
+
"svi-control-collection": {
|
|
20
|
+
selector: "spb-control-collection",
|
|
21
|
+
class: ControlCollectionComponent
|
|
22
|
+
},
|
|
23
|
+
"svi-relationship-details": {
|
|
24
|
+
selector: "relate-to-details",
|
|
25
|
+
fnBindings: {
|
|
26
|
+
onLinkReasonSelected: { params: ["linkReason"] },
|
|
27
|
+
setApi: { params: ["api"] },
|
|
28
|
+
onRelatedPageLoad: { params: [] },
|
|
29
|
+
onRelatedPageChange: { params: ["change"] },
|
|
30
|
+
onRelationshipValuesChange: { params: ["current", "previous"] }
|
|
31
|
+
},
|
|
32
|
+
defaultBindings: {
|
|
33
|
+
onRelatedPageLoad: () => {
|
|
34
|
+
window.sas.vi?.component.detectChanges();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"svi-search-input": {
|
|
39
|
+
selector: "sand-search-input",
|
|
40
|
+
class: SandSearchInputComponent
|
|
41
|
+
},
|
|
42
|
+
"svi-page": {
|
|
43
|
+
selector: "spb-sds-page-viewer",
|
|
44
|
+
fnBindings: {
|
|
45
|
+
setApi: { params: ["api"] },
|
|
46
|
+
onDirty: { params: ["isDirty"] },
|
|
47
|
+
onPageLoad: { params: [] },
|
|
48
|
+
onChange: { params: ["change"] }
|
|
49
|
+
},
|
|
50
|
+
defaultBindings: {
|
|
51
|
+
onPageLoad: () => {
|
|
52
|
+
window.sas.vi?.component.detectChanges();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"svi-search-and-select-with-preview": {
|
|
57
|
+
selector: "sand-search-and-select-with-preview",
|
|
58
|
+
class: SearchAndSelectWithPreviewComponent
|
|
59
|
+
},
|
|
60
|
+
"svi-time-slider": {
|
|
61
|
+
selector: "svi-time-slider",
|
|
62
|
+
class: TimeSliderComponent
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
let ComponentApiService = class ComponentApiService {
|
|
66
|
+
constructor(componentFactoryResolver, injector, appRef, ngZone) {
|
|
67
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
68
|
+
this.injector = injector;
|
|
69
|
+
this.appRef = appRef;
|
|
70
|
+
this.ngZone = ngZone;
|
|
71
|
+
this.$timeout = () => getAngularJsInjectable("$timeout");
|
|
72
|
+
this.getApi = () => {
|
|
73
|
+
return {
|
|
74
|
+
create: zoneWrap(this.create.bind(this), this.ngZone),
|
|
75
|
+
detectChanges: this.detectChanges
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
this.detectChanges = (callback = noop) => {
|
|
79
|
+
// $timeout for AngularJS
|
|
80
|
+
this.$timeout()(() => {
|
|
81
|
+
// ngZone.run() for Angular. A single $timeout is not enough in some circumstances.
|
|
82
|
+
this.ngZone.run(callback);
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
this.compileComponent = (component, target, bindings = {}) => {
|
|
86
|
+
const details = components[component];
|
|
87
|
+
bindings = { ...bindings, ...details.defaultBindings };
|
|
88
|
+
if (details.class) {
|
|
89
|
+
return this.compileAngularComponent(details.class, target, bindings);
|
|
90
|
+
}
|
|
91
|
+
return this.compileAngularJSComponent(component, target, bindings);
|
|
92
|
+
};
|
|
93
|
+
this.compileAngularJSComponent = (component, target, bindings = {}) => {
|
|
94
|
+
const selector = components[component].selector;
|
|
95
|
+
const attrs = this.getAngularJsAttrs(bindings, component);
|
|
96
|
+
const { element, destroy, scope } = compileAngularJsComponent(target, selector, bindings, attrs, true);
|
|
97
|
+
return Promise.resolve({ element, destroy, component: scope });
|
|
98
|
+
};
|
|
99
|
+
this.getAngularJsAttrs = (bindings, component) => {
|
|
100
|
+
const attrs = {};
|
|
101
|
+
each(bindings, (_v, k) => {
|
|
102
|
+
const fnBinding = get(components[component].fnBindings, k);
|
|
103
|
+
if (fnBinding) {
|
|
104
|
+
// The attribute value for function bindings (&) must be of the form:
|
|
105
|
+
// on-foo="onFoo(arg1,arg2)"
|
|
106
|
+
// If not, the function will not be invoked. The argument names must
|
|
107
|
+
// also match those that the caller uses.
|
|
108
|
+
const params = fnBinding.params.join(",");
|
|
109
|
+
set(attrs, k, `${k}(${params})`);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
set(attrs, k, k);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return attrs;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
create(component, target, bindings) {
|
|
119
|
+
if (!(component in components)) {
|
|
120
|
+
console.warn(`"${component}" is not a component that can be created.`);
|
|
121
|
+
return Promise.reject();
|
|
122
|
+
}
|
|
123
|
+
return this.compileComponent(component, target, bindings).then((result) => {
|
|
124
|
+
this.detectChanges();
|
|
125
|
+
return result;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
compileAngularComponent(component, target, bindings) {
|
|
129
|
+
const factory = this.componentFactoryResolver.resolveComponentFactory(component);
|
|
130
|
+
const ref = factory.create(this.injector);
|
|
131
|
+
const instance = ref.instance;
|
|
132
|
+
const element = ref.hostView.rootNodes[0];
|
|
133
|
+
const subscriptions = [];
|
|
134
|
+
each(bindings, (v, k) => {
|
|
135
|
+
if (isFunction(v)) {
|
|
136
|
+
const sub = instance[k].subscribe(v);
|
|
137
|
+
subscriptions.push(sub);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
set(instance, k, v);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
this.appRef.attachView(ref.hostView);
|
|
144
|
+
target.append(element);
|
|
145
|
+
this.appRef.tick();
|
|
146
|
+
return Promise.resolve({
|
|
147
|
+
element,
|
|
148
|
+
destroy: () => {
|
|
149
|
+
this.appRef.detachView(ref.hostView);
|
|
150
|
+
ref.destroy();
|
|
151
|
+
each(subscriptions, s => s.unsubscribe());
|
|
152
|
+
this.detectChanges();
|
|
153
|
+
},
|
|
154
|
+
component: instance
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
ComponentApiService = __decorate([
|
|
159
|
+
Injectable()
|
|
160
|
+
], ComponentApiService);
|
|
161
|
+
export { ComponentApiService };
|
package/config/config-api.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ export interface ConfigApi {
|
|
|
87
87
|
* @method
|
|
88
88
|
* @description Registers a solution extension with the application.
|
|
89
89
|
* @param config {SolutionExtension} Solution extension configuration.
|
|
90
|
+
* @returns A Promise that resolves once the solution has been sent to the cache.
|
|
90
91
|
*/
|
|
91
|
-
registerSolutionExtension(config: SolutionExtension): void
|
|
92
|
+
registerSolutionExtension(config: SolutionExtension): Promise<void>;
|
|
92
93
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@angular/core";
|
|
8
|
+
import { map } from "rxjs/operators";
|
|
9
|
+
let ConfigApiService = class ConfigApiService {
|
|
10
|
+
constructor(networkConfigService, controlService) {
|
|
11
|
+
this.networkConfigService = networkConfigService;
|
|
12
|
+
this.controlService = controlService;
|
|
13
|
+
this.getSoftExpansionLimit = () => {
|
|
14
|
+
return this.networkConfigService.getSoftExpansionLimit().toPromise();
|
|
15
|
+
};
|
|
16
|
+
this.getHardExpansionLimit = () => {
|
|
17
|
+
return this.networkConfigService.getHardExpansionLimit().toPromise();
|
|
18
|
+
};
|
|
19
|
+
this.getSolutions = () => {
|
|
20
|
+
return this.solutions;
|
|
21
|
+
};
|
|
22
|
+
this.registerSolution = (key, label, version) => {
|
|
23
|
+
if (key && label && !this.solutions.has(key)) {
|
|
24
|
+
this.solutions.set(key, { label, version });
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.getSolutionExtension = (name) => {
|
|
28
|
+
return this.controlService
|
|
29
|
+
.whenInitialized()
|
|
30
|
+
.pipe(map(() => this.controlService.getControlByName(name)))
|
|
31
|
+
.toPromise();
|
|
32
|
+
};
|
|
33
|
+
this.registerSolutionExtension = (config) => {
|
|
34
|
+
return this.controlService.registerControl(config).toPromise();
|
|
35
|
+
};
|
|
36
|
+
this.solutions = new Map();
|
|
37
|
+
}
|
|
38
|
+
getApi() {
|
|
39
|
+
return {
|
|
40
|
+
getSoftExpansionLimit: this.getSoftExpansionLimit,
|
|
41
|
+
getHardExpansionLimit: this.getHardExpansionLimit,
|
|
42
|
+
getSolutions: this.getSolutions,
|
|
43
|
+
registerSolution: this.registerSolution,
|
|
44
|
+
getSolutionExtension: this.getSolutionExtension,
|
|
45
|
+
registerSolutionExtension: this.registerSolutionExtension
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
ConfigApiService = __decorate([
|
|
50
|
+
Injectable({
|
|
51
|
+
providedIn: "root"
|
|
52
|
+
})
|
|
53
|
+
], ConfigApiService);
|
|
54
|
+
export { ConfigApiService };
|
package/control/control-api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { FileChange, SASObjectAttachedFile, SASUploadedFile } from "../file/file
|
|
|
2
2
|
import { PageMode, PageModel } from "../page-model/page-model-api";
|
|
3
3
|
import { FieldType, FieldTypeToValue } from "./data-types";
|
|
4
4
|
import { PageDataChange, PageModeChange, StateChange } from "./events";
|
|
5
|
-
import { Control, RefreshablePageControlOptions, SlidingPanelProperties, TypeAttributes } from "./page";
|
|
5
|
+
import { Control, RefreshablePageControlOptions, SlidingPanelContent, SlidingPanelProperties, TypeAttributes } from "./page";
|
|
6
6
|
import { FieldTypeToRestrictions, FileRestrictions } from "./restrictions";
|
|
7
7
|
import { AttachmentFormData } from "./file";
|
|
8
8
|
/**
|
|
@@ -126,6 +126,11 @@ export interface ControlApi<ControlTypeAttributes extends TypeAttributes = TypeA
|
|
|
126
126
|
* @returns The aria label that should be applied.
|
|
127
127
|
*/
|
|
128
128
|
getAriaLabel: () => string;
|
|
129
|
+
/**
|
|
130
|
+
* Sets the value of the component specific API
|
|
131
|
+
* @param componentSpecificApi
|
|
132
|
+
*/
|
|
133
|
+
setComponentSpecificApi(componentSpecificApi?: any): void;
|
|
129
134
|
}
|
|
130
135
|
/**
|
|
131
136
|
* Methods and properties related to the state of the control.
|
|
@@ -275,9 +280,9 @@ export interface ControlPageApi extends ControlPageApiBase {
|
|
|
275
280
|
* @method
|
|
276
281
|
* @param handler {function} Function to be invoked on property change.
|
|
277
282
|
* Parameters are (category: string, property: string, currentValue: any, previousValue: any).
|
|
278
|
-
*
|
|
283
|
+
* @returns A function that stops the handler from being invoked.
|
|
279
284
|
*/
|
|
280
|
-
onPropertyChange(handler: (category: string, property: string, currentValue: any, previousValue: any) => void): void;
|
|
285
|
+
onPropertyChange(handler: (category: string, property: string, currentValue: any, previousValue: any) => void): () => void;
|
|
281
286
|
/**
|
|
282
287
|
* Returns the disabled status of the page toolbar.
|
|
283
288
|
* @method
|
|
@@ -312,25 +317,32 @@ export interface ControlPageApi extends ControlPageApiBase {
|
|
|
312
317
|
* By default, attempts to refresh all controls.
|
|
313
318
|
* Specify categoryToRefresh or controlToRefresh to restrict what is refreshed.
|
|
314
319
|
* @method
|
|
315
|
-
* @param categoryToRefresh {(string|undefined)} Name of the category to be refreshed.
|
|
320
|
+
* @param [categoryToRefresh] {(string|undefined)} Name of the category to be refreshed.
|
|
316
321
|
* @param [controlToRefresh] {Control} Individual control to be refreshed.
|
|
317
322
|
*/
|
|
318
|
-
reloadRefreshableControls(categoryToRefresh
|
|
323
|
+
reloadRefreshableControls(categoryToRefresh?: string, controlToRefresh?: Control): void;
|
|
319
324
|
/**
|
|
320
325
|
* Sets a page to be dirty, that is, when it has been edited and not saved.
|
|
321
326
|
* @method
|
|
322
327
|
*/
|
|
323
328
|
setPageDirty(): void;
|
|
329
|
+
/**
|
|
330
|
+
* Gets the dirty state of the page.
|
|
331
|
+
* @method
|
|
332
|
+
*/
|
|
333
|
+
getPageDirty(): boolean | undefined;
|
|
324
334
|
/**
|
|
325
335
|
* Toggle the page-level sliding panel. This panel should be used to contain information that is
|
|
326
336
|
* supplementary to the document, for example attachments or workflow tasks.
|
|
327
337
|
* @method
|
|
328
|
-
* @param sectionLabel {string} Describes the section, this should be internationalised.
|
|
329
|
-
* @param
|
|
330
|
-
* @param [panelProperties] {SlidingPanelProperties} Properties
|
|
338
|
+
* @param [sectionLabel] {string} Describes the section, this should be internationalised.
|
|
339
|
+
* @param [content] {SlidingPanelContent} The content of the sliding panel.
|
|
340
|
+
* @param [panelProperties] {SlidingPanelProperties} Properties for the panel.
|
|
341
|
+
* When providing a url for content: the panel properties will be available on the controller's "slidingPanel" object.
|
|
342
|
+
* When providing a selector for content: the properties will be set on the element to be created.
|
|
331
343
|
* @param [onClose] {function} A callback function invoked when the panel is dismissed. There are no parameters. Returns void.
|
|
332
344
|
*/
|
|
333
|
-
toggleSlidingPanel(sectionLabel
|
|
345
|
+
toggleSlidingPanel<T>(sectionLabel?: string, content?: SlidingPanelContent<T>, panelProperties?: SlidingPanelProperties, onClose?: () => void): void;
|
|
334
346
|
/**
|
|
335
347
|
* Checks if a page is in edit mode.
|
|
336
348
|
* @method
|
package/control/data-types.d.ts
CHANGED
|
@@ -6,4 +6,9 @@ export interface UserGroup {
|
|
|
6
6
|
type: "user" | "group";
|
|
7
7
|
}
|
|
8
8
|
export declare type FieldTypeToValue<Type extends FieldType> = Type extends "BOOLEAN" ? boolean : Type extends "STRING" | DateDataType | "REFERENCEDATA" ? string : Type extends NumberDataType ? number : Type extends "JSON" ? object : Type extends "USER_GROUP" ? UserGroup[] : never;
|
|
9
|
-
export declare type FieldValue = undefined | string | number | boolean | object | UserGroup;
|
|
9
|
+
export declare type FieldValue = undefined | string | number | boolean | object | UserGroup | Date | ChildObject[] | null;
|
|
10
|
+
export declare type ChildObject = {
|
|
11
|
+
id?: string;
|
|
12
|
+
isNew?: boolean;
|
|
13
|
+
fieldValues: Record<string, FieldValue>;
|
|
14
|
+
};
|
package/control/page.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Type } from "@angular/core";
|
|
1
2
|
export declare const enum PageModeEvent {
|
|
2
3
|
CREATE = "create",
|
|
3
4
|
EDIT = "edit",
|
|
@@ -49,6 +50,19 @@ export interface GlobalControlStates {
|
|
|
49
50
|
export interface SlidingPanelProperties {
|
|
50
51
|
[property: string]: any;
|
|
51
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Represents the content of a sliding panel.
|
|
55
|
+
*/
|
|
56
|
+
export interface SlidingPanelContent<T> {
|
|
57
|
+
/**
|
|
58
|
+
* The name of a custom element to be created in the content pane.
|
|
59
|
+
*/
|
|
60
|
+
customElementName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* An Angular component to be included in the content pane.
|
|
63
|
+
*/
|
|
64
|
+
instanceClass?: Type<T>;
|
|
65
|
+
}
|
|
52
66
|
export interface RefreshablePageControlOptions {
|
|
53
67
|
refreshCategory?: string;
|
|
54
68
|
requiresIndex?: boolean;
|
|
@@ -10,7 +10,8 @@ export interface ToolbarPropertyApi {
|
|
|
10
10
|
* Registers a function to be invoked whenever one of the calling toolbar control's properties change.
|
|
11
11
|
* @method
|
|
12
12
|
* @param handler The function to be invoked.
|
|
13
|
+
* @returns A function that stops the handler from being invoked.
|
|
13
14
|
*/
|
|
14
|
-
onPropertyChange(handler: (category: string, property: string, currentValue: any, previousValue: any) => void): void;
|
|
15
|
+
onPropertyChange(handler: (category: string, property: string, currentValue: any, previousValue: any) => void): () => void;
|
|
15
16
|
};
|
|
16
17
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@angular/core";
|
|
8
|
+
import { pick } from "lodash-es";
|
|
9
|
+
let CurrentUserApiService = class CurrentUserApiService {
|
|
10
|
+
constructor(configurationService, featureService, identitiesService) {
|
|
11
|
+
this.configurationService = configurationService;
|
|
12
|
+
this.featureService = featureService;
|
|
13
|
+
this.identitiesService = identitiesService;
|
|
14
|
+
this.getSessionDetails = () => {
|
|
15
|
+
return pick(this.configurationService.getSessionDetails(), [
|
|
16
|
+
"authorizedFeatures",
|
|
17
|
+
"displayName",
|
|
18
|
+
"id",
|
|
19
|
+
"softwareVersionNumber"
|
|
20
|
+
]);
|
|
21
|
+
};
|
|
22
|
+
this.getUserDetails = () => {
|
|
23
|
+
return this.identitiesService.getUserDetails(this.userId).toPromise();
|
|
24
|
+
};
|
|
25
|
+
this.getUserMemberships = () => {
|
|
26
|
+
return this.identitiesService.getUserMemberships(this.userId).toPromise();
|
|
27
|
+
};
|
|
28
|
+
this.hasAdminFeatures = () => {
|
|
29
|
+
return this.featureService.hasAdminFeatures();
|
|
30
|
+
};
|
|
31
|
+
this.hasFeatures = (features) => {
|
|
32
|
+
return this.featureService.hasRequiredFeatures(features);
|
|
33
|
+
};
|
|
34
|
+
this.userId = configurationService.getSessionDetails().id;
|
|
35
|
+
}
|
|
36
|
+
getApi() {
|
|
37
|
+
return {
|
|
38
|
+
getSessionDetails: this.getSessionDetails,
|
|
39
|
+
getUserDetails: this.getUserDetails,
|
|
40
|
+
getUserMemberships: this.getUserMemberships,
|
|
41
|
+
hasAdminFeatures: this.hasAdminFeatures,
|
|
42
|
+
hasFeatures: this.hasFeatures
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
CurrentUserApiService = __decorate([
|
|
47
|
+
Injectable()
|
|
48
|
+
], CurrentUserApiService);
|
|
49
|
+
export { CurrentUserApiService };
|
package/event/event-api.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare enum PageEvents {
|
|
|
8
8
|
ModeChangeEvent = "spb::page-mode-change",
|
|
9
9
|
ModelChangeEvent = "spb::page-model-change",
|
|
10
10
|
PanelOpenEvent = "spb::sliding-panel-open",
|
|
11
|
+
RefreshAttachmentsGrid = "spb::refreshAttachmentsGrid",
|
|
11
12
|
RefreshPageEvent = "spb::refreshPage",
|
|
12
13
|
SelectAttachmentEvent = "spb::Highlighting:SelectAttachment",
|
|
13
14
|
SelectChildObjectEvent = "spb::Highlighting:SelectChildObject",
|
package/event/event-api.js
CHANGED
|
@@ -9,6 +9,7 @@ export var PageEvents;
|
|
|
9
9
|
PageEvents["ModeChangeEvent"] = "spb::page-mode-change";
|
|
10
10
|
PageEvents["ModelChangeEvent"] = "spb::page-model-change";
|
|
11
11
|
PageEvents["PanelOpenEvent"] = "spb::sliding-panel-open";
|
|
12
|
+
PageEvents["RefreshAttachmentsGrid"] = "spb::refreshAttachmentsGrid";
|
|
12
13
|
PageEvents["RefreshPageEvent"] = "spb::refreshPage";
|
|
13
14
|
PageEvents["SelectAttachmentEvent"] = "spb::Highlighting:SelectAttachment";
|
|
14
15
|
PageEvents["SelectChildObjectEvent"] = "spb::Highlighting:SelectChildObject";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@angular/core";
|
|
8
|
+
let EventApiService = class EventApiService {
|
|
9
|
+
constructor(eventService) {
|
|
10
|
+
this.eventService = eventService;
|
|
11
|
+
this.publish = (eventName, payload) => {
|
|
12
|
+
this.eventService.publish(eventName, payload);
|
|
13
|
+
};
|
|
14
|
+
this.subscribe = (eventName, observer) => {
|
|
15
|
+
return this.eventService.subscribe(eventName, observer);
|
|
16
|
+
};
|
|
17
|
+
this.unsubscribe = (subscription) => {
|
|
18
|
+
this.eventService.unsubscribe(subscription);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
getApi() {
|
|
22
|
+
return {
|
|
23
|
+
publish: this.publish,
|
|
24
|
+
subscribe: this.subscribe,
|
|
25
|
+
unsubscribe: this.unsubscribe
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
EventApiService = __decorate([
|
|
30
|
+
Injectable()
|
|
31
|
+
], EventApiService);
|
|
32
|
+
export { EventApiService };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@angular/core";
|
|
8
|
+
let FileApiService = class FileApiService {
|
|
9
|
+
constructor(sviFilesService) {
|
|
10
|
+
this.sviFilesService = sviFilesService;
|
|
11
|
+
this.uploadToViFolder = (file, fileName) => {
|
|
12
|
+
return this.sviFilesService.uploadFileToViFolderFromFile(file, fileName).toPromise();
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
getApi() {
|
|
16
|
+
return {
|
|
17
|
+
uploadToViFolder: this.uploadToViFolder
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
FileApiService = __decorate([
|
|
22
|
+
Injectable()
|
|
23
|
+
], FileApiService);
|
|
24
|
+
export { FileApiService };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@angular/core";
|
|
8
|
+
let HttpApiService = class HttpApiService {
|
|
9
|
+
constructor(httpClient) {
|
|
10
|
+
this.httpClient = httpClient;
|
|
11
|
+
this.getApi = () => {
|
|
12
|
+
return {
|
|
13
|
+
get: this.get.bind(this),
|
|
14
|
+
head: this.head.bind(this),
|
|
15
|
+
post: this.post.bind(this),
|
|
16
|
+
put: this.put.bind(this),
|
|
17
|
+
patch: this.patch.bind(this),
|
|
18
|
+
delete: this.delete.bind(this),
|
|
19
|
+
options: this.options.bind(this),
|
|
20
|
+
request: this.request.bind(this)
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
get(url, options) {
|
|
25
|
+
return this.httpClient.get(url, options);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {Object} HttpApiService~HeadOptions
|
|
29
|
+
* @property [headers] {Record<string, string | string[]>}
|
|
30
|
+
* @property [params] {Record<string, string | string[]>}
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a `HEAD` request that returns a null body and the full HttpResponse.
|
|
34
|
+
*
|
|
35
|
+
* @param url {string} Endpoint URL.
|
|
36
|
+
* @param options {HttpApiService~HeadOptions} HTTP options to send with the request.
|
|
37
|
+
* @return {Promise<HttpResponse<null>>} A Promise of the HttpResponse for the request with the response body of null.
|
|
38
|
+
*/
|
|
39
|
+
head(url, options) {
|
|
40
|
+
return this.httpClient.head(url, options);
|
|
41
|
+
}
|
|
42
|
+
post(url, body, options) {
|
|
43
|
+
return this.httpClient.post(url, body, options);
|
|
44
|
+
}
|
|
45
|
+
put(url, body, options) {
|
|
46
|
+
return this.httpClient.put(url, body, options);
|
|
47
|
+
}
|
|
48
|
+
patch(url, body, options) {
|
|
49
|
+
return this.httpClient.patch(url, body, options);
|
|
50
|
+
}
|
|
51
|
+
delete(url, options) {
|
|
52
|
+
return this.httpClient.delete(url, options);
|
|
53
|
+
}
|
|
54
|
+
options(url, options) {
|
|
55
|
+
return this.httpClient.options(url, options);
|
|
56
|
+
}
|
|
57
|
+
request(method, url, options) {
|
|
58
|
+
return this.httpClient.request(method, url, options);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
HttpApiService = __decorate([
|
|
62
|
+
Injectable()
|
|
63
|
+
], HttpApiService);
|
|
64
|
+
export { HttpApiService };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@angular/core";
|
|
8
|
+
let LocalizationApiService = class LocalizationApiService {
|
|
9
|
+
constructor(formatterService, configurationService) {
|
|
10
|
+
this.formatterService = formatterService;
|
|
11
|
+
this.configurationService = configurationService;
|
|
12
|
+
this.getLocalizedDateTimeFormat = (showTime = true) => {
|
|
13
|
+
if (showTime) {
|
|
14
|
+
return this.formatterService.momentShortDateTimeFormatString();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return this.formatterService.momentShortDateFormatString();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
this.getLocale = () => {
|
|
21
|
+
return this.configurationService.getUserLocale();
|
|
22
|
+
};
|
|
23
|
+
this.getDirection = () => {
|
|
24
|
+
return this.configurationService.getUserDirection();
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
getApi() {
|
|
28
|
+
return {
|
|
29
|
+
getLocalizedDateTimeFormat: this.getLocalizedDateTimeFormat,
|
|
30
|
+
getLocale: this.getLocale,
|
|
31
|
+
getDirection: this.getDirection
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
LocalizationApiService = __decorate([
|
|
36
|
+
Injectable()
|
|
37
|
+
], LocalizationApiService);
|
|
38
|
+
export { LocalizationApiService };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@angular/core";
|
|
8
|
+
import { getAngularJsInjectable } from "../../../commons/angular-angularjs-utils";
|
|
9
|
+
import { MetadataApiService } from "../metadata-api.service";
|
|
10
|
+
let AdminMetadataApiService = class AdminMetadataApiService extends MetadataApiService {
|
|
11
|
+
constructor(linksMetadataService, picklistService, sandMetadataService, spbEntityMetadataService, resourceService) {
|
|
12
|
+
super(linksMetadataService, picklistService, sandMetadataService, spbEntityMetadataService);
|
|
13
|
+
this.resourceService = resourceService;
|
|
14
|
+
this.getFieldDataTypeLabels = () => {
|
|
15
|
+
const fdhResources = this.resourceService.getResources().fdh;
|
|
16
|
+
const documentSvc = getAngularJsInjectable("documentSvc");
|
|
17
|
+
return documentSvc.getFieldDataTypeLabels(fdhResources);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
getApi() {
|
|
21
|
+
return {
|
|
22
|
+
...super.getApi(),
|
|
23
|
+
getFieldDataTypeLabels: this.getFieldDataTypeLabels
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
AdminMetadataApiService = __decorate([
|
|
28
|
+
Injectable()
|
|
29
|
+
], AdminMetadataApiService);
|
|
30
|
+
export { AdminMetadataApiService };
|
|
@@ -24,6 +24,7 @@ export interface SandDataObject extends DataObject {
|
|
|
24
24
|
attachmentsIndexedForSearch?: boolean;
|
|
25
25
|
resolvedEntity?: boolean;
|
|
26
26
|
indexedForSearch?: boolean;
|
|
27
|
+
requireSearchBeforeCreate?: boolean;
|
|
27
28
|
}
|
|
28
29
|
export interface DataObject extends PersistableObject {
|
|
29
30
|
name: string;
|
|
@@ -208,6 +209,8 @@ export interface MetadataApi {
|
|
|
208
209
|
*/
|
|
209
210
|
getIconForEntity(objectType: string, iconType?: string): string | undefined;
|
|
210
211
|
/**
|
|
212
|
+
* @deprecated Use `getRootTypes()` and `getResolvedEntities()` instead.
|
|
213
|
+
*
|
|
211
214
|
* @method
|
|
212
215
|
* @description Gets metadata for both entities and resolved entities
|
|
213
216
|
* @returns A promise resolving to Search entity metadata.
|