@smartbit4all/ng-client 1.0.12 → 1.0.13
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 +36 -14
- 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 +26 -19
- package/esm2020/lib/view-context/smart-view-context.service.mjs +37 -33
- package/fesm2015/smartbit4all-ng-client.mjs +236 -77
- package/fesm2015/smartbit4all-ng-client.mjs.map +1 -1
- package/fesm2020/smartbit4all-ng-client.mjs +225 -76
- package/fesm2020/smartbit4all-ng-client.mjs.map +1 -1
- package/lib/smart-client/smart-component-api-client.d.ts +14 -6
- 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 +4 -2
- 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.13.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,27 @@ 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
|
-
|
|
3500
|
+
if (options && options.nodeId && options.widgetId) {
|
|
3501
|
+
yield this.uiActionModel.serviceToUse.performWidgetActionRequest(uiActionRequest, options.widgetId, options.nodeId);
|
|
3502
|
+
}
|
|
3503
|
+
else if (options && options.widgetId) {
|
|
3504
|
+
yield this.uiActionModel.serviceToUse.performWidgetMainActionRequest(uiActionRequest, options.widgetId);
|
|
3505
|
+
}
|
|
3506
|
+
else {
|
|
3507
|
+
yield this.uiActionModel.serviceToUse.performUiActionRequest(uiActionRequest);
|
|
3508
|
+
}
|
|
3375
3509
|
if (((_a = this.uiActionModel.descriptor) === null || _a === void 0 ? void 0 : _a.feedbackType) === UiActionFeedbackType.Snackbar) {
|
|
3376
3510
|
this.showSavedSnackbar(uiAction);
|
|
3377
3511
|
}
|
|
@@ -3384,17 +3518,17 @@ class UiActionService {
|
|
|
3384
3518
|
showSavedSnackbar(uiAction) {
|
|
3385
3519
|
this._snackBar.openFromComponent(SuccessSnackBarComponent, {
|
|
3386
3520
|
duration: 5 * 1000,
|
|
3387
|
-
panelClass: [
|
|
3521
|
+
panelClass: ['backgroundColor-accent'],
|
|
3388
3522
|
data: uiAction,
|
|
3389
3523
|
});
|
|
3390
3524
|
}
|
|
3391
3525
|
}
|
|
3392
3526
|
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:
|
|
3527
|
+
UiActionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, providedIn: 'root' });
|
|
3394
3528
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionService, decorators: [{
|
|
3395
3529
|
type: Injectable,
|
|
3396
3530
|
args: [{
|
|
3397
|
-
providedIn:
|
|
3531
|
+
providedIn: 'root',
|
|
3398
3532
|
}]
|
|
3399
3533
|
}], ctorParameters: function () { return [{ type: UiActionConfirmDialogService }, { type: UiActionInputDialogService }, { type: i3$2.MatSnackBar }]; } });
|
|
3400
3534
|
|
|
@@ -3411,7 +3545,7 @@ class UiActionToolbarComponent {
|
|
|
3411
3545
|
this.setUp();
|
|
3412
3546
|
}
|
|
3413
3547
|
ngOnChanges(changes) {
|
|
3414
|
-
let uiActionModels = changes[
|
|
3548
|
+
let uiActionModels = changes['uiActionModels'].currentValue;
|
|
3415
3549
|
if (uiActionModels) {
|
|
3416
3550
|
this.uiActionModels = uiActionModels;
|
|
3417
3551
|
this.setUp();
|
|
@@ -3437,19 +3571,19 @@ class UiActionToolbarComponent {
|
|
|
3437
3571
|
var _a, _b;
|
|
3438
3572
|
switch ((_a = uiActionModel.descriptor) === null || _a === void 0 ? void 0 : _a.type) {
|
|
3439
3573
|
case UiActionButtonType.Normal:
|
|
3440
|
-
return
|
|
3574
|
+
return 'mat-button';
|
|
3441
3575
|
case UiActionButtonType.Flat:
|
|
3442
|
-
return
|
|
3576
|
+
return 'mat-flat-button';
|
|
3443
3577
|
case UiActionButtonType.Raised:
|
|
3444
|
-
return
|
|
3578
|
+
return 'mat-raised-button';
|
|
3445
3579
|
case UiActionButtonType.Stroked:
|
|
3446
|
-
return
|
|
3580
|
+
return 'mat-stroked-button';
|
|
3447
3581
|
case UiActionButtonType.Icon:
|
|
3448
|
-
return
|
|
3582
|
+
return 'mat-icon-button';
|
|
3449
3583
|
case UiActionButtonType.MiniFab:
|
|
3450
|
-
return
|
|
3584
|
+
return 'mat-mini-fab';
|
|
3451
3585
|
case UiActionButtonType.Fab:
|
|
3452
|
-
return
|
|
3586
|
+
return 'mat-fab';
|
|
3453
3587
|
default:
|
|
3454
3588
|
console.log(`Unhandled action button type case: ${(_b = uiActionModel.descriptor) === null || _b === void 0 ? void 0 : _b.type}`);
|
|
3455
3589
|
return `mat-button`;
|
|
@@ -3469,7 +3603,7 @@ UiActionToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0",
|
|
|
3469
3603
|
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
3604
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: UiActionToolbarComponent, decorators: [{
|
|
3471
3605
|
type: Component,
|
|
3472
|
-
args: [{ selector:
|
|
3606
|
+
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
3607
|
}], ctorParameters: function () { return [{ type: UiActionService }, { type: UiActionDescriptorService }]; }, propDecorators: { uiActionModels: [{
|
|
3474
3608
|
type: Input
|
|
3475
3609
|
}] } });
|
|
@@ -3599,9 +3733,8 @@ class SmartSubject extends Subject {
|
|
|
3599
3733
|
}
|
|
3600
3734
|
|
|
3601
3735
|
let SmartComponentApiClient = class SmartComponentApiClient {
|
|
3602
|
-
constructor(
|
|
3736
|
+
constructor(inject, auth, pageName) {
|
|
3603
3737
|
this.auth = auth;
|
|
3604
|
-
this.viewContext = viewContext;
|
|
3605
3738
|
this.pageName = pageName;
|
|
3606
3739
|
this._destroy$ = new Subject();
|
|
3607
3740
|
this.detectChange = new SmartSubject(this._destroy$);
|
|
@@ -3614,6 +3747,9 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
3614
3747
|
this.model = model;
|
|
3615
3748
|
this.data = model.data;
|
|
3616
3749
|
});
|
|
3750
|
+
this.viewContext = inject.get(SmartViewContextService);
|
|
3751
|
+
this.uiActionService = inject.get(UiActionService);
|
|
3752
|
+
this.uiActionDescriptorService = inject.get(UiActionDescriptorService);
|
|
3617
3753
|
}
|
|
3618
3754
|
get uuid() {
|
|
3619
3755
|
return this._uuid;
|
|
@@ -3676,10 +3812,17 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
3676
3812
|
});
|
|
3677
3813
|
}
|
|
3678
3814
|
}
|
|
3815
|
+
load() {
|
|
3816
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3817
|
+
this.uuid = this.viewContext.getUuidOfPage(this.pageName);
|
|
3818
|
+
this.model = yield this.viewContext.load(this.uuid);
|
|
3819
|
+
});
|
|
3820
|
+
}
|
|
3821
|
+
//#region UseUiAction
|
|
3679
3822
|
getAdditionalParams(uiAction) {
|
|
3680
3823
|
return {
|
|
3681
|
-
forTextArea:
|
|
3682
|
-
forTextField:
|
|
3824
|
+
forTextArea: '',
|
|
3825
|
+
forTextField: '',
|
|
3683
3826
|
};
|
|
3684
3827
|
}
|
|
3685
3828
|
getModel() {
|
|
@@ -3690,23 +3833,39 @@ let SmartComponentApiClient = class SmartComponentApiClient {
|
|
|
3690
3833
|
yield this.viewContext.performAction(this.uuid, uiActionRequest);
|
|
3691
3834
|
});
|
|
3692
3835
|
}
|
|
3693
|
-
|
|
3694
|
-
|
|
3836
|
+
performWidgetActionRequest(uiActionRequest, widgetId, nodeId) {
|
|
3837
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3838
|
+
yield this.viewContext.performWidgetAction(this.uuid, widgetId, nodeId, uiActionRequest);
|
|
3839
|
+
});
|
|
3695
3840
|
}
|
|
3696
|
-
|
|
3841
|
+
performWidgetMainActionRequest(uiActionRequest, widgetId) {
|
|
3697
3842
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3698
|
-
|
|
3699
|
-
this.model = yield this.viewContext.load(this.uuid);
|
|
3843
|
+
yield this.viewContext.performWidgetMainAction(this.uuid, widgetId, uiActionRequest);
|
|
3700
3844
|
});
|
|
3701
3845
|
}
|
|
3846
|
+
handleSpecificDemandsAsynchronously(uiAction, uiActionRequest) {
|
|
3847
|
+
throw new Error('handleSpecificDemandsAsynchronously method not implemented.');
|
|
3848
|
+
}
|
|
3849
|
+
//#endregion
|
|
3850
|
+
addGrid(smartGrid, options, useAsDefaultGrid) {
|
|
3851
|
+
smartGrid.options = options;
|
|
3852
|
+
smartGrid.uiActionService = this.uiActionService;
|
|
3853
|
+
smartGrid.uiActionDescriptorService = this.uiActionDescriptorService;
|
|
3854
|
+
smartGrid.serviceToUse = this;
|
|
3855
|
+
if (useAsDefaultGrid) {
|
|
3856
|
+
this.smartGrid = smartGrid;
|
|
3857
|
+
return this.smartGrid;
|
|
3858
|
+
}
|
|
3859
|
+
return smartGrid;
|
|
3860
|
+
}
|
|
3702
3861
|
};
|
|
3703
3862
|
SmartComponentApiClient = __decorate([
|
|
3704
|
-
__param(2, Inject(
|
|
3863
|
+
__param(2, Inject('pageName'))
|
|
3705
3864
|
], SmartComponentApiClient);
|
|
3706
3865
|
|
|
3707
3866
|
class SmartComponent extends SmartComponentApiClient {
|
|
3708
|
-
constructor(
|
|
3709
|
-
super(
|
|
3867
|
+
constructor(inject, auth, pageName) {
|
|
3868
|
+
super(inject, auth, pageName);
|
|
3710
3869
|
}
|
|
3711
3870
|
ngOnInit() {
|
|
3712
3871
|
this._ngOnInit();
|
|
@@ -3715,26 +3874,26 @@ class SmartComponent extends SmartComponentApiClient {
|
|
|
3715
3874
|
this._ngOnDestroy();
|
|
3716
3875
|
}
|
|
3717
3876
|
}
|
|
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:
|
|
3877
|
+
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 });
|
|
3878
|
+
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
3879
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartComponent, decorators: [{
|
|
3721
3880
|
type: Component,
|
|
3722
3881
|
args: [{
|
|
3723
|
-
template:
|
|
3882
|
+
template: '',
|
|
3724
3883
|
}]
|
|
3725
3884
|
}], ctorParameters: function () {
|
|
3726
|
-
return [{ type: undefined, decorators: [{
|
|
3885
|
+
return [{ type: i0.Injector }, { type: undefined, decorators: [{
|
|
3727
3886
|
type: Inject,
|
|
3728
3887
|
args: [SmartAuthService]
|
|
3729
|
-
}] }, { type:
|
|
3888
|
+
}] }, { type: undefined, decorators: [{
|
|
3730
3889
|
type: Inject,
|
|
3731
|
-
args: [
|
|
3890
|
+
args: ['pageName']
|
|
3732
3891
|
}] }];
|
|
3733
3892
|
} });
|
|
3734
3893
|
|
|
3735
3894
|
class SmartService extends SmartComponentApiClient {
|
|
3736
|
-
constructor(
|
|
3737
|
-
super(
|
|
3895
|
+
constructor(inject, auth, pageName) {
|
|
3896
|
+
super(inject, auth, pageName);
|
|
3738
3897
|
}
|
|
3739
3898
|
ngOnInit() {
|
|
3740
3899
|
this._ngOnInit();
|
|
@@ -3743,20 +3902,20 @@ class SmartService extends SmartComponentApiClient {
|
|
|
3743
3902
|
this._ngOnDestroy();
|
|
3744
3903
|
}
|
|
3745
3904
|
}
|
|
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:
|
|
3905
|
+
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 });
|
|
3906
|
+
SmartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartService, providedIn: 'root' });
|
|
3748
3907
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: SmartService, decorators: [{
|
|
3749
3908
|
type: Injectable,
|
|
3750
3909
|
args: [{
|
|
3751
|
-
providedIn:
|
|
3910
|
+
providedIn: 'root',
|
|
3752
3911
|
}]
|
|
3753
3912
|
}], ctorParameters: function () {
|
|
3754
|
-
return [{ type: undefined, decorators: [{
|
|
3913
|
+
return [{ type: i0.Injector }, { type: undefined, decorators: [{
|
|
3755
3914
|
type: Inject,
|
|
3756
3915
|
args: [SmartAuthService]
|
|
3757
|
-
}] }, { type:
|
|
3916
|
+
}] }, { type: undefined, decorators: [{
|
|
3758
3917
|
type: Inject,
|
|
3759
|
-
args: [
|
|
3918
|
+
args: ['pageName']
|
|
3760
3919
|
}] }];
|
|
3761
3920
|
} });
|
|
3762
3921
|
|