tnx-shared 5.1.352 → 5.1.355
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 +71 -16
- 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/component-base-with-button.d.ts +8 -0
- package/classes/base/component-base-with-button.d.ts.map +1 -0
- package/classes/base/data-form-base.d.ts +3 -4
- package/classes/base/data-form-base.d.ts.map +1 -1
- package/classes/base/list-base.d.ts +2 -2
- package/classes/base/list-base.d.ts.map +1 -1
- package/classes/form-schema.d.ts.map +1 -1
- package/components/tn-tabview/tn-tabview.component.d.ts +5 -1
- package/components/tn-tabview/tn-tabview.component.d.ts.map +1 -1
- package/esm2015/classes/base/component-base-with-button.js +18 -0
- package/esm2015/classes/base/data-form-base.js +5 -6
- package/esm2015/classes/base/list-base.js +3 -3
- package/esm2015/classes/form-schema.js +2 -2
- package/esm2015/components/statemachines/state/state.component.js +1 -1
- package/esm2015/components/tn-tabview/tn-tabview.component.js +31 -10
- package/esm2015/public-api.js +2 -1
- package/fesm2015/tnx-shared.js +50 -14
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/public-api.d.ts +1 -0
- package/public-api.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
|
@@ -1977,7 +1977,7 @@
|
|
|
1977
1977
|
function TabViewData(init) {
|
|
1978
1978
|
this.hidden = false;
|
|
1979
1979
|
this.alwayRender = false;
|
|
1980
|
-
this.useScrollbar =
|
|
1980
|
+
this.useScrollbar = true; // Config để xác định có sử dụng custom-scrollbar không, nếu không thì dùng scrollbar mặc định của trình duyệt
|
|
1981
1981
|
for (var key in init) {
|
|
1982
1982
|
this[key] = init[key];
|
|
1983
1983
|
}
|
|
@@ -17663,6 +17663,24 @@
|
|
|
17663
17663
|
{ type: StorageUpdatedService }
|
|
17664
17664
|
]; };
|
|
17665
17665
|
|
|
17666
|
+
var ComponentBaseWithButton = /** @class */ (function (_super) {
|
|
17667
|
+
__extends(ComponentBaseWithButton, _super);
|
|
17668
|
+
function ComponentBaseWithButton(_injector) {
|
|
17669
|
+
return _super.call(this, _injector) || this;
|
|
17670
|
+
}
|
|
17671
|
+
return ComponentBaseWithButton;
|
|
17672
|
+
}(ComponentBase));
|
|
17673
|
+
ComponentBaseWithButton.decorators = [
|
|
17674
|
+
{ type: i0.Directive }
|
|
17675
|
+
];
|
|
17676
|
+
ComponentBaseWithButton.ctorParameters = function () { return [
|
|
17677
|
+
{ type: i0.Injector }
|
|
17678
|
+
]; };
|
|
17679
|
+
ComponentBaseWithButton.propDecorators = {
|
|
17680
|
+
buttonTemplate: [{ type: i0.ViewChild, args: ['buttonTemplate', { static: true },] }],
|
|
17681
|
+
tabCode: [{ type: i0.Input }]
|
|
17682
|
+
};
|
|
17683
|
+
|
|
17666
17684
|
var DataFormBase = /** @class */ (function (_super) {
|
|
17667
17685
|
__extends(DataFormBase, _super);
|
|
17668
17686
|
function DataFormBase(_injector) {
|
|
@@ -18509,7 +18527,7 @@
|
|
|
18509
18527
|
return this._getFormState() == exports.FormState.VIEW;
|
|
18510
18528
|
};
|
|
18511
18529
|
return DataFormBase;
|
|
18512
|
-
}(
|
|
18530
|
+
}(ComponentBaseWithButton));
|
|
18513
18531
|
DataFormBase.decorators = [
|
|
18514
18532
|
{ type: i0.Directive }
|
|
18515
18533
|
];
|
|
@@ -18520,7 +18538,6 @@
|
|
|
18520
18538
|
crudForm: [{ type: i0.ViewChild, args: [CrudFormComponent, { static: false },] }],
|
|
18521
18539
|
formElement: [{ type: i0.ViewChild, args: ['formElement', { static: true },] }],
|
|
18522
18540
|
pUpload: [{ type: i0.ViewChild, args: ['pUpload', { static: true },] }],
|
|
18523
|
-
buttonTemplate: [{ type: i0.ViewChild, args: ['buttonTemplate', { static: true },] }],
|
|
18524
18541
|
parentSetting: [{ type: i0.Input }],
|
|
18525
18542
|
model: [{ type: i0.Input }],
|
|
18526
18543
|
forceOnlyView: [{ type: i0.Input }],
|
|
@@ -25461,7 +25478,7 @@
|
|
|
25461
25478
|
this.showDetailForm = false;
|
|
25462
25479
|
};
|
|
25463
25480
|
return ListBase;
|
|
25464
|
-
}(
|
|
25481
|
+
}(ComponentBaseWithButton));
|
|
25465
25482
|
ListBase.decorators = [
|
|
25466
25483
|
{ type: i0.Directive }
|
|
25467
25484
|
];
|
|
@@ -44995,7 +45012,7 @@
|
|
|
44995
45012
|
selector: 'state',
|
|
44996
45013
|
template: "<div [class]=\"'node type-' + machine.type\" [ngStyle]=\"{'cursor': viewOnly ? 'default' : 'move'}\"\r\n [id]=\"'div-' + machine.id\" [class.current]=\"machine.current\" [class.disabled]=\"machine.disabled\"\r\n (contextmenu)=\"handleRightClick($event)\">\r\n <span *ngIf=\"machine.current\" class=\"machine-icon\">\r\n <i class=\"far fa-pause-circle\"></i>\r\n </span>\r\n <span *ngIf=\"!machine.current && machine.type==enumStateType.START\" class=\"machine-icon\">\r\n <i class=\"far fa-play-circle\"></i>\r\n </span>\r\n <span *ngIf=\"!machine.current && machine.type==enumStateType.STOP\" class=\"machine-icon\">\r\n <i class=\"far fa-stop-circle\"></i>\r\n </span>\r\n <div class=\"machine-code\">\r\n {{viewOnly ? machine.name : machine.code}}</div>\r\n <p class=\"machine-name\">\r\n <b *ngIf=\"!viewOnly\">{{machine.name + ': '}}</b>\r\n {{machine.description}}\r\n </p>\r\n <a *ngIf=\"!viewOnly\" class=\"btn-connect\" [pTooltip]=\"'Nh\u1EA5n gi\u1EEF v\u00E0 k\u00E9o \u0111\u1EC3 k\u1EBFt n\u1ED1i tr\u1EA1ng th\u00E1i'\"\r\n tooltipStyleClass=\"wrap\">\r\n </a>\r\n <div *ngIf=\"!viewOnly\" class=\"btn-holder\">\r\n <a class=\"btn btn-edit\" (click)=\"editNode()\">\r\n <i class=\"far fa-edit\"></i>\r\n </a>\r\n <a class=\"btn btn-delete\" (click)=\"deleteNode()\">\r\n <i class=\"far fa-trash-alt\"></i>\r\n </a>\r\n </div>\r\n</div>",
|
|
44997
45014
|
providers: [ComponentContextService],
|
|
44998
|
-
styles: [".node{-moz-box-shadow:2px 2px 10px 1px #c3c3c3;-o-box-shadow:2px 2px 10px 1px #c3c3c3;-webkit-box-shadow:2px 2px 10px 1px #c3c3c3;border:1px solid green;border-radius:5px;box-shadow:0 5px 10px 0 #b0c1d9;box-shadow:2px 2px 10px 1px #c3c3c3;color:#353535;height:100px;max-height:100px;overflow:hidden;padding:4px 0;position:absolute;text-align:center;width:150px;z-index:1}.node .btn-holder{background:rgba(0,0,0,.23137254901960785);bottom:-35px;display:inline-block;font-size:.8em;left:0;padding:5px;position:absolute;text-align:right;transition:bottom .15s;width:100%}.node .btn-holder .btn{border-radius:5px;color:#fff;cursor:pointer;display:inline-block;height:25px;line-height:20px;margin-right:5px;padding-left:1px;padding-top:2px;text-align:center;width:25px}.node .btn-holder .btn.btn-edit{background-color:#2196f3}.node .btn-holder .btn.btn-edit:hover{background-color:#69b5f3}.node .btn-holder .btn.btn-delete{background-color:#f56060}.node .btn-holder .btn.btn-delete:hover{background-color:#f78d8d}.node .btn-connect{background-color:orange;box-shadow:0 0 2px #000;cursor:pointer;height:16px;position:absolute;right:-20px;top:calc(50% - 9px);transition:right .15s;transition:box-shadow .25s ease-in;width:16px}.node .machine-code{border-bottom:1px solid green}.node.type-1{background-color:#adc58d}.node.type-1,.node.type-1 .machine-code{border-color:#fff}.node.type-4{background-color:#fff}.node.type-4,.node.type-4 .machine-code{border-color:#65aedf}.node.type-5{background-color:#ffc107}.node.type-5,.node.type-5 .machine-code{border-color:#795548}.node.disabled{background-color:#ddd}.node.disabled,.node.disabled .machine-code{border-color:#989898}.node.current{background-color:#94c2ea}.node.current,.node.current .machine-code{border-color:#fff}.node:hover{-moz-box-shadow:2px 2px 19px #909090;-o-box-shadow:2px 2px 19px #909090;-webkit-box-shadow:2px 2px 19px #909090;box-shadow:2px 2px 19px #909090;z-index:5}.node:hover .btn-holder{bottom:0}.node:hover .btn-connect{right:5px}.machine-icon{color:#fff;font-size:18px;position:absolute;right:3px;text-shadow:1px 1px 2px #383838;top:3px}.machine-code{font-weight:700;height:21px;overflow:hidden;padding-left:5px;text-align:left}.machine-name{height:calc(100% - 17px);margin-bottom:25px;overflow-y:auto;padding:5px;text-align:justify}"]
|
|
45015
|
+
styles: [".node{-moz-box-shadow:2px 2px 10px 1px #c3c3c3;-o-box-shadow:2px 2px 10px 1px #c3c3c3;-webkit-box-shadow:2px 2px 10px 1px #c3c3c3;border:1px solid green;border-radius:5px;box-shadow:0 5px 10px 0 #b0c1d9;box-shadow:2px 2px 10px 1px #c3c3c3;color:#353535;display:flex;flex-direction:column;height:100px;max-height:100px;overflow:hidden;padding:4px 0;position:absolute;text-align:center;width:150px;z-index:1}.node .btn-holder{background:rgba(0,0,0,.23137254901960785);bottom:-35px;display:inline-block;font-size:.8em;left:0;padding:5px;position:absolute;text-align:right;transition:bottom .15s;width:100%}.node .btn-holder .btn{border-radius:5px;color:#fff;cursor:pointer;display:inline-block;height:25px;line-height:20px;margin-right:5px;padding-left:1px;padding-top:2px;text-align:center;width:25px}.node .btn-holder .btn.btn-edit{background-color:#2196f3}.node .btn-holder .btn.btn-edit:hover{background-color:#69b5f3}.node .btn-holder .btn.btn-delete{background-color:#f56060}.node .btn-holder .btn.btn-delete:hover{background-color:#f78d8d}.node .btn-connect{background-color:orange;box-shadow:0 0 2px #000;cursor:pointer;height:16px;position:absolute;right:-20px;top:calc(50% - 9px);transition:right .15s;transition:box-shadow .25s ease-in;width:16px}.node .machine-code{border-bottom:1px solid green}.node.type-1{background-color:#adc58d}.node.type-1,.node.type-1 .machine-code{border-color:#fff}.node.type-4{background-color:#fff}.node.type-4,.node.type-4 .machine-code{border-color:#65aedf}.node.type-5{background-color:#ffc107}.node.type-5,.node.type-5 .machine-code{border-color:#795548}.node.disabled{background-color:#ddd}.node.disabled,.node.disabled .machine-code{border-color:#989898}.node.current{background-color:#94c2ea}.node.current,.node.current .machine-code{border-color:#fff}.node:hover{-moz-box-shadow:2px 2px 19px #909090;-o-box-shadow:2px 2px 19px #909090;-webkit-box-shadow:2px 2px 19px #909090;box-shadow:2px 2px 19px #909090;z-index:5}.node:hover .btn-holder{bottom:0}.node:hover .btn-connect{right:5px}.machine-icon{color:#fff;font-size:18px;position:absolute;right:3px;text-shadow:1px 1px 2px #383838;top:3px}.machine-code{flex:0 0 auto;font-weight:700;min-height:21px;overflow:hidden;padding-left:5px;text-align:left}.machine-name{height:calc(100% - 17px);margin-bottom:25px;overflow-y:auto;padding:5px;text-align:justify}"]
|
|
44999
45016
|
},] }
|
|
45000
45017
|
];
|
|
45001
45018
|
StateComponent.ctorParameters = function () { return [
|
|
@@ -48490,8 +48507,8 @@
|
|
|
48490
48507
|
this.data = [];
|
|
48491
48508
|
this.allowViewAll = false;
|
|
48492
48509
|
this.isDynamicHeight = false;
|
|
48493
|
-
this.onTabChange = new i0.EventEmitter();
|
|
48494
48510
|
this.activeCodeChange = new i0.EventEmitter();
|
|
48511
|
+
this.tabContentChange = new i0.EventEmitter();
|
|
48495
48512
|
this.template = {};
|
|
48496
48513
|
this.onlyIcon = false;
|
|
48497
48514
|
this.styleClass = 'tn-tabview-beauty';
|
|
@@ -48513,6 +48530,17 @@
|
|
|
48513
48530
|
configurable: true
|
|
48514
48531
|
});
|
|
48515
48532
|
;
|
|
48533
|
+
Object.defineProperty(TnTabViewComponent.prototype, "tabContents", {
|
|
48534
|
+
set: function (value) {
|
|
48535
|
+
this._tabContents = value;
|
|
48536
|
+
if (this.ready) {
|
|
48537
|
+
this.setActiveTabContent();
|
|
48538
|
+
}
|
|
48539
|
+
},
|
|
48540
|
+
enumerable: false,
|
|
48541
|
+
configurable: true
|
|
48542
|
+
});
|
|
48543
|
+
;
|
|
48516
48544
|
Object.defineProperty(TnTabViewComponent.prototype, "vertical", {
|
|
48517
48545
|
set: function (value) {
|
|
48518
48546
|
this._vertical = value;
|
|
@@ -48571,11 +48599,32 @@
|
|
|
48571
48599
|
this.styleClass = result;
|
|
48572
48600
|
};
|
|
48573
48601
|
TnTabViewComponent.prototype.handleTabChange = function (evt) {
|
|
48602
|
+
var e_1, _a;
|
|
48574
48603
|
this.currentTabIndex = evt.index;
|
|
48575
|
-
|
|
48604
|
+
var index = 0;
|
|
48605
|
+
try {
|
|
48606
|
+
for (var _b = __values(this.data), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
48607
|
+
var item = _c.value;
|
|
48608
|
+
if (!item.hidden && this.template[item.code]) {
|
|
48609
|
+
if (index == this.currentTabIndex) {
|
|
48610
|
+
this.currentTabCode = item.code;
|
|
48611
|
+
break;
|
|
48612
|
+
}
|
|
48613
|
+
index++;
|
|
48614
|
+
}
|
|
48615
|
+
}
|
|
48616
|
+
}
|
|
48617
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
48618
|
+
finally {
|
|
48619
|
+
try {
|
|
48620
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
48621
|
+
}
|
|
48622
|
+
finally { if (e_1) throw e_1.error; }
|
|
48623
|
+
}
|
|
48624
|
+
this.activeCodeChange.emit(this.currentTabCode);
|
|
48576
48625
|
};
|
|
48577
48626
|
TnTabViewComponent.prototype.setActiveTabCodeAndFireEvent = function () {
|
|
48578
|
-
var
|
|
48627
|
+
var e_2, _a;
|
|
48579
48628
|
var index = -1;
|
|
48580
48629
|
var firsItem = null;
|
|
48581
48630
|
var lastItem = null;
|
|
@@ -48594,12 +48643,12 @@
|
|
|
48594
48643
|
}
|
|
48595
48644
|
}
|
|
48596
48645
|
}
|
|
48597
|
-
catch (
|
|
48646
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
48598
48647
|
finally {
|
|
48599
48648
|
try {
|
|
48600
48649
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
48601
48650
|
}
|
|
48602
|
-
finally { if (
|
|
48651
|
+
finally { if (e_2) throw e_2.error; }
|
|
48603
48652
|
}
|
|
48604
48653
|
// Nếu có item display thì ms set active
|
|
48605
48654
|
if (index > -1) {
|
|
@@ -48609,11 +48658,15 @@
|
|
|
48609
48658
|
this.currentTabCode = firsItem.code;
|
|
48610
48659
|
}
|
|
48611
48660
|
this.activeCodeChange.emit(this.currentTabCode);
|
|
48612
|
-
this.onTabChange.emit({
|
|
48613
|
-
index: this.currentTabIndex,
|
|
48614
|
-
code: this.currentTabCode
|
|
48615
|
-
});
|
|
48616
48661
|
}
|
|
48662
|
+
this.setActiveTabContent();
|
|
48663
|
+
};
|
|
48664
|
+
TnTabViewComponent.prototype.setActiveTabContent = function () {
|
|
48665
|
+
var _this = this;
|
|
48666
|
+
if (!this._tabContents)
|
|
48667
|
+
return;
|
|
48668
|
+
var tabContent = this._tabContents.find(function (q) { return q.tabCode == _this.currentTabCode; });
|
|
48669
|
+
this.tabContentChange.emit(tabContent);
|
|
48617
48670
|
};
|
|
48618
48671
|
return TnTabViewComponent;
|
|
48619
48672
|
}());
|
|
@@ -48629,13 +48682,14 @@
|
|
|
48629
48682
|
]; };
|
|
48630
48683
|
TnTabViewComponent.propDecorators = {
|
|
48631
48684
|
children: [{ type: i0.ContentChildren, args: [i0.TemplateRef,] }],
|
|
48685
|
+
tabContents: [{ type: i0.ContentChildren, args: ['tabContent', { descendants: true },] }],
|
|
48632
48686
|
vertical: [{ type: i0.Input }],
|
|
48633
48687
|
data: [{ type: i0.Input }],
|
|
48634
48688
|
allowViewAll: [{ type: i0.Input }],
|
|
48635
48689
|
activeCode: [{ type: i0.Input }],
|
|
48636
48690
|
isDynamicHeight: [{ type: i0.Input }],
|
|
48637
|
-
|
|
48638
|
-
|
|
48691
|
+
activeCodeChange: [{ type: i0.Output }],
|
|
48692
|
+
tabContentChange: [{ type: i0.Output }]
|
|
48639
48693
|
};
|
|
48640
48694
|
|
|
48641
48695
|
var TnTemplateComponent = /** @class */ (function (_super) {
|
|
@@ -59862,6 +59916,7 @@
|
|
|
59862
59916
|
exports.CommonService = CommonService;
|
|
59863
59917
|
exports.CompareValidator = CompareValidator;
|
|
59864
59918
|
exports.ComponentBase = ComponentBase;
|
|
59919
|
+
exports.ComponentBaseWithButton = ComponentBaseWithButton;
|
|
59865
59920
|
exports.ComponentConstants = ComponentConstants;
|
|
59866
59921
|
exports.ComponentContextService = ComponentContextService;
|
|
59867
59922
|
exports.ConditionalBuilderService = ConditionalBuilderService;
|