tnx-shared 5.3.250 → 5.3.252
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 +11 -7
- 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 +2 -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/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/html-preview/html-preview.component.js +3 -3
- package/fesm2015/tnx-shared.js +11 -46
- package/fesm2015/tnx-shared.js.map +1 -1
- package/package.json +2 -2
- 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
|
}
|
|
@@ -43827,7 +43829,7 @@
|
|
|
43827
43829
|
{ type: i0.Component, args: [{
|
|
43828
43830
|
// tslint:disable-next-line: component-selector
|
|
43829
43831
|
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\"
|
|
43832
|
+
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
43833
|
providers: [
|
|
43832
43834
|
{
|
|
43833
43835
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
@@ -49918,6 +49920,7 @@
|
|
|
49918
49920
|
this.showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
|
|
49919
49921
|
this.hideTransitionOptions = '.1s linear';
|
|
49920
49922
|
this.autocomplete = 'off';
|
|
49923
|
+
this.limitRowItem = false;
|
|
49921
49924
|
this.onModelChange = function () { };
|
|
49922
49925
|
this.onModelTouched = function () { };
|
|
49923
49926
|
this.showCountItem = false;
|
|
@@ -49931,8 +49934,8 @@
|
|
|
49931
49934
|
set: function (value) {
|
|
49932
49935
|
var rowHeight = 27;
|
|
49933
49936
|
var padding = 7;
|
|
49934
|
-
this._maxHeighContainerItem = Math.round(value *
|
|
49935
|
-
this._maxHeighContainerItemStr = this._maxHeighContainerItem.toString() + 'px';
|
|
49937
|
+
this._maxHeighContainerItem = Math.round(value * (rowHeight + padding / 2)) + padding;
|
|
49938
|
+
this._maxHeighContainerItemStr = !this.limitRowItem ? '10000px' : this._maxHeighContainerItem.toString() + 'px';
|
|
49936
49939
|
},
|
|
49937
49940
|
enumerable: false,
|
|
49938
49941
|
configurable: true
|
|
@@ -49970,7 +49973,7 @@
|
|
|
49970
49973
|
}, 1);
|
|
49971
49974
|
this.highlightOptionChanged = false;
|
|
49972
49975
|
}
|
|
49973
|
-
if (this.multiContainerEL) {
|
|
49976
|
+
if (this.multiContainerEL && this.limitRowItem) {
|
|
49974
49977
|
var lastItemSelected = dom.DomHandler.findSingle(this.multiContainerEL.nativeElement, 'li:first-child');
|
|
49975
49978
|
this.multiContainerEL.nativeElement.scrollTop = 10000;
|
|
49976
49979
|
var rectParent = this.multiContainerEL.nativeElement.getBoundingClientRect();
|
|
@@ -50479,7 +50482,7 @@
|
|
|
50479
50482
|
AutoComplete.decorators = [
|
|
50480
50483
|
{ type: i0.Component, args: [{
|
|
50481
50484
|
selector: 'p-autoComplete',
|
|
50482
|
-
template: "
|
|
50485
|
+
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
50486
|
animations: [
|
|
50484
50487
|
animations$1.trigger('overlayAnimation', [
|
|
50485
50488
|
animations$1.transition(':enter', [
|
|
@@ -50557,6 +50560,7 @@
|
|
|
50557
50560
|
hideTransitionOptions: [{ type: i0.Input }],
|
|
50558
50561
|
autofocus: [{ type: i0.Input }],
|
|
50559
50562
|
autocomplete: [{ type: i0.Input }],
|
|
50563
|
+
limitRowItem: [{ type: i0.Input }],
|
|
50560
50564
|
maxRowItem: [{ type: i0.Input }],
|
|
50561
50565
|
containerEL: [{ type: i0.ViewChild, args: ['container',] }],
|
|
50562
50566
|
inputEL: [{ type: i0.ViewChild, args: ['in',] }],
|
|
@@ -50715,7 +50719,7 @@
|
|
|
50715
50719
|
HtmlPreviewComponent.decorators = [
|
|
50716
50720
|
{ type: i0.Component, args: [{
|
|
50717
50721
|
selector: 'html-preview',
|
|
50718
|
-
template: "<div class=\"preview-box\" id=\"math-preview-box-{{id}}\" [ngStyle]=\"{'height': control.height + 'px'}\">\n <tn-custom-scrollbar [showScrollHorizontal]=\"true\">\n <div #mathContent id=\"mathPreview-{{id}}\"></div>\n </tn-custom-scrollbar>\n</div>",
|
|
50722
|
+
template: "<div class=\"preview-box\" [ngClass]=\"{ 'disabled-box': control.disabled }\" id=\"math-preview-box-{{id}}\" [ngStyle]=\"{'height': control.disabled ? 'auto' : control.height + 'px'}\">\n <tn-custom-scrollbar [showScrollHorizontal]=\"true\">\n <div #mathContent id=\"mathPreview-{{id}}\"></div>\n </tn-custom-scrollbar>\n</div>",
|
|
50719
50723
|
providers: [
|
|
50720
50724
|
ComponentContextService,
|
|
50721
50725
|
{
|
|
@@ -50724,7 +50728,7 @@
|
|
|
50724
50728
|
multi: true
|
|
50725
50729
|
},
|
|
50726
50730
|
],
|
|
50727
|
-
styles: ["::ng-deep html-preview .preview-box{border:1px solid #ced4da;padding:10px;background:#efefef}::ng-deep html-preview .ps{background:#efefef}"]
|
|
50731
|
+
styles: ["::ng-deep html-preview .preview-box{border:1px solid #ced4da;padding:10px;background:#efefef}::ng-deep html-preview .preview-box .ps{background:#efefef}::ng-deep html-preview .disabled-box,::ng-deep html-preview .disabled-box .ps{background:#e9ecef!important}"]
|
|
50728
50732
|
},] }
|
|
50729
50733
|
];
|
|
50730
50734
|
HtmlPreviewComponent.ctorParameters = function () { return [
|