tnx-shared 5.3.251 → 5.3.253
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 +42 -24
- 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/form-schema.d.ts +4 -0
- package/classes/form-schema.d.ts.map +1 -1
- package/components/autocomplete/autocomplete.component.d.ts +1 -0
- package/components/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/components/user-picker/user-picker.component.d.ts.map +1 -1
- package/esm2015/classes/form-schema.js +3 -1
- package/esm2015/components/autocomplete/autocomplete.component.js +7 -44
- package/esm2015/components/autocomplete-picker/autocomplete-picker.component.js +2 -2
- package/esm2015/components/user-picker/user-picker.component.js +4 -1
- package/esm2015/services/templateinstance.service.js +5 -1
- package/fesm2015/tnx-shared.js +16 -44
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- package/services/templateinstance.service.d.ts +1 -0
- package/services/templateinstance.service.d.ts.map +1 -1
- package/tnx-shared.metadata.json +1 -1
|
@@ -1665,6 +1665,8 @@
|
|
|
1665
1665
|
_this.isCheckWriteValue = false;
|
|
1666
1666
|
_this.usePicker = true;
|
|
1667
1667
|
_this.isCaching = false; // dùng riêng cho canBoPicker
|
|
1668
|
+
_this.limitRowItem = false;
|
|
1669
|
+
_this.maxRowItem = 2;
|
|
1668
1670
|
for (var key in init) {
|
|
1669
1671
|
_this[key] = init[key];
|
|
1670
1672
|
}
|
|
@@ -10277,6 +10279,11 @@
|
|
|
10277
10279
|
var api = this.serviceUri + "/LatexToBase64";
|
|
10278
10280
|
return this._httpClient.post(api, { laTex: laTex, font: font }).toPromise();
|
|
10279
10281
|
};
|
|
10282
|
+
TemplateInstanceService.prototype.laTexToImage = function (laTex, font) {
|
|
10283
|
+
if (font === void 0) { font = 54; }
|
|
10284
|
+
var api = this.serviceUri + "/LatexToImage";
|
|
10285
|
+
return this._httpClient.post(api, { laTex: laTex, font: font }, { responseType: 'blob' }).toPromise();
|
|
10286
|
+
};
|
|
10280
10287
|
TemplateInstanceService.prototype._export = function (model) {
|
|
10281
10288
|
return __awaiter(this, void 0, void 0, function () {
|
|
10282
10289
|
var url;
|
|
@@ -43827,7 +43834,7 @@
|
|
|
43827
43834
|
{ type: i0.Component, args: [{
|
|
43828
43835
|
// tslint:disable-next-line: component-selector
|
|
43829
43836
|
selector: 'autocomplete-picker',
|
|
43830
|
-
template: "<div class=\"p-inputgroup autocomplete-picker\" *ngIf=\"control\" [class.has-value]=\"hasValue\"\n [class.multiple]=\"control.multiple\" [class.disabled]=\"control.disabled\">\n <div style=\"width: calc(100% - 28px)\" [pTooltip]=\"tooltip\" tooltipPosition=\"top\">\n <p-autoComplete #autoComplete emptyMessage=\"Kh\u00F4ng c\u00F3 k\u1EBFt qu\u1EA3 n\u00E0o\"
|
|
43837
|
+
template: "<div class=\"p-inputgroup autocomplete-picker\" *ngIf=\"control\" [class.has-value]=\"hasValue\"\n [class.multiple]=\"control.multiple\" [class.disabled]=\"control.disabled\">\n <div style=\"width: calc(100% - 28px)\" [pTooltip]=\"tooltip\" tooltipPosition=\"top\">\n <p-autoComplete #autoComplete [limitRowItem]=\"control.limitRowItem\" emptyMessage=\"Kh\u00F4ng c\u00F3 k\u1EBFt qu\u1EA3 n\u00E0o\"\n [ngClass]=\"'custom-autocomplete'\" [disabled]=\"disabled\" [placeholder]=\"control.placeholder\"\n [appendTo]=\"control.appendTo\" [maxRowItem]=\"control.maxRowItem\" [suggestions]=\"results\" field=\"label\"\n [styleClass]=\"control.validators && control.required ? 'rq' : ''\" [multiple]=\"control.multiple\"\n [minLength]=\"2\" [(ngModel)]=\"selectedValueObject\" (onFocus)=\"handleFocus($event)\"\n (onBlur)=\"handleBlur($event)\" (completeMethod)=\"search($event)\" (onKeyUp)=\"handleKeyUp($event)\"\n (onSelect)=\"handleSelect($event)\" (onUnselect)=\"handleUnSelect($event)\">\n </p-autoComplete>\n </div>\n <span *ngIf=\"!control.multiple && !disabled && hasValue\" class=\"icon-clear\" (click)=\"clearValue()\"><i\n class=\"fas fa-times\"></i></span>\n <button class=\"custom-autocomplete-button\" *ngIf=\"control.usePicker\" [disabled]=\"disabled\" tabindex=\"-1\"\n (click)=\"showPickForm()\" pButton [pTooltip]=\"control.title\" icon=\"fas fa-external-link-alt\"\n type=\"button\"></button>\n</div>\n<tn-dialog #dialog *ngIf=\"showFormPicker\" styleClass=\"entity-picker-box-dialog no-padding\" [useDefaultScrollBar]=\"true\"\n [header]=\"control.title | translate\" [popupSize]=\"popupSize\" (onHide)=\"handleHide($event)\">\n <entity-picker-box #entityPickerBox [currentNode]=\"currentNode\" [control]=\"control\" [parentSetting]=\"setting\"\n [datasourceFieldFilter]=\"datasourceFieldFilter\" [advanceData]=\"advanceData\" [readOnlyValues]=\"readOnlyValues\"\n [selectedValue]=\"selectedValue\" (onContentLeftInit)=\"handleContentLeftInit($event)\"\n (onContentRightInit)=\"handleContentRightInit($event)\" (onChanged)=\"handleChangeEntity($event)\"\n (onSelect)=\"handleSelectEntity($event)\" (onUnSelect)=\"handleUnSelectEntity($event)\"\n (onDone)=\"handleHide($event)\" (onRowSelect)=\"handleRowSelect($event)\">\n </entity-picker-box>\n <ng-template #footer>\n <button type=\" button\" pButton class=\"p-button-text\" (click)=\"onClickSubmitButton($event, entityPickerBox)\"\n [label]=\"'Ho\u00E0n th\u00E0nh' | translate\" icon=\"pi pi-check\"></button>\n </ng-template>\n</tn-dialog>",
|
|
43831
43838
|
providers: [
|
|
43832
43839
|
{
|
|
43833
43840
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
@@ -49918,6 +49925,7 @@
|
|
|
49918
49925
|
this.showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
|
|
49919
49926
|
this.hideTransitionOptions = '.1s linear';
|
|
49920
49927
|
this.autocomplete = 'off';
|
|
49928
|
+
this.limitRowItem = false;
|
|
49921
49929
|
this.onModelChange = function () { };
|
|
49922
49930
|
this.onModelTouched = function () { };
|
|
49923
49931
|
this.showCountItem = false;
|
|
@@ -49931,8 +49939,8 @@
|
|
|
49931
49939
|
set: function (value) {
|
|
49932
49940
|
var rowHeight = 27;
|
|
49933
49941
|
var padding = 7;
|
|
49934
|
-
this._maxHeighContainerItem = Math.round(value *
|
|
49935
|
-
this._maxHeighContainerItemStr = this._maxHeighContainerItem.toString() + 'px';
|
|
49942
|
+
this._maxHeighContainerItem = Math.round(value * (rowHeight + padding / 2)) + padding;
|
|
49943
|
+
this._maxHeighContainerItemStr = !this.limitRowItem ? '10000px' : this._maxHeighContainerItem.toString() + 'px';
|
|
49936
49944
|
},
|
|
49937
49945
|
enumerable: false,
|
|
49938
49946
|
configurable: true
|
|
@@ -49970,7 +49978,7 @@
|
|
|
49970
49978
|
}, 1);
|
|
49971
49979
|
this.highlightOptionChanged = false;
|
|
49972
49980
|
}
|
|
49973
|
-
if (this.multiContainerEL) {
|
|
49981
|
+
if (this.multiContainerEL && this.limitRowItem) {
|
|
49974
49982
|
var lastItemSelected = dom.DomHandler.findSingle(this.multiContainerEL.nativeElement, 'li:first-child');
|
|
49975
49983
|
this.multiContainerEL.nativeElement.scrollTop = 10000;
|
|
49976
49984
|
var rectParent = this.multiContainerEL.nativeElement.getBoundingClientRect();
|
|
@@ -50479,7 +50487,7 @@
|
|
|
50479
50487
|
AutoComplete.decorators = [
|
|
50480
50488
|
{ type: i0.Component, args: [{
|
|
50481
50489
|
selector: 'p-autoComplete',
|
|
50482
|
-
template: "
|
|
50490
|
+
template: "<span #container\n [ngClass]=\"{'p-autocomplete p-component':true,'p-autocomplete-dd':dropdown,'p-autocomplete-multiple':multiple}\"\n [ngStyle]=\"style\" [class]=\"styleClass\">\n <input *ngIf=\"!multiple\" #in [attr.type]=\"type\" [attr.id]=\"inputId\" [ngStyle]=\"inputStyle\" [class]=\"inputStyleClass\"\n [autocomplete]=\"autocomplete\" [attr.required]=\"required\" [attr.name]=\"name\"\n class=\"p-autocomplete-input p-inputtext p-component\"\n [ngClass]=\"{'p-autocomplete-dd-input':dropdown,'p-disabled': disabled}\" [value]=\"inputFieldValue\"\n aria-autocomplete=\"list\" [attr.aria-controls]=\"listId\" role=\"searchbox\" [attr.aria-expanded]=\"overlayVisible\"\n aria-haspopup=\"true\" [attr.aria-activedescendant]=\"'p-highlighted-option'\" (click)=\"onInputClick($event)\"\n (input)=\"onInput($event)\" (keydown)=\"onKeydown($event)\" (keyup)=\"onKeyup($event)\" [attr.autofocus]=\"autofocus\"\n (focus)=\"onInputFocus($event)\" (blur)=\"onInputBlur($event)\" (change)=\"onInputChange($event)\"\n (paste)=\"onInputPaste($event)\" [attr.placeholder]=\"placeholder\" [attr.size]=\"size\" [attr.maxlength]=\"maxlength\"\n [attr.tabindex]=\"tabindex\" [readonly]=\"readonly\" [disabled]=\"disabled\" [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\" [attr.aria-required]=\"required\">\n <ul *ngIf=\"multiple\" #multiContainer class=\"p-autocomplete-multiple-container p-component p-inputtext\"\n [ngClass]=\"{'p-disabled':disabled,'p-focus':focus}\" (click)=\"multiIn.focus()\"\n [style.max-height]=\"_maxHeighContainerItemStr\">\n <li #token *ngFor=\"let val of value\" class=\"p-autocomplete-token\" [class.disabled]=\"val._disabled\">\n <ng-container *ngTemplateOutlet=\"selectedItemTemplate; context: {$implicit: val}\"></ng-container>\n <span *ngIf=\"!selectedItemTemplate\" class=\"p-autocomplete-token-label\">{{resolveFieldData(val)}}</span>\n <span *ngIf=\"!disabled && !val._disabled\" class=\"p-autocomplete-token-icon pi pi-times-circle\"\n (click)=\"removeItem(token)\"></span>\n </li>\n <li class=\"p-autocomplete-token p-autocomplete-countItem\" *ngIf=\"showCountItem && value \" (click)=\"showMore()\">\n C\u00F3 {{value.length}} b\u1EA3n ghi ...</li>\n <li class=\"p-autocomplete-token p-autocomplete-countItem\" *ngIf=\"_maxHeighContainerItemStrOld != null\"\n (click)=\"showLess()\"><span><i class=\"fas fa-arrow-up\"></i></span><span>Thu l\u1EA1i</span></li>\n <li class=\"p-autocomplete-input-token\">\n <input #multiIn [attr.type]=\"type\" [attr.id]=\"inputId\" [disabled]=\"disabled\"\n [attr.placeholder]=\"(value&&value.length ? null : placeholder)\" [attr.tabindex]=\"tabindex\"\n [attr.maxlength]=\"maxlength\" (input)=\"onInput($event)\" (click)=\"onInputClick($event)\"\n (keydown)=\"onKeydown($event)\" [readonly]=\"readonly\" (keyup)=\"onKeyup($event)\"\n [attr.autofocus]=\"autofocus\" (focus)=\"onInputFocus($event)\" (blur)=\"onInputBlur($event)\"\n (change)=\"onInputChange($event)\" (paste)=\"onInputPaste($event)\" [autocomplete]=\"autocomplete\"\n [ngStyle]=\"inputStyle\" [class]=\"inputStyleClass\" [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledBy\" [attr.aria-required]=\"required\" aria-autocomplete=\"list\"\n [attr.aria-controls]=\"listId\" role=\"searchbox\" [attr.aria-expanded]=\"overlayVisible\"\n aria-haspopup=\"true\" [attr.aria-activedescendant]=\"'p-highlighted-option'\">\n </li>\n </ul>\n <i *ngIf=\"loading\" class=\"p-autocomplete-loader pi pi-spinner pi-spin\"></i><button #ddBtn type=\"button\" pButton\n [icon]=\"dropdownIcon\" class=\"p-autocomplete-dropdown\" [disabled]=\"disabled\" pRipple\n (click)=\"handleDropdownClick($event)\" *ngIf=\"dropdown\" [attr.tabindex]=\"tabindex\"></button>\n <div #panel *ngIf=\"overlayVisible\" [ngClass]=\"['p-autocomplete-panel p-component']\"\n [style.max-height]=\"scrollHeight\" [ngStyle]=\"panelStyle\" [class]=\"panelStyleClass\"\n [@overlayAnimation]=\"{value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}\"\n (@overlayAnimation.start)=\"onOverlayAnimationStart($event)\"\n (@overlayAnimation.done)=\"onOverlayAnimationDone($event)\">\n <ul role=\"listbox\" [attr.id]=\"listId\" class=\"p-autocomplete-items\">\n <li role=\"option\" *ngFor=\"let option of suggestions; let idx = index\" class=\"p-autocomplete-item\" pRipple\n [ngClass]=\"{'p-highlight': (option === highlightOption)}\"\n [id]=\"highlightOption == option ? 'p-highlighted-option':''\" (click)=\"selectItem(option)\">\n <span *ngIf=\"!itemTemplate\">{{resolveFieldData(option)}}</span>\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: {$implicit: option, index: idx}\"></ng-container>\n </li>\n <li *ngIf=\"noResults && emptyMessage\" class=\"p-autocomplete-emptymessage p-autocomplete-item\">\n {{emptyMessage}}</li>\n </ul>\n </div>\n</span>",
|
|
50483
50491
|
animations: [
|
|
50484
50492
|
animations$1.trigger('overlayAnimation', [
|
|
50485
50493
|
animations$1.transition(':enter', [
|
|
@@ -50557,6 +50565,7 @@
|
|
|
50557
50565
|
hideTransitionOptions: [{ type: i0.Input }],
|
|
50558
50566
|
autofocus: [{ type: i0.Input }],
|
|
50559
50567
|
autocomplete: [{ type: i0.Input }],
|
|
50568
|
+
limitRowItem: [{ type: i0.Input }],
|
|
50560
50569
|
maxRowItem: [{ type: i0.Input }],
|
|
50561
50570
|
containerEL: [{ type: i0.ViewChild, args: ['container',] }],
|
|
50562
50571
|
inputEL: [{ type: i0.ViewChild, args: ['in',] }],
|
|
@@ -54164,28 +54173,37 @@
|
|
|
54164
54173
|
var arr, sources_1, sources_1_1, item;
|
|
54165
54174
|
var e_2, _b;
|
|
54166
54175
|
return __generator(this, function (_c) {
|
|
54167
|
-
|
|
54168
|
-
|
|
54169
|
-
|
|
54170
|
-
|
|
54171
|
-
item = sources_1_1.value;
|
|
54172
|
-
item = this.reStructureItemObject(item);
|
|
54173
|
-
arr.push(item);
|
|
54174
|
-
}
|
|
54175
|
-
}
|
|
54176
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
54177
|
-
finally {
|
|
54176
|
+
switch (_c.label) {
|
|
54177
|
+
case 0:
|
|
54178
|
+
if (!(sources != null && sources.length > 0)) return [3 /*break*/, 3];
|
|
54179
|
+
arr = [];
|
|
54178
54180
|
try {
|
|
54179
|
-
|
|
54181
|
+
for (sources_1 = __values(sources), sources_1_1 = sources_1.next(); !sources_1_1.done; sources_1_1 = sources_1.next()) {
|
|
54182
|
+
item = sources_1_1.value;
|
|
54183
|
+
item = this.reStructureItemObject(item);
|
|
54184
|
+
arr.push(item);
|
|
54185
|
+
}
|
|
54180
54186
|
}
|
|
54181
|
-
|
|
54182
|
-
|
|
54183
|
-
|
|
54184
|
-
|
|
54185
|
-
|
|
54186
|
-
|
|
54187
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
54188
|
+
finally {
|
|
54189
|
+
try {
|
|
54190
|
+
if (sources_1_1 && !sources_1_1.done && (_b = sources_1.return)) _b.call(sources_1);
|
|
54191
|
+
}
|
|
54192
|
+
finally { if (e_2) throw e_2.error; }
|
|
54193
|
+
}
|
|
54194
|
+
if (!this.controlPicker.modifyDataSelected) return [3 /*break*/, 2];
|
|
54195
|
+
return [4 /*yield*/, this.controlPicker.modifyDataSelected(arr)];
|
|
54196
|
+
case 1:
|
|
54197
|
+
_c.sent();
|
|
54198
|
+
_c.label = 2;
|
|
54199
|
+
case 2:
|
|
54200
|
+
this.dataSource = arr;
|
|
54201
|
+
return [3 /*break*/, 4];
|
|
54202
|
+
case 3:
|
|
54203
|
+
this.dataSource = [];
|
|
54204
|
+
_c.label = 4;
|
|
54205
|
+
case 4: return [2 /*return*/];
|
|
54187
54206
|
}
|
|
54188
|
-
return [2 /*return*/];
|
|
54189
54207
|
});
|
|
54190
54208
|
});
|
|
54191
54209
|
};
|