@smartbit4all/ng-client 1.0.12 → 1.0.14
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/esm2020/lib/smart-client/smart-component-api-client.mjs +40 -16
- package/esm2020/lib/smart-client/smart.component.mjs +12 -13
- package/esm2020/lib/smart-client/smart.service.mjs +12 -13
- package/esm2020/lib/view-context/api/api/view.service.mjs +118 -1
- package/esm2020/lib/view-context/smart-ui-action/ui-action-toolbar.component.mjs +13 -13
- package/esm2020/lib/view-context/smart-ui-action/ui-action.model.mjs +1 -1
- package/esm2020/lib/view-context/smart-ui-action/ui-action.service.mjs +18 -19
- package/esm2020/lib/view-context/smart-view-context.service.mjs +37 -33
- package/fesm2015/smartbit4all-ng-client.mjs +229 -80
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +221 -78
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +13 -7
- package/lib/smart-client/smart.component.d.ts +4 -5
- package/lib/smart-client/smart.service.d.ts +4 -5
- package/lib/view-context/api/api/view.service.d.ts +41 -0
- package/lib/view-context/smart-ui-action/ui-action-toolbar.component.d.ts +5 -5
- package/lib/view-context/smart-ui-action/ui-action.model.d.ts +3 -3
- package/lib/view-context/smart-ui-action/ui-action.service.d.ts +16 -6
- package/lib/view-context/smart-view-context.service.d.ts +10 -7
- package/package.json +1 -1
- package/smartbit4all-ng-client-1.0.14.tgz +0 -0
- package/smartbit4all-ng-client-1.0.12.tgz +0 -0
|
@@ -1413,6 +1413,123 @@ class ViewService {
|
|
|
1413
1413
|
reportProgress: reportProgress
|
|
1414
1414
|
});
|
|
1415
1415
|
}
|
|
1416
|
+
performWidgetAction(uuid, widgetId, nodeId, body, observe = 'body', reportProgress = false, options) {
|
|
1417
|
+
if (uuid === null || uuid === undefined) {
|
|
1418
|
+
throw new Error('Required parameter uuid was null or undefined when calling performWidgetAction.');
|
|
1419
|
+
}
|
|
1420
|
+
if (widgetId === null || widgetId === undefined) {
|
|
1421
|
+
throw new Error('Required parameter widgetId was null or undefined when calling performWidgetAction.');
|
|
1422
|
+
}
|
|
1423
|
+
if (nodeId === null || nodeId === undefined) {
|
|
1424
|
+
throw new Error('Required parameter nodeId was null or undefined when calling performWidgetAction.');
|
|
1425
|
+
}
|
|
1426
|
+
if (body === null || body === undefined) {
|
|
1427
|
+
throw new Error('Required parameter body was null or undefined when calling performWidgetAction.');
|
|
1428
|
+
}
|
|
1429
|
+
let localVarHeaders = this.defaultHeaders;
|
|
1430
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
1431
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
1432
|
+
// to determine the Accept header
|
|
1433
|
+
const httpHeaderAccepts = [
|
|
1434
|
+
'application/json'
|
|
1435
|
+
];
|
|
1436
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
1437
|
+
}
|
|
1438
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
1439
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
1440
|
+
}
|
|
1441
|
+
let localVarHttpContext = options && options.context;
|
|
1442
|
+
if (localVarHttpContext === undefined) {
|
|
1443
|
+
localVarHttpContext = new HttpContext();
|
|
1444
|
+
}
|
|
1445
|
+
// to determine the Content-Type header
|
|
1446
|
+
const consumes = [
|
|
1447
|
+
'application/json'
|
|
1448
|
+
];
|
|
1449
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
1450
|
+
if (httpContentTypeSelected !== undefined) {
|
|
1451
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
1452
|
+
}
|
|
1453
|
+
let responseType_ = 'json';
|
|
1454
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
1455
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
1456
|
+
responseType_ = 'text';
|
|
1457
|
+
}
|
|
1458
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
1459
|
+
responseType_ = 'json';
|
|
1460
|
+
}
|
|
1461
|
+
else {
|
|
1462
|
+
responseType_ = 'blob';
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
let localVarPath = `/component/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "widgetId", value: widgetId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/${this.configuration.encodeParam({ name: "nodeId", value: nodeId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/action`;
|
|
1466
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
1467
|
+
context: localVarHttpContext,
|
|
1468
|
+
body: body,
|
|
1469
|
+
responseType: responseType_,
|
|
1470
|
+
withCredentials: this.configuration.withCredentials,
|
|
1471
|
+
headers: localVarHeaders,
|
|
1472
|
+
observe: observe,
|
|
1473
|
+
reportProgress: reportProgress
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
performWidgetMainAction(uuid, widgetId, body, observe = 'body', reportProgress = false, options) {
|
|
1477
|
+
if (uuid === null || uuid === undefined) {
|
|
1478
|
+
throw new Error('Required parameter uuid was null or undefined when calling performWidgetMainAction.');
|
|
1479
|
+
}
|
|
1480
|
+
if (widgetId === null || widgetId === undefined) {
|
|
1481
|
+
throw new Error('Required parameter widgetId was null or undefined when calling performWidgetMainAction.');
|
|
1482
|
+
}
|
|
1483
|
+
if (body === null || body === undefined) {
|
|
1484
|
+
throw new Error('Required parameter body was null or undefined when calling performWidgetMainAction.');
|
|
1485
|
+
}
|
|
1486
|
+
let localVarHeaders = this.defaultHeaders;
|
|
1487
|
+
let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept;
|
|
1488
|
+
if (localVarHttpHeaderAcceptSelected === undefined) {
|
|
1489
|
+
// to determine the Accept header
|
|
1490
|
+
const httpHeaderAccepts = [
|
|
1491
|
+
'application/json'
|
|
1492
|
+
];
|
|
1493
|
+
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
|
1494
|
+
}
|
|
1495
|
+
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
|
1496
|
+
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
|
|
1497
|
+
}
|
|
1498
|
+
let localVarHttpContext = options && options.context;
|
|
1499
|
+
if (localVarHttpContext === undefined) {
|
|
1500
|
+
localVarHttpContext = new HttpContext();
|
|
1501
|
+
}
|
|
1502
|
+
// to determine the Content-Type header
|
|
1503
|
+
const consumes = [
|
|
1504
|
+
'application/json'
|
|
1505
|
+
];
|
|
1506
|
+
const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes);
|
|
1507
|
+
if (httpContentTypeSelected !== undefined) {
|
|
1508
|
+
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
|
|
1509
|
+
}
|
|
1510
|
+
let responseType_ = 'json';
|
|
1511
|
+
if (localVarHttpHeaderAcceptSelected) {
|
|
1512
|
+
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
|
|
1513
|
+
responseType_ = 'text';
|
|
1514
|
+
}
|
|
1515
|
+
else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
|
|
1516
|
+
responseType_ = 'json';
|
|
1517
|
+
}
|
|
1518
|
+
else {
|
|
1519
|
+
responseType_ = 'blob';
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
let localVarPath = `/component/${this.configuration.encodeParam({ name: "uuid", value: uuid, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid" })}/${this.configuration.encodeParam({ name: "widgetId", value: widgetId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/action`;
|
|
1523
|
+
return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, {
|
|
1524
|
+
context: localVarHttpContext,
|
|
1525
|
+
body: body,
|
|
1526
|
+
responseType: responseType_,
|
|
1527
|
+
withCredentials: this.configuration.withCredentials,
|
|
1528
|
+
headers: localVarHeaders,
|
|
1529
|
+
observe: observe,
|
|
1530
|
+
reportProgress: reportProgress
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1416
1533
|
showPublishedView(channel, uuid, observe = 'body', reportProgress = false, options) {
|
|
1417
1534
|
if (channel === null || channel === undefined) {
|
|
1418
1535
|
throw new Error('Required parameter channel was null or undefined when calling showPublishedView.');
|
|
@@ -1791,8 +1908,8 @@ class SmartViewContextService {
|
|
|
1791
1908
|
this.session = session;
|
|
1792
1909
|
this.navigation = navigation;
|
|
1793
1910
|
this.dialog = dialog;
|
|
1794
|
-
this.tabIdName =
|
|
1795
|
-
this.tabIdhttpHeaderName =
|
|
1911
|
+
this.tabIdName = 'viewContextUuid';
|
|
1912
|
+
this.tabIdhttpHeaderName = 'viewContextUuid';
|
|
1796
1913
|
this.viewHandlers = new Array();
|
|
1797
1914
|
this.openedViewUuids = new Array();
|
|
1798
1915
|
this.uuidOfPageHasBeenChanged = new Subject();
|
|
@@ -1825,7 +1942,7 @@ class SmartViewContextService {
|
|
|
1825
1942
|
}
|
|
1826
1943
|
getActionDescriptors() {
|
|
1827
1944
|
if (!this.actionDescriptors) {
|
|
1828
|
-
console.error(
|
|
1945
|
+
console.error('No action descriptors has been set to ViewContext.');
|
|
1829
1946
|
}
|
|
1830
1947
|
return this.actionDescriptors;
|
|
1831
1948
|
}
|
|
@@ -1846,7 +1963,7 @@ class SmartViewContextService {
|
|
|
1846
1963
|
this.view.configuration.basePath = this.url;
|
|
1847
1964
|
}
|
|
1848
1965
|
setUrl(url) {
|
|
1849
|
-
this.url = url +
|
|
1966
|
+
this.url = url + '/view';
|
|
1850
1967
|
this.setUpUrlForViewService();
|
|
1851
1968
|
}
|
|
1852
1969
|
getAndSyncViewContext(uuid) {
|
|
@@ -1863,7 +1980,7 @@ class SmartViewContextService {
|
|
|
1863
1980
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1864
1981
|
this.viewContext = yield this.view.getViewContext(uuid).toPromise();
|
|
1865
1982
|
if (!this.viewContext) {
|
|
1866
|
-
throw new Error(
|
|
1983
|
+
throw new Error('ViewContext does not exist with the given uuid.');
|
|
1867
1984
|
}
|
|
1868
1985
|
return this.viewContext;
|
|
1869
1986
|
});
|
|
@@ -1874,7 +1991,7 @@ class SmartViewContextService {
|
|
|
1874
1991
|
if (!this.viewContext) {
|
|
1875
1992
|
let viewContextUuid = sessionStorage.getItem(this.tabIdName);
|
|
1876
1993
|
if (!viewContextUuid) {
|
|
1877
|
-
throw new Error(
|
|
1994
|
+
throw new Error('View context is not initialized!');
|
|
1878
1995
|
}
|
|
1879
1996
|
yield this.getViewContext(viewContextUuid);
|
|
1880
1997
|
}
|
|
@@ -1902,11 +2019,9 @@ class SmartViewContextService {
|
|
|
1902
2019
|
startViewContext() {
|
|
1903
2020
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1904
2021
|
this.clearSessionStorage();
|
|
1905
|
-
let newViewContext = yield this.view
|
|
1906
|
-
.createViewContext()
|
|
1907
|
-
.toPromise();
|
|
2022
|
+
let newViewContext = yield this.view.createViewContext().toPromise();
|
|
1908
2023
|
if (!newViewContext) {
|
|
1909
|
-
throw new Error(
|
|
2024
|
+
throw new Error('No ViewContext was created');
|
|
1910
2025
|
}
|
|
1911
2026
|
this.viewContext = newViewContext;
|
|
1912
2027
|
this.setTabId(newViewContext.uuid);
|
|
@@ -1919,7 +2034,7 @@ class SmartViewContextService {
|
|
|
1919
2034
|
throw new Error("There aren't any viewHandlers in SmartViewContextService! Provide some to use its functions.");
|
|
1920
2035
|
}
|
|
1921
2036
|
if (!this.messageDialogname) {
|
|
1922
|
-
throw new Error(
|
|
2037
|
+
throw new Error('The messageDialogName provided by the backend has not been set.');
|
|
1923
2038
|
}
|
|
1924
2039
|
if (uuid) {
|
|
1925
2040
|
let subscription = this.session.headersUpdated.subscribe(() => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1965,10 +2080,10 @@ class SmartViewContextService {
|
|
|
1965
2080
|
if (viewHandler.route === undefined) {
|
|
1966
2081
|
throw new Error(`Route is undefined in SmartViewHandlerModel with name: ${view.viewName}`);
|
|
1967
2082
|
}
|
|
1968
|
-
this.navigation.navigateTo(viewHandler.route.split(
|
|
2083
|
+
this.navigation.navigateTo(viewHandler.route.split('/'));
|
|
1969
2084
|
}
|
|
1970
2085
|
else {
|
|
1971
|
-
throw new Error(
|
|
2086
|
+
throw new Error('The type of the view and its viewHandler is not the same!');
|
|
1972
2087
|
}
|
|
1973
2088
|
view.state = ViewState.Opened;
|
|
1974
2089
|
this.openedViewUuids.push(view.uuid);
|
|
@@ -1998,7 +2113,7 @@ class SmartViewContextService {
|
|
|
1998
2113
|
this.dialogRefs.splice(index, 1);
|
|
1999
2114
|
}
|
|
2000
2115
|
else {
|
|
2001
|
-
throw new Error(
|
|
2116
|
+
throw new Error('DialogRef is not found by uuid.');
|
|
2002
2117
|
}
|
|
2003
2118
|
}
|
|
2004
2119
|
else if (view.type === ViewType.Normal) {
|
|
@@ -2006,7 +2121,7 @@ class SmartViewContextService {
|
|
|
2006
2121
|
// this.navigation.navigateTo(viewHandler.route.split("/"));
|
|
2007
2122
|
}
|
|
2008
2123
|
else {
|
|
2009
|
-
throw new Error(
|
|
2124
|
+
throw new Error('The type of the view and its viewHandler is not the same!');
|
|
2010
2125
|
}
|
|
2011
2126
|
view.state = ViewState.Closed;
|
|
2012
2127
|
this.openedViewUuids.slice(this.openedViewUuids.indexOf(view.uuid), 1);
|
|
@@ -2055,9 +2170,7 @@ class SmartViewContextService {
|
|
|
2055
2170
|
message(messageData, messageResult) {
|
|
2056
2171
|
var _a;
|
|
2057
2172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2058
|
-
yield this.view
|
|
2059
|
-
.message((_a = messageData.viewUuid) !== null && _a !== void 0 ? _a : "", messageData.uuid, messageResult)
|
|
2060
|
-
.toPromise();
|
|
2173
|
+
yield this.view.message((_a = messageData.viewUuid) !== null && _a !== void 0 ? _a : '', messageData.uuid, messageResult).toPromise();
|
|
2061
2174
|
yield this.getAndSyncViewContext();
|
|
2062
2175
|
});
|
|
2063
2176
|
}
|
|
@@ -2065,9 +2178,9 @@ class SmartViewContextService {
|
|
|
2065
2178
|
if (!this.smartViewContextApiErrors) {
|
|
2066
2179
|
return {
|
|
2067
2180
|
code,
|
|
2068
|
-
message:
|
|
2069
|
-
buttonLabel:
|
|
2070
|
-
dialogTitle:
|
|
2181
|
+
message: 'An error has occured.',
|
|
2182
|
+
buttonLabel: 'Ok',
|
|
2183
|
+
dialogTitle: 'Hiba',
|
|
2071
2184
|
};
|
|
2072
2185
|
}
|
|
2073
2186
|
let apiErrorsWithCode = this.smartViewContextApiErrors.viewContextApiErrors.filter((apiError) => {
|
|
@@ -2077,9 +2190,9 @@ class SmartViewContextService {
|
|
|
2077
2190
|
console.error(`SmartViewContextApiError with code ${code} could not be found.`);
|
|
2078
2191
|
return {
|
|
2079
2192
|
code,
|
|
2080
|
-
message:
|
|
2081
|
-
buttonLabel:
|
|
2082
|
-
dialogTitle:
|
|
2193
|
+
message: 'An error has occured.',
|
|
2194
|
+
buttonLabel: 'Ok',
|
|
2195
|
+
dialogTitle: 'Hiba',
|
|
2083
2196
|
};
|
|
2084
2197
|
}
|
|
2085
2198
|
return apiErrorsWithCode[0];
|
|
@@ -2088,7 +2201,7 @@ class SmartViewContextService {
|
|
|
2088
2201
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2089
2202
|
let viewConstraintResponse = yield this.view.getViewConstraint(uuid).toPromise();
|
|
2090
2203
|
if (!viewConstraintResponse)
|
|
2091
|
-
throw new Error(
|
|
2204
|
+
throw new Error('Could not get ViewConstraint with the given uuid.');
|
|
2092
2205
|
return viewConstraintResponse;
|
|
2093
2206
|
});
|
|
2094
2207
|
}
|
|
@@ -2112,7 +2225,21 @@ class SmartViewContextService {
|
|
|
2112
2225
|
}
|
|
2113
2226
|
performAction(uuid, uiActionRequest) {
|
|
2114
2227
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2115
|
-
|
|
2228
|
+
return yield this.handlePerformActionResponse(yield this.view.performAction(uuid, uiActionRequest).toPromise());
|
|
2229
|
+
});
|
|
2230
|
+
}
|
|
2231
|
+
performWidgetAction(uuid, widgetId, nodeId, uiActionRequest) {
|
|
2232
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2233
|
+
return yield this.handlePerformActionResponse(yield this.view.performWidgetAction(uuid, widgetId, nodeId, uiActionRequest).toPromise());
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
performWidgetMainAction(uuid, widgetId, uiActionRequest) {
|
|
2237
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2238
|
+
return yield this.handlePerformActionResponse(yield this.view.performWidgetMainAction(uuid, widgetId, uiActionRequest).toPromise());
|
|
2239
|
+
});
|
|
2240
|
+
}
|
|
2241
|
+
handlePerformActionResponse(viewContextChange) {
|
|
2242
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2116
2243
|
this.viewContext = viewContextChange === null || viewContextChange === void 0 ? void 0 : viewContextChange.viewContext;
|
|
2117
2244
|
this.syncView();
|
|
2118
2245
|
if (viewContextChange === null || viewContextChange === void 0 ? void 0 : viewContextChange.changes) {
|
|
@@ -2135,11 +2262,11 @@ class SmartViewContextService {
|
|
|
2135
2262
|
}
|
|
2136
2263
|
}
|
|
2137
2264
|
SmartViewContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextService, deps: [{ token: ViewService }, { token: SmartSessionService }, { token: i3$1.SmartNavigationService }, { token: i4.SmartdialogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2138
|
-
SmartViewContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextService, providedIn:
|
|
2265
|
+
SmartViewContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextService, providedIn: 'root' });
|
|
2139
2266
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartViewContextService, decorators: [{
|
|
2140
2267
|
type: Injectable,
|
|
2141
2268
|
args: [{
|
|
2142
|
-
providedIn:
|
|
2269
|
+
providedIn: 'root',
|
|
2143
2270
|
}]
|
|
2144
2271
|
}], ctorParameters: function () { return [{ type: ViewService }, { type: SmartSessionService }, { type: i3$1.SmartNavigationService }, { type: i4.SmartdialogService }]; } });
|
|
2145
2272
|
|
|
@@ -3254,7 +3381,7 @@ class UiActionService {
|
|
|
3254
3381
|
this.textFieldDialogService = textFieldDialogService;
|
|
3255
3382
|
this._snackBar = _snackBar;
|
|
3256
3383
|
}
|
|
3257
|
-
execute(uiAction) {
|
|
3384
|
+
execute(uiAction, options) {
|
|
3258
3385
|
var _a;
|
|
3259
3386
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3260
3387
|
let uiActionRequest;
|
|
@@ -3287,7 +3414,7 @@ class UiActionService {
|
|
|
3287
3414
|
}
|
|
3288
3415
|
// InputType
|
|
3289
3416
|
if (uiAction.inputType) {
|
|
3290
|
-
uiActionRequest = yield this.handleInputType(uiAction.inputType, uiAction, uiActionRequest,
|
|
3417
|
+
uiActionRequest = yield this.handleInputType(uiAction.inputType, uiAction, uiActionRequest, 'inputDialog');
|
|
3291
3418
|
if (!uiActionRequest) {
|
|
3292
3419
|
return;
|
|
3293
3420
|
}
|
|
@@ -3295,7 +3422,7 @@ class UiActionService {
|
|
|
3295
3422
|
}
|
|
3296
3423
|
// Input2Type
|
|
3297
3424
|
if (uiAction.input2Type) {
|
|
3298
|
-
uiActionRequest = yield this.handleInputType(uiAction.input2Type, uiAction, uiActionRequest,
|
|
3425
|
+
uiActionRequest = yield this.handleInputType(uiAction.input2Type, uiAction, uiActionRequest, 'input2Dialog');
|
|
3299
3426
|
if (!uiActionRequest) {
|
|
3300
3427
|
return;
|
|
3301
3428
|
}
|
|
@@ -3307,7 +3434,7 @@ class UiActionService {
|
|
|
3307
3434
|
}
|
|
3308
3435
|
uiActionRequest = response.uiActionRequest;
|
|
3309
3436
|
}
|
|
3310
|
-
this.performAction(uiAction, uiActionRequest);
|
|
3437
|
+
this.performAction(uiAction, uiActionRequest, options);
|
|
3311
3438
|
});
|
|
3312
3439
|
}
|
|
3313
3440
|
handleInputType(inputType, uiAction, uiActionRequest, inputTypeName) {
|
|
@@ -3328,7 +3455,7 @@ class UiActionService {
|
|
|
3328
3455
|
handleInputTypeTextField(inputTypeName, uiAction, uiActionRequest) {
|
|
3329
3456
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3330
3457
|
let additionalParams = this.uiActionModel.serviceToUse.getAdditionalParams(uiAction);
|
|
3331
|
-
let inputType = inputTypeName ===
|
|
3458
|
+
let inputType = inputTypeName === 'inputDialog' ? 'inputType' : 'input2Type';
|
|
3332
3459
|
if (uiAction[inputType] === UiActionInputType.Textfield) {
|
|
3333
3460
|
this.textFieldDialogService.nodeName = additionalParams.forTextField;
|
|
3334
3461
|
}
|
|
@@ -3341,7 +3468,7 @@ class UiActionService {
|
|
|
3341
3468
|
yield this.textFieldDialogService.onAction.toPromise();
|
|
3342
3469
|
let params = this.textFieldDialogService.params;
|
|
3343
3470
|
if (!params) {
|
|
3344
|
-
console.error(
|
|
3471
|
+
console.error('There was no response from InputDialog');
|
|
3345
3472
|
return;
|
|
3346
3473
|
}
|
|
3347
3474
|
uiActionRequest.params = Object.assign(Object.assign({}, uiActionRequest.params), params);
|
|
@@ -3358,20 +3485,19 @@ class UiActionService {
|
|
|
3358
3485
|
return uiActionRequest;
|
|
3359
3486
|
});
|
|
3360
3487
|
}
|
|
3361
|
-
performAction(uiAction, uiActionRequest) {
|
|
3488
|
+
performAction(uiAction, uiActionRequest, options) {
|
|
3362
3489
|
var _a;
|
|
3363
3490
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3364
|
-
if (!uiActionRequest.params ||
|
|
3365
|
-
(uiActionRequest.params && !Object.keys(uiActionRequest.params).length)) {
|
|
3491
|
+
if (!uiActionRequest.params || (uiActionRequest.params && !Object.keys(uiActionRequest.params).length)) {
|
|
3366
3492
|
uiActionRequest.params = {
|
|
3367
3493
|
model: this.uiActionModel.serviceToUse.getModel(),
|
|
3368
3494
|
};
|
|
3369
3495
|
}
|
|
3370
3496
|
else if (uiAction.submit) {
|
|
3371
|
-
uiActionRequest.params[
|
|
3497
|
+
uiActionRequest.params['model'] = this.uiActionModel.serviceToUse.getModel();
|
|
3372
3498
|
}
|
|
3373
3499
|
try {
|
|
3374
|
-
yield this.uiActionModel.serviceToUse.performUiActionRequest(uiActionRequest);
|
|
3500
|
+
yield this.uiActionModel.serviceToUse.performUiActionRequest(uiActionRequest, options === null || options === void 0 ? void 0 : options.widgetId, options === null || options === void 0 ? void 0 : options.nodeId);
|
|
3375
3501
|
if (((_a = this.uiActionModel.descriptor) === null || _a === void 0 ? void 0 : _a.feedbackType) === UiActionFeedbackType.Snackbar) {
|
|
3376
3502
|
this.showSavedSnackbar(uiAction);
|
|
3377
3503
|
}
|
|
@@ -3384,17 +3510,17 @@ class UiActionService {
|
|
|
3384
3510
|
showSavedSnackbar(uiAction) {
|
|
3385
3511
|
this._snackBar.openFromComponent(SuccessSnackBarComponent, {
|
|
3386
3512
|
duration: 5 * 1000,
|
|
3387
|
-
panelClass: [
|
|
3513
|
+
panelClass: ['backgroundColor-accent'],
|
|
3388
3514
|
data: uiAction,
|
|
3389
3515
|
});
|
|
3390
3516
|
}
|
|
3391
3517
|
}
|
|
3392
3518
|
UiActionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, deps: [{ token: UiActionConfirmDialogService }, { token: UiActionInputDialogService }, { token: i3$2.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3393
|
-
UiActionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, providedIn:
|
|
3519
|
+
UiActionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, providedIn: 'root' });
|
|
3394
3520
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, decorators: [{
|
|
3395
3521
|
type: Injectable,
|
|
3396
3522
|
args: [{
|
|
3397
|
-
providedIn:
|
|
3523
|
+
providedIn: 'root',
|
|
3398
3524
|
}]
|
|
3399
3525
|
}], ctorParameters: function () { return [{ type: UiActionConfirmDialogService }, { type: UiActionInputDialogService }, { type: i3$2.MatSnackBar }]; } });
|
|
3400
3526
|
|
|
@@ -3411,7 +3537,7 @@ class UiActionToolbarComponent {
|
|
|
3411
3537
|
this.setUp();
|
|
3412
3538
|
}
|
|
3413
3539
|
ngOnChanges(changes) {
|
|
3414
|
-
let uiActionModels = changes[
|
|
3540
|
+
let uiActionModels = changes['uiActionModels'].currentValue;
|
|
3415
3541
|
if (uiActionModels) {
|
|
3416
3542
|
this.uiActionModels = uiActionModels;
|
|
3417
3543
|
this.setUp();
|
|
@@ -3437,19 +3563,19 @@ class UiActionToolbarComponent {
|
|
|
3437
3563
|
var _a, _b;
|
|
3438
3564
|
switch ((_a = uiActionModel.descriptor) === null || _a === void 0 ? void 0 : _a.type) {
|
|
3439
3565
|
case UiActionButtonType.Normal:
|
|
3440
|
-
return
|
|
3566
|
+
return 'mat-button';
|
|
3441
3567
|
case UiActionButtonType.Flat:
|
|
3442
|
-
return
|
|
3568
|
+
return 'mat-flat-button';
|
|
3443
3569
|
case UiActionButtonType.Raised:
|
|
3444
|
-
return
|
|
3570
|
+
return 'mat-raised-button';
|
|
3445
3571
|
case UiActionButtonType.Stroked:
|
|
3446
|
-
return
|
|
3572
|
+
return 'mat-stroked-button';
|
|
3447
3573
|
case UiActionButtonType.Icon:
|
|
3448
|
-
return
|
|
3574
|
+
return 'mat-icon-button';
|
|
3449
3575
|
case UiActionButtonType.MiniFab:
|
|
3450
|
-
return
|
|
3576
|
+
return 'mat-mini-fab';
|
|
3451
3577
|
case UiActionButtonType.Fab:
|
|
3452
|
-
return
|
|
3578
|
+
return 'mat-fab';
|
|
3453
3579
|
default:
|
|
3454
3580
|
console.log(`Unhandled action button type case: ${(_b = uiActionModel.descriptor) === null || _b === void 0 ? void 0 : _b.type}`);
|
|
3455
3581
|
return `mat-button`;
|
|
@@ -3469,7 +3595,7 @@ UiActionToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0",
|
|
|
3469
3595
|
UiActionToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: UiActionToolbarComponent, selector: "smart-ui-action-toolbar", inputs: { uiActionModels: "uiActionModels" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"uiActionButtonsContainer\">\n <button\n *ngFor=\"let uiActionModel of uiActionModelsWithDescriptions\"\n mat-button\n [ngClass]=\"getType(uiActionModel)\"\n class=\"{{ uiActionModel.cssClass }}\"\n [color]=\"uiActionModel.descriptor?.color\"\n (click)=\"onActionClicked($event, uiActionModel)\"\n >\n <div *ngIf=\"isOnlyIcon(uiActionModel); then iconOnly; else text\"></div>\n <ng-template #iconOnly>\n <smart-icon\n *ngIf=\"uiActionModel.descriptor?.icon\"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n </ng-template>\n <ng-template #text>\n <smart-icon\n *ngIf=\"\n uiActionModel.descriptor?.icon &&\n uiActionModel.descriptor?.iconPosition === iconPosition().Pre\n \"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n {{ uiActionModel.descriptor?.title }}\n <smart-icon\n *ngIf=\"\n uiActionModel.descriptor?.icon &&\n uiActionModel.descriptor?.iconPosition === iconPosition().Post\n \"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n </ng-template>\n </button>\n</div>\n", styles: [".uiActionButtonsContainer{display:flex;flex-direction:row;gap:1rem;flex-wrap:wrap;min-height:2.25rem}\n"], components: [{ type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.SmartIconComponent, selector: "smart-icon", inputs: ["icon", "color"] }], directives: [{ type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
3470
3596
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionToolbarComponent, decorators: [{
|
|
3471
3597
|
type: Component,
|
|
3472
|
-
args: [{ selector:
|
|
3598
|
+
args: [{ selector: 'smart-ui-action-toolbar', template: "<div class=\"uiActionButtonsContainer\">\n <button\n *ngFor=\"let uiActionModel of uiActionModelsWithDescriptions\"\n mat-button\n [ngClass]=\"getType(uiActionModel)\"\n class=\"{{ uiActionModel.cssClass }}\"\n [color]=\"uiActionModel.descriptor?.color\"\n (click)=\"onActionClicked($event, uiActionModel)\"\n >\n <div *ngIf=\"isOnlyIcon(uiActionModel); then iconOnly; else text\"></div>\n <ng-template #iconOnly>\n <smart-icon\n *ngIf=\"uiActionModel.descriptor?.icon\"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n </ng-template>\n <ng-template #text>\n <smart-icon\n *ngIf=\"\n uiActionModel.descriptor?.icon &&\n uiActionModel.descriptor?.iconPosition === iconPosition().Pre\n \"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n {{ uiActionModel.descriptor?.title }}\n <smart-icon\n *ngIf=\"\n uiActionModel.descriptor?.icon &&\n uiActionModel.descriptor?.iconPosition === iconPosition().Post\n \"\n [icon]=\"uiActionModel.descriptor!.icon!\"\n [color]=\"uiActionModel.descriptor?.iconColor ?? uiActionModel.descriptor?.color\"\n ></smart-icon>\n </ng-template>\n </button>\n</div>\n", styles: [".uiActionButtonsContainer{display:flex;flex-direction:row;gap:1rem;flex-wrap:wrap;min-height:2.25rem}\n"] }]
|
|
3473
3599
|
}], ctorParameters: function () { return [{ type: UiActionService }, { type: UiActionDescriptorService }]; }, propDecorators: { uiActionModels: [{
|
|
3474
3600
|
type: Input
|
|
3475
3601
|
}] } });
|
|
@@ -3599,9 +3725,8 @@ class SmartSubject extends Subject {
|
|
|
3599
3725
|
}
|
|
3600
3726
|
|
|
3601
3727
|
let SmartComponentApiClient = class SmartComponentApiClient {
|
|
3602
|
-
constructor(
|
|
3728
|
+
constructor(inject, auth, pageName) {
|
|
3603
3729
|
this.auth = auth;
|
|
3604
|
-
this.viewContext = viewContext;
|
|
3605
3730
|
this.pageName = pageName;
|
|
3606
3731
|
this._destroy$ = new Subject();
|
|
3607
3732
|
this.detectChange = new SmartSubject(this._destroy$);
|
|
@@ -3614,6 +3739,9 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
3614
3739
|
this.model = model;
|
|
3615
3740
|
this.data = model.data;
|
|
3616
3741
|
});
|
|
3742
|
+
this.viewContext = inject.get(SmartViewContextService);
|
|
3743
|
+
this.uiActionService = inject.get(UiActionService);
|
|
3744
|
+
this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
|
|
3617
3745
|
}
|
|
3618
3746
|
get uuid() {
|
|
3619
3747
|
return this._uuid;
|
|
@@ -3676,37 +3804,58 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
3676
3804
|
});
|
|
3677
3805
|
}
|
|
3678
3806
|
}
|
|
3807
|
+
load() {
|
|
3808
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3809
|
+
this.uuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
3810
|
+
this.model = yield this.viewContext.load(this.uuid);
|
|
3811
|
+
});
|
|
3812
|
+
}
|
|
3813
|
+
//#region UseUiAction
|
|
3679
3814
|
getAdditionalParams(uiAction) {
|
|
3680
3815
|
return {
|
|
3681
|
-
forTextArea:
|
|
3682
|
-
forTextField:
|
|
3816
|
+
forTextArea: '',
|
|
3817
|
+
forTextField: '',
|
|
3683
3818
|
};
|
|
3684
3819
|
}
|
|
3685
3820
|
getModel() {
|
|
3686
3821
|
return this.data;
|
|
3687
3822
|
}
|
|
3688
|
-
performUiActionRequest(uiActionRequest) {
|
|
3823
|
+
performUiActionRequest(uiActionRequest, widgetId, nodeId) {
|
|
3689
3824
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3690
|
-
|
|
3825
|
+
if (widgetId && nodeId) {
|
|
3826
|
+
yield this.viewContext.performWidgetAction(this.uuid, widgetId, nodeId, uiActionRequest);
|
|
3827
|
+
}
|
|
3828
|
+
else if (widgetId) {
|
|
3829
|
+
yield this.viewContext.performWidgetMainAction(this.uuid, widgetId, uiActionRequest);
|
|
3830
|
+
}
|
|
3831
|
+
else {
|
|
3832
|
+
yield this.viewContext.performAction(this.uuid, uiActionRequest);
|
|
3833
|
+
}
|
|
3691
3834
|
});
|
|
3692
3835
|
}
|
|
3693
3836
|
handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
|
|
3694
|
-
throw new Error(
|
|
3837
|
+
throw new Error('handleSpecificDemandsAsynchronously method not implemented.');
|
|
3695
3838
|
}
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3839
|
+
//#endregion
|
|
3840
|
+
addGrid(smartGrid, options, useAsDefaultGrid) {
|
|
3841
|
+
smartGrid.options = options;
|
|
3842
|
+
smartGrid.uiActionService = this.uiActionService;
|
|
3843
|
+
smartGrid.uiActionDescriptorService = this.uiActionDescriptorService;
|
|
3844
|
+
smartGrid.serviceToUse = this;
|
|
3845
|
+
if (useAsDefaultGrid) {
|
|
3846
|
+
this.smartGrid = smartGrid;
|
|
3847
|
+
return this.smartGrid;
|
|
3848
|
+
}
|
|
3849
|
+
return smartGrid;
|
|
3701
3850
|
}
|
|
3702
3851
|
};
|
|
3703
3852
|
SmartComponentApiClient = __decorate([
|
|
3704
|
-
__param(2, Inject(
|
|
3853
|
+
__param(2, Inject('pageName'))
|
|
3705
3854
|
], SmartComponentApiClient);
|
|
3706
3855
|
|
|
3707
3856
|
class SmartComponent extends SmartComponentApiClient {
|
|
3708
|
-
constructor(
|
|
3709
|
-
super(
|
|
3857
|
+
constructor(inject, auth, pageName) {
|
|
3858
|
+
super(inject, auth, pageName);
|
|
3710
3859
|
}
|
|
3711
3860
|
ngOnInit() {
|
|
3712
3861
|
this._ngOnInit();
|
|
@@ -3715,26 +3864,26 @@ class SmartComponent extends SmartComponentApiClient {
|
|
|
3715
3864
|
this._ngOnDestroy();
|
|
3716
3865
|
}
|
|
3717
3866
|
}
|
|
3718
|
-
SmartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartComponent, deps: [{ token:
|
|
3719
|
-
SmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template:
|
|
3867
|
+
SmartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartComponent, deps: [{ token: i0.Injector }, { token: SmartAuthService }, { token: 'pageName' }], target: i0.ɵɵFactoryTarget.Component });
|
|
3868
|
+
SmartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: SmartComponent, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
3720
3869
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartComponent, decorators: [{
|
|
3721
3870
|
type: Component,
|
|
3722
3871
|
args: [{
|
|
3723
|
-
template:
|
|
3872
|
+
template: '',
|
|
3724
3873
|
}]
|
|
3725
3874
|
}], ctorParameters: function () {
|
|
3726
|
-
return [{ type: undefined, decorators: [{
|
|
3875
|
+
return [{ type: i0.Injector }, { type: undefined, decorators: [{
|
|
3727
3876
|
type: Inject,
|
|
3728
3877
|
args: [SmartAuthService]
|
|
3729
|
-
}] }, { type:
|
|
3878
|
+
}] }, { type: undefined, decorators: [{
|
|
3730
3879
|
type: Inject,
|
|
3731
|
-
args: [
|
|
3880
|
+
args: ['pageName']
|
|
3732
3881
|
}] }];
|
|
3733
3882
|
} });
|
|
3734
3883
|
|
|
3735
3884
|
class SmartService extends SmartComponentApiClient {
|
|
3736
|
-
constructor(
|
|
3737
|
-
super(
|
|
3885
|
+
constructor(inject, auth, pageName) {
|
|
3886
|
+
super(inject, auth, pageName);
|
|
3738
3887
|
}
|
|
3739
3888
|
ngOnInit() {
|
|
3740
3889
|
this._ngOnInit();
|
|
@@ -3743,20 +3892,20 @@ class SmartService extends SmartComponentApiClient {
|
|
|
3743
3892
|
this._ngOnDestroy();
|
|
3744
3893
|
}
|
|
3745
3894
|
}
|
|
3746
|
-
SmartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartService, deps: [{ token:
|
|
3747
|
-
SmartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartService, providedIn:
|
|
3895
|
+
SmartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartService, deps: [{ token: i0.Injector }, { token: SmartAuthService }, { token: 'pageName' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3896
|
+
SmartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartService, providedIn: 'root' });
|
|
3748
3897
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartService, decorators: [{
|
|
3749
3898
|
type: Injectable,
|
|
3750
3899
|
args: [{
|
|
3751
|
-
providedIn:
|
|
3900
|
+
providedIn: 'root',
|
|
3752
3901
|
}]
|
|
3753
3902
|
}], ctorParameters: function () {
|
|
3754
|
-
return [{ type: undefined, decorators: [{
|
|
3903
|
+
return [{ type: i0.Injector }, { type: undefined, decorators: [{
|
|
3755
3904
|
type: Inject,
|
|
3756
3905
|
args: [SmartAuthService]
|
|
3757
|
-
}] }, { type:
|
|
3906
|
+
}] }, { type: undefined, decorators: [{
|
|
3758
3907
|
type: Inject,
|
|
3759
|
-
args: [
|
|
3908
|
+
args: ['pageName']
|
|
3760
3909
|
}] }];
|
|
3761
3910
|
} });
|
|
3762
3911
|
|