tnx-shared 5.3.331 → 5.3.332
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/bundles/tnx-shared.umd.js +16 -39
- package/bundles/tnx-shared.umd.js.map +1 -1
- package/bundles/tnx-shared.umd.min.js +1 -1
- package/bundles/tnx-shared.umd.min.js.map +1 -1
- package/classes/base/list-component-base.d.ts +1 -0
- package/classes/base/list-component-base.d.ts.map +1 -1
- package/esm2015/classes/base/list-component-base.js +15 -40
- package/fesm2015/tnx-shared.js +14 -39
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/tnx-shared.metadata.json +1 -1
|
@@ -22458,6 +22458,7 @@
|
|
|
22458
22458
|
_this.isSuperUser = false;
|
|
22459
22459
|
_this.showFormWorkflow = false;
|
|
22460
22460
|
_this.headerWorkflow = '';
|
|
22461
|
+
_this.componentKey = '';
|
|
22461
22462
|
_this.lstBtnAuthorizeMenu = [];
|
|
22462
22463
|
_this.popupSizeWorkflow = new PopupSize({ width: 950, height: 540 });
|
|
22463
22464
|
_this.showHistoryWorkflow = false;
|
|
@@ -22965,6 +22966,7 @@
|
|
|
22965
22966
|
}
|
|
22966
22967
|
};
|
|
22967
22968
|
ListComponentBase.prototype.initColumnSchema = function (cols) {
|
|
22969
|
+
var _a, _b, _c, _d;
|
|
22968
22970
|
if (!cols || !cols.length)
|
|
22969
22971
|
return;
|
|
22970
22972
|
var colFunction = null, colGroup = null, colHasToggleIcon = null;
|
|
@@ -22987,6 +22989,7 @@
|
|
|
22987
22989
|
colHasToggleIcon = this.setting.cols[0];
|
|
22988
22990
|
}
|
|
22989
22991
|
colHasToggleIcon.colHasToggleIcon = true;
|
|
22992
|
+
this.componentKey = location.pathname + "/" + (((_d = (_c = (_b = (_a = this.container) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.closest('crud-list').parentNode) === null || _c === void 0 ? void 0 : _c.tagName) === null || _d === void 0 ? void 0 : _d.toLowerCase()) || '') + (this.setting.settingKey ? '/' + this.setting.settingKey : '');
|
|
22990
22993
|
this.getColorSetting();
|
|
22991
22994
|
this.getColumnSetting(colGroup);
|
|
22992
22995
|
this.getPageSetting();
|
|
@@ -23203,16 +23206,12 @@
|
|
|
23203
23206
|
var dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
|
|
23204
23207
|
var jsonData = this.tryParseJson(dataSetting);
|
|
23205
23208
|
if (dataSetting && jsonData.valid && jsonData.value.length > 0) {
|
|
23206
|
-
var pathName = location.pathname;
|
|
23207
|
-
if (this.setting.settingKey) {
|
|
23208
|
-
pathName += '/' + this.setting.settingKey;
|
|
23209
|
-
}
|
|
23210
23209
|
var settings = jsonData.value;
|
|
23211
23210
|
try {
|
|
23212
23211
|
for (var settings_1 = __values(settings), settings_1_1 = settings_1.next(); !settings_1_1.done; settings_1_1 = settings_1.next()) {
|
|
23213
23212
|
var element = settings_1_1.value;
|
|
23214
23213
|
// const element = settings[i];
|
|
23215
|
-
if (element.pathname ===
|
|
23214
|
+
if (element.pathname === this.componentKey) {
|
|
23216
23215
|
this.setting.columnSetting.sortField = element.setting.sortField;
|
|
23217
23216
|
this.setting.columnSetting.sortDir = element.setting.sortDir ? element.setting.sortDir : 0;
|
|
23218
23217
|
if (this.setting.columnSetting.sortDir == 0) {
|
|
@@ -23250,16 +23249,13 @@
|
|
|
23250
23249
|
}
|
|
23251
23250
|
};
|
|
23252
23251
|
ListComponentBase.prototype.saveColumnSetting = function () {
|
|
23253
|
-
var
|
|
23254
|
-
if (this.setting.settingKey) {
|
|
23255
|
-
pathName += '/' + this.setting.settingKey;
|
|
23256
|
-
}
|
|
23252
|
+
var _this = this;
|
|
23257
23253
|
var columnSetting = [];
|
|
23258
23254
|
var checkExist = false;
|
|
23259
23255
|
var dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
|
|
23260
23256
|
if (dataSetting) {
|
|
23261
23257
|
columnSetting = JSON.parse(dataSetting);
|
|
23262
|
-
var itemSetting = columnSetting.find(function (q) { return q.pathname ==
|
|
23258
|
+
var itemSetting = columnSetting.find(function (q) { return q.pathname == _this.componentKey; });
|
|
23263
23259
|
if (itemSetting) {
|
|
23264
23260
|
itemSetting.setting.sortField = this.setting.columnSetting.sortField;
|
|
23265
23261
|
itemSetting.setting.sortDir = this.setting.columnSetting.sortDir;
|
|
@@ -23270,20 +23266,17 @@
|
|
|
23270
23266
|
}
|
|
23271
23267
|
}
|
|
23272
23268
|
if (!checkExist) {
|
|
23273
|
-
columnSetting.push({ pathname:
|
|
23269
|
+
columnSetting.push({ pathname: this.componentKey, setting: this.setting.columnSetting });
|
|
23274
23270
|
}
|
|
23275
23271
|
localStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING, JSON.stringify(columnSetting));
|
|
23276
23272
|
};
|
|
23277
23273
|
ListComponentBase.prototype.deleteColumnSetting = function () {
|
|
23278
|
-
var
|
|
23279
|
-
if (this.setting.settingKey) {
|
|
23280
|
-
pathName += '/' + this.setting.settingKey;
|
|
23281
|
-
}
|
|
23274
|
+
var _this = this;
|
|
23282
23275
|
var columnSetting = [];
|
|
23283
23276
|
var dataSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLUMN_SETTING);
|
|
23284
23277
|
if (dataSetting) {
|
|
23285
23278
|
columnSetting = JSON.parse(dataSetting);
|
|
23286
|
-
var index = columnSetting.findIndex(function (q) { return q.pathname ==
|
|
23279
|
+
var index = columnSetting.findIndex(function (q) { return q.pathname == _this.componentKey; });
|
|
23287
23280
|
if (index > -1)
|
|
23288
23281
|
columnSetting.splice(index, 1);
|
|
23289
23282
|
}
|
|
@@ -23293,14 +23286,10 @@
|
|
|
23293
23286
|
ListComponentBase.prototype.getColorSetting = function () {
|
|
23294
23287
|
var dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLOR_SETTING);
|
|
23295
23288
|
if (dataPageSetting) {
|
|
23296
|
-
var pathName = location.pathname;
|
|
23297
|
-
if (this.setting.settingKey) {
|
|
23298
|
-
pathName += '/' + this.setting.settingKey;
|
|
23299
|
-
}
|
|
23300
23289
|
var settings = JSON.parse(dataPageSetting);
|
|
23301
23290
|
for (var i = 0; i < settings.length; i++) {
|
|
23302
23291
|
var element = settings[i];
|
|
23303
|
-
if (element.pathname ===
|
|
23292
|
+
if (element.pathname === this.componentKey) {
|
|
23304
23293
|
this.setting.colorFilterField = element.colorFilterField;
|
|
23305
23294
|
this.setting.colorFilterTable = element.colorFilterTable;
|
|
23306
23295
|
break;
|
|
@@ -23325,17 +23314,13 @@
|
|
|
23325
23314
|
};
|
|
23326
23315
|
ListComponentBase.prototype.setColorSetting = function () {
|
|
23327
23316
|
var _this = this;
|
|
23328
|
-
var pathName = location.pathname;
|
|
23329
|
-
if (this.setting.settingKey) {
|
|
23330
|
-
pathName += '/' + this.setting.settingKey;
|
|
23331
|
-
}
|
|
23332
23317
|
var colorSetting = [];
|
|
23333
23318
|
var checkExist = false;
|
|
23334
23319
|
var dataColorSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.COLOR_SETTING);
|
|
23335
23320
|
if (dataColorSetting) {
|
|
23336
23321
|
colorSetting = JSON.parse(dataColorSetting);
|
|
23337
23322
|
colorSetting.forEach(function (element) {
|
|
23338
|
-
if (element.pathname ===
|
|
23323
|
+
if (element.pathname === _this.componentKey) {
|
|
23339
23324
|
element.colorFilterField = _this.setting.colorFilterField;
|
|
23340
23325
|
element.colorFilterTable = _this.setting.colorFilterTable;
|
|
23341
23326
|
checkExist = true;
|
|
@@ -23344,7 +23329,7 @@
|
|
|
23344
23329
|
}
|
|
23345
23330
|
if (!checkExist) {
|
|
23346
23331
|
colorSetting.push({
|
|
23347
|
-
pathname:
|
|
23332
|
+
pathname: this.componentKey,
|
|
23348
23333
|
colorFilterField: this.setting.colorFilterField,
|
|
23349
23334
|
colorFilterTable: this.setting.colorFilterTable
|
|
23350
23335
|
});
|
|
@@ -23354,14 +23339,10 @@
|
|
|
23354
23339
|
ListComponentBase.prototype.getPageSetting = function () {
|
|
23355
23340
|
var dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING);
|
|
23356
23341
|
if (dataPageSetting) {
|
|
23357
|
-
var pathName = location.pathname;
|
|
23358
|
-
if (this.setting.settingKey) {
|
|
23359
|
-
pathName += '/' + this.setting.settingKey;
|
|
23360
|
-
}
|
|
23361
23342
|
var pageSettings = JSON.parse(dataPageSetting);
|
|
23362
23343
|
for (var i = 0; i < pageSettings.length; i++) {
|
|
23363
23344
|
var element = pageSettings[i];
|
|
23364
|
-
if (element.pathname ===
|
|
23345
|
+
if (element.pathname === this.componentKey) {
|
|
23365
23346
|
this.setting.pageSetting.pageSize = element.pageSize;
|
|
23366
23347
|
break;
|
|
23367
23348
|
}
|
|
@@ -23370,24 +23351,20 @@
|
|
|
23370
23351
|
};
|
|
23371
23352
|
ListComponentBase.prototype.savePageSetting = function () {
|
|
23372
23353
|
var _this = this;
|
|
23373
|
-
var pathName = location.pathname;
|
|
23374
|
-
if (this.setting.settingKey) {
|
|
23375
|
-
pathName += '/' + this.setting.settingKey;
|
|
23376
|
-
}
|
|
23377
23354
|
var pageSetting = [];
|
|
23378
23355
|
var checkExist = false;
|
|
23379
23356
|
var dataPageSetting = localStorage.getItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING);
|
|
23380
23357
|
if (dataPageSetting) {
|
|
23381
23358
|
pageSetting = JSON.parse(dataPageSetting);
|
|
23382
23359
|
pageSetting.forEach(function (element) {
|
|
23383
|
-
if (element.pathname ===
|
|
23360
|
+
if (element.pathname === _this.componentKey) {
|
|
23384
23361
|
element.pageSize = _this.setting.pageSetting.pageSize;
|
|
23385
23362
|
checkExist = true;
|
|
23386
23363
|
}
|
|
23387
23364
|
});
|
|
23388
23365
|
}
|
|
23389
23366
|
if (!checkExist) {
|
|
23390
|
-
pageSetting.push({ pathname:
|
|
23367
|
+
pageSetting.push({ pathname: this.componentKey, pageSize: this.setting.pageSetting.pageSize });
|
|
23391
23368
|
}
|
|
23392
23369
|
localStorage.setItem(ComCtxConstants.LOCALSTORAGE_KEY.PAGE_SETTING, JSON.stringify(pageSetting));
|
|
23393
23370
|
};
|
|
@@ -23660,7 +23637,7 @@
|
|
|
23660
23637
|
}
|
|
23661
23638
|
}
|
|
23662
23639
|
}
|
|
23663
|
-
return transformed.map(function (row) { return row.map(function (cell) { return cell ||
|
|
23640
|
+
return transformed.map(function (row) { return row.map(function (cell) { return cell || ''; }); });
|
|
23664
23641
|
};
|
|
23665
23642
|
ListComponentBase.prototype.getValueRow = function (rowData, index, value) {
|
|
23666
23643
|
if (rowData[index] != null) {
|