@libs-ui/components-line-clamp 0.2.10-6.2
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/README.md +3 -0
- package/esm2022/index.mjs +3 -0
- package/esm2022/interfaces/config.interface.mjs +2 -0
- package/esm2022/interfaces/function-control.interface.mjs +2 -0
- package/esm2022/interfaces/index.mjs +3 -0
- package/esm2022/libs-ui-components-line-clamp.mjs +5 -0
- package/esm2022/line-clamp.component.mjs +116 -0
- package/esm2022/line-clamp.directive.mjs +70 -0
- package/fesm2022/libs-ui-components-line-clamp.mjs +190 -0
- package/fesm2022/libs-ui-components-line-clamp.mjs.map +1 -0
- package/index.d.ts +2 -0
- package/interfaces/config.interface.d.ts +11 -0
- package/interfaces/function-control.interface.d.ts +3 -0
- package/interfaces/index.d.ts +2 -0
- package/line-clamp.component.d.ts +50 -0
- package/line-clamp.directive.d.ts +23 -0
- package/package.json +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export * from './line-clamp.component';
|
|
2
|
+
export * from './interfaces';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvbGluZS1jbGFtcC9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGluZS1jbGFtcC5jb21wb25lbnQnO1xuZXhwb3J0ICogZnJvbSAnLi9pbnRlcmZhY2VzJztcbiJdfQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2Z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mFjZSBJTGluZUNsYW1wRnVuY3Rpb25Db250cm9sRXZlbnQge1xuICByZWZyZXNoOiAoKSA9PiBQcm9taXNlPHZvaWQ+O1xufVxuXG4iXX0=
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export * from './config.interface';
|
|
2
|
+
export * from './function-control.interface';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvbGluZS1jbGFtcC9zcmMvaW50ZXJmYWNlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsOEJBQThCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2NvbmZpZy5pbnRlcmZhY2UnO1xuZXhwb3J0ICogZnJvbSAnLi9mdW5jdGlvbi1jb250cm9sLmludGVyZmFjZSc7Il19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './index';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlicy11aS1jb21wb25lbnRzLWxpbmUtY2xhbXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvbGluZS1jbGFtcC9zcmMvbGlicy11aS1jb21wb25lbnRzLWxpbmUtY2xhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG4iXX0=
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { AsyncPipe, NgClass } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, HostListener, effect, input, output, signal, untracked } from '@angular/core';
|
|
3
|
+
import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
|
|
4
|
+
import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
|
|
5
|
+
import { LibsUiPipesEscapeHtmlPipe } from '@libs-ui/pipes-escape-html';
|
|
6
|
+
import { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';
|
|
7
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
8
|
+
import { LibsUiComponentsLineClampDirective } from './line-clamp.directive';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
import * as i1 from "@ngx-translate/core";
|
|
11
|
+
export class LibsUiComponentsLineClampComponent {
|
|
12
|
+
/** PROPERTY */
|
|
13
|
+
displayLineClamp = signal(false);
|
|
14
|
+
isCollapse = signal(false);
|
|
15
|
+
contentClamp = signal('');
|
|
16
|
+
contentDisplay = signal('');
|
|
17
|
+
/** INPUT */
|
|
18
|
+
content = input.required();
|
|
19
|
+
lengthLimitDisplay = input(200, { transform: val => val || 200 });
|
|
20
|
+
maxHeight = input.required(); // maxHeight = (line-height của text)*(số dòng mong muốn)
|
|
21
|
+
ignoreShowButtonCollapseExpand = input();
|
|
22
|
+
ignoreShowButtonCollapse = input();
|
|
23
|
+
showTooltip = input();
|
|
24
|
+
timeHidePopoverOnMouseout = input(50, { transform: val => val ?? 50 });
|
|
25
|
+
maxWidthTooltip = input(250, { transform: val => val ?? 250 });
|
|
26
|
+
maxHeightTooltip = input(150, { transform: val => val ?? 150 });
|
|
27
|
+
zIndexPopover = input(1001, { transform: val => val ?? 1001 });
|
|
28
|
+
isInnerText = input(); // không cần escapeHTML content khi biến bằng true
|
|
29
|
+
classClassLabelButtonCollapseExpand = input('libs-ui-font-h5r', { transform: val => val ?? 'libs-ui-font-h5r' });
|
|
30
|
+
classClassIncludeButtonCollapseExpand = input('!p-0', { transform: val => val ?? '!p-0' });
|
|
31
|
+
ignoreStopPropagationTooltipEvent = input(false, { transform: val => val ?? false });
|
|
32
|
+
ngClassObject = input({ 'libs-ui-line-clamp-content libs-ui-font-h5r': true }, { transform: val => val || { 'libs-ui-line-clamp-content lib-ui-font-h5r': true } }); // object ngClass
|
|
33
|
+
hasBackgroundGradient = input(false, { transform: val => val ?? false });
|
|
34
|
+
labelButtonViewMore = input();
|
|
35
|
+
labelButtonCollapse = input();
|
|
36
|
+
directionTooltip = input('top', { transform: val => val ?? 'top' });
|
|
37
|
+
useXssFilter = input(true, { transform: val => val ?? true });
|
|
38
|
+
;
|
|
39
|
+
/** OUTPUT */
|
|
40
|
+
outDisplayLineClamp = output();
|
|
41
|
+
outAction = output();
|
|
42
|
+
outClick = output();
|
|
43
|
+
outFunctionControl = output();
|
|
44
|
+
constructor() {
|
|
45
|
+
effect(() => {
|
|
46
|
+
untracked(() => {
|
|
47
|
+
this.contentDisplay.set(this.content());
|
|
48
|
+
this.displayLineClamp.set(false);
|
|
49
|
+
this.isCollapse.set(false);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async ngOnInit() {
|
|
54
|
+
this.outFunctionControl.emit({
|
|
55
|
+
refresh: this.refresh.bind(this)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/** FUNCTIONS */
|
|
59
|
+
async handlerContentSub(content) {
|
|
60
|
+
if (this.content() !== content) {
|
|
61
|
+
this.displayLineClamp.set(true);
|
|
62
|
+
this.isCollapse.set(true);
|
|
63
|
+
this.contentClamp.set(content);
|
|
64
|
+
this.contentDisplay.set(content);
|
|
65
|
+
this.outDisplayLineClamp.emit(true);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async viewMore(e) {
|
|
69
|
+
e.stopPropagation();
|
|
70
|
+
this.isCollapse.set(false);
|
|
71
|
+
this.contentDisplay.set(this.content());
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
this.outAction.emit('view-more');
|
|
74
|
+
}
|
|
75
|
+
async hiddenMore(e) {
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
this.isCollapse.set(true);
|
|
78
|
+
this.contentDisplay.set(this.contentClamp());
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
this.outAction.emit('hidden-more');
|
|
81
|
+
}
|
|
82
|
+
async resize() {
|
|
83
|
+
this.refresh();
|
|
84
|
+
}
|
|
85
|
+
async refresh() {
|
|
86
|
+
this.contentDisplay.set(this.content());
|
|
87
|
+
this.displayLineClamp.set(false);
|
|
88
|
+
this.isCollapse.set(false);
|
|
89
|
+
}
|
|
90
|
+
async handlerClick(event) {
|
|
91
|
+
if (typeof event === 'string' && event !== 'click') {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
this.outClick.emit(event);
|
|
95
|
+
}
|
|
96
|
+
ngOnDestroy() {
|
|
97
|
+
this.displayLineClamp.set(false);
|
|
98
|
+
}
|
|
99
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsLineClampComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
100
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsLineClampComponent, isStandalone: true, selector: "libs_ui-components-line_clamp", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, lengthLimitDisplay: { classPropertyName: "lengthLimitDisplay", publicName: "lengthLimitDisplay", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: true, transformFunction: null }, ignoreShowButtonCollapseExpand: { classPropertyName: "ignoreShowButtonCollapseExpand", publicName: "ignoreShowButtonCollapseExpand", isSignal: true, isRequired: false, transformFunction: null }, ignoreShowButtonCollapse: { classPropertyName: "ignoreShowButtonCollapse", publicName: "ignoreShowButtonCollapse", isSignal: true, isRequired: false, transformFunction: null }, showTooltip: { classPropertyName: "showTooltip", publicName: "showTooltip", isSignal: true, isRequired: false, transformFunction: null }, timeHidePopoverOnMouseout: { classPropertyName: "timeHidePopoverOnMouseout", publicName: "timeHidePopoverOnMouseout", isSignal: true, isRequired: false, transformFunction: null }, maxWidthTooltip: { classPropertyName: "maxWidthTooltip", publicName: "maxWidthTooltip", isSignal: true, isRequired: false, transformFunction: null }, maxHeightTooltip: { classPropertyName: "maxHeightTooltip", publicName: "maxHeightTooltip", isSignal: true, isRequired: false, transformFunction: null }, zIndexPopover: { classPropertyName: "zIndexPopover", publicName: "zIndexPopover", isSignal: true, isRequired: false, transformFunction: null }, isInnerText: { classPropertyName: "isInnerText", publicName: "isInnerText", isSignal: true, isRequired: false, transformFunction: null }, classClassLabelButtonCollapseExpand: { classPropertyName: "classClassLabelButtonCollapseExpand", publicName: "classClassLabelButtonCollapseExpand", isSignal: true, isRequired: false, transformFunction: null }, classClassIncludeButtonCollapseExpand: { classPropertyName: "classClassIncludeButtonCollapseExpand", publicName: "classClassIncludeButtonCollapseExpand", isSignal: true, isRequired: false, transformFunction: null }, ignoreStopPropagationTooltipEvent: { classPropertyName: "ignoreStopPropagationTooltipEvent", publicName: "ignoreStopPropagationTooltipEvent", isSignal: true, isRequired: false, transformFunction: null }, ngClassObject: { classPropertyName: "ngClassObject", publicName: "ngClassObject", isSignal: true, isRequired: false, transformFunction: null }, hasBackgroundGradient: { classPropertyName: "hasBackgroundGradient", publicName: "hasBackgroundGradient", isSignal: true, isRequired: false, transformFunction: null }, labelButtonViewMore: { classPropertyName: "labelButtonViewMore", publicName: "labelButtonViewMore", isSignal: true, isRequired: false, transformFunction: null }, labelButtonCollapse: { classPropertyName: "labelButtonCollapse", publicName: "labelButtonCollapse", isSignal: true, isRequired: false, transformFunction: null }, directionTooltip: { classPropertyName: "directionTooltip", publicName: "directionTooltip", isSignal: true, isRequired: false, transformFunction: null }, useXssFilter: { classPropertyName: "useXssFilter", publicName: "useXssFilter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outDisplayLineClamp: "outDisplayLineClamp", outAction: "outAction", outClick: "outClick", outFunctionControl: "outFunctionControl" }, host: { listeners: { "window:resize": "resize($event)" } }, ngImport: i0, template: "@if (!displayLineClamp()) {\n @if (!isInnerText()) {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerHTML\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerHtml]=\"(content() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n } @else {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerText\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerText]=\"content() | translate\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n }\n}\n@else {\n <libs_ui-components-popover class=\"relative\"\n type=\"other\"\n [ignoreShowPopover]=\"!showTooltip()\"\n [ignoreStopPropagationEvent]=\"ignoreStopPropagationTooltipEvent()\"\n [config]=\"{\n timerDestroy:timeHidePopoverOnMouseout(),\n maxWidth:maxWidthTooltip() ,\n maxHeight:maxHeightTooltip(),\n direction:directionTooltip(),\n content: isInnerText() ? (this.content() | LibsUiPipesEscapeHtmlPipe) : this.content(),\n zIndex: zIndexPopover()\n }\"\n (outEvent)=\"handlerClick($event)\">\n @if (isCollapse() && hasBackgroundGradient()) {\n <div class=\"h-[40px] libs-ui-line-clamp-bg-gradient\"></div>\n }\n @if (!isInnerText()) {\n <div [ngClass]=\"ngClassObject()\"\n [innerHtml]=\"(contentDisplay() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\">\n </div>\n } @else {\n <div [ngClass]=\"ngClassObject()\"\n [innerText]=\"contentDisplay() | translate\">\n </div>\n }\n </libs_ui-components-popover>\n\n @if (!ignoreShowButtonCollapseExpand()) {\n @if (isCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonViewMore() || 'i18n_view_more'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"viewMore($event)\" />\n } @else {\n @if (!ignoreShowButtonCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonCollapse() || 'i18n_collapse'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"hiddenMore($event)\" />\n }\n }\n }\n}\n", styles: [".libs-ui-line-clamp-content{font-weight:400;text-align:start}.libs-ui-line-clamp-bg-gradient{opacity:.5;background:linear-gradient(180deg,#fff0,#fffffff2 51.56%,#fff);position:absolute;width:100%;bottom:0}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: LibsUiComponentsLineClampDirective, selector: "[LibsUiComponentsLineClampDirective]", inputs: ["lengthLimitDisplay", "methodDisplay", "content", "ignoreThreeDots"], outputs: ["outContentSub"] }, { kind: "pipe", type: LibsUiPipesSecurityTrustPipe, name: "LibsUiPipesSecurityTrustPipe" }, { kind: "pipe", type: LibsUiPipesEscapeHtmlPipe, name: "LibsUiPipesEscapeHtmlPipe" }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
101
|
+
}
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsLineClampComponent, decorators: [{
|
|
103
|
+
type: Component,
|
|
104
|
+
args: [{ selector: 'libs_ui-components-line_clamp', standalone: true, imports: [
|
|
105
|
+
NgClass, TranslateModule, AsyncPipe,
|
|
106
|
+
LibsUiComponentsLineClampDirective,
|
|
107
|
+
LibsUiPipesSecurityTrustPipe,
|
|
108
|
+
LibsUiPipesEscapeHtmlPipe,
|
|
109
|
+
LibsUiComponentsPopoverComponent,
|
|
110
|
+
LibsUiComponentsButtonsButtonComponent
|
|
111
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!displayLineClamp()) {\n @if (!isInnerText()) {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerHTML\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerHtml]=\"(content() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n } @else {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerText\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerText]=\"content() | translate\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n }\n}\n@else {\n <libs_ui-components-popover class=\"relative\"\n type=\"other\"\n [ignoreShowPopover]=\"!showTooltip()\"\n [ignoreStopPropagationEvent]=\"ignoreStopPropagationTooltipEvent()\"\n [config]=\"{\n timerDestroy:timeHidePopoverOnMouseout(),\n maxWidth:maxWidthTooltip() ,\n maxHeight:maxHeightTooltip(),\n direction:directionTooltip(),\n content: isInnerText() ? (this.content() | LibsUiPipesEscapeHtmlPipe) : this.content(),\n zIndex: zIndexPopover()\n }\"\n (outEvent)=\"handlerClick($event)\">\n @if (isCollapse() && hasBackgroundGradient()) {\n <div class=\"h-[40px] libs-ui-line-clamp-bg-gradient\"></div>\n }\n @if (!isInnerText()) {\n <div [ngClass]=\"ngClassObject()\"\n [innerHtml]=\"(contentDisplay() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\">\n </div>\n } @else {\n <div [ngClass]=\"ngClassObject()\"\n [innerText]=\"contentDisplay() | translate\">\n </div>\n }\n </libs_ui-components-popover>\n\n @if (!ignoreShowButtonCollapseExpand()) {\n @if (isCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonViewMore() || 'i18n_view_more'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"viewMore($event)\" />\n } @else {\n @if (!ignoreShowButtonCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonCollapse() || 'i18n_collapse'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"hiddenMore($event)\" />\n }\n }\n }\n}\n", styles: [".libs-ui-line-clamp-content{font-weight:400;text-align:start}.libs-ui-line-clamp-bg-gradient{opacity:.5;background:linear-gradient(180deg,#fff0,#fffffff2 51.56%,#fff);position:absolute;width:100%;bottom:0}\n"] }]
|
|
112
|
+
}], ctorParameters: () => [], propDecorators: { resize: [{
|
|
113
|
+
type: HostListener,
|
|
114
|
+
args: ['window:resize', ['$event']]
|
|
115
|
+
}] } });
|
|
116
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGluZS1jbGFtcC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvbGluZS1jbGFtcC9zcmMvbGluZS1jbGFtcC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvbGluZS1jbGFtcC9zcmMvbGluZS1jbGFtcC5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE9BQU8sRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ3JELE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxTQUFTLEVBQUUsWU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AoIWlnbm9yZVNob3dCdXR0b25Db2xsYXBzZSgpKSB7XG4gICAgICAgIDxsaWJzX3VpLWNvbXBvbmVudHMtYnV0dG9ucy1idXR0b24gdHlwZT1cImJ1dHRvbi1saW5rLXByaW1hcnlcIlxuICAgICAgICAgIFtsYWJlbF09XCJsYWJlbEJ1dHRvbkNvbGxhcHNlKCkgfHwgJ2kxOG5fY29sbGFwc2UnXCJcbiAgICAgICAgICBbY2xhc3NJbmNsdWRlXT1cImNsYXNzQ2xhc3NJbmNsdWRlQnV0dG9uQ29sbGFwc2VFeHBhbmQoKVwiXG4gICAgICAgICAgW2NsYXNzTGFiZWxdPVwiY2xhc3NDbGFzc0xhYmVsQnV0dG9uQ29sbGFwc2VFeHBhbmQoKVwiXG4gICAgICAgICAgKG91dENsaWNrKT1cImhpZGRlbk1vcmUoJGV2ZW50KVwiIC8+XG4gICAgICB9XG4gICAgfVxuICB9XG59XG4iXX0=
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Directive, effect, ElementRef, inject, input, output, signal, untracked } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class LibsUiComponentsLineClampDirective {
|
|
4
|
+
/** PROPERTY */
|
|
5
|
+
timeInterval = signal(undefined);
|
|
6
|
+
textView = signal('');
|
|
7
|
+
/** INPUT */
|
|
8
|
+
lengthLimitDisplay = input.required();
|
|
9
|
+
methodDisplay = input.required();
|
|
10
|
+
content = input.required();
|
|
11
|
+
ignoreThreeDots = input();
|
|
12
|
+
/** OUTPUT */
|
|
13
|
+
outContentSub = output();
|
|
14
|
+
/** INJECT */
|
|
15
|
+
elementRef = inject(ElementRef);
|
|
16
|
+
constructor() {
|
|
17
|
+
effect(() => {
|
|
18
|
+
if (!this.content() || !this.methodDisplay() || !this.lengthLimitDisplay()) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
untracked(() => {
|
|
22
|
+
this.textView.set(this.content());
|
|
23
|
+
if (this.textView().length > this.lengthLimitDisplay()) {
|
|
24
|
+
this.textView.update(val => val.substring(0, this.lengthLimitDisplay()));
|
|
25
|
+
}
|
|
26
|
+
if (!this.textView()) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.process();
|
|
30
|
+
this.timeInterval.set(setInterval(() => {
|
|
31
|
+
this.process();
|
|
32
|
+
}, 250));
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** FUNCTIONS */
|
|
37
|
+
process() {
|
|
38
|
+
if (this.elementRef && this.elementRef.nativeElement[this.methodDisplay()]) {
|
|
39
|
+
clearInterval(this.timeInterval());
|
|
40
|
+
this.truncate();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
truncate() {
|
|
44
|
+
let content = this.textView();
|
|
45
|
+
while ((this.elementRef.nativeElement.scrollHeight - 2) > this.elementRef.nativeElement.offsetHeight) { // them -2 fix loi tren windows https://admin-cv.mobio.vn/issues/48107
|
|
46
|
+
if (!content) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
content = content.substring(0, content.length - 3);
|
|
50
|
+
(this.elementRef.nativeElement)[this.methodDisplay()] = this.ignoreThreeDots() ? content : `${content}...`;
|
|
51
|
+
}
|
|
52
|
+
if (content !== this.textView()) {
|
|
53
|
+
this.outContentSub.emit(this.ignoreThreeDots() ? content : `${content}...`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
ngOnDestroy() {
|
|
57
|
+
clearInterval(this.timeInterval());
|
|
58
|
+
}
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsLineClampDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
60
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: LibsUiComponentsLineClampDirective, isStandalone: true, selector: "[LibsUiComponentsLineClampDirective]", inputs: { lengthLimitDisplay: { classPropertyName: "lengthLimitDisplay", publicName: "lengthLimitDisplay", isSignal: true, isRequired: true, transformFunction: null }, methodDisplay: { classPropertyName: "methodDisplay", publicName: "methodDisplay", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, ignoreThreeDots: { classPropertyName: "ignoreThreeDots", publicName: "ignoreThreeDots", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outContentSub: "outContentSub" }, ngImport: i0 });
|
|
61
|
+
}
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsLineClampDirective, decorators: [{
|
|
63
|
+
type: Directive,
|
|
64
|
+
args: [{
|
|
65
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
66
|
+
selector: '[LibsUiComponentsLineClampDirective]',
|
|
67
|
+
standalone: true
|
|
68
|
+
}]
|
|
69
|
+
}], ctorParameters: () => [] });
|
|
70
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGluZS1jbGFtcC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzLXVpL2NvbXBvbmVudHMvbGluZS1jbGFtcC9zcmMvbGluZS1jbGFtcC5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQWEsTUFBTSxFQUFFLE1BQU0sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBT25ILE1BQU0sT0FBTyxrQ0FBa0M7SUFFN0MsZUFBZTtJQUNQLFlBQVksR0FBRyxNQUFNLENBQXFCLFNBQVMsQ0FBQyxDQUFDO0lBQ3JELFFBQVEsR0FBRyxNQUF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ICBpZiAoIWNvbnRlbnQpIHtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgY29udGVudCA9IGNvbnRlbnQuc3Vic3RyaW5nKDAsIGNvbnRlbnQubGVuZ3RoIC0gMyk7XG4gICAgICAodGhpcy5lbGVtZW50UmVmLm5hdGl2ZUVsZW1lbnQpW3RoaXMubWV0aG9kRGlzcGxheSgpXSA9IHRoaXMuaWdub3JlVGhyZWVEb3RzKCkgPyBjb250ZW50IDogYCR7Y29udGVudH0uLi5gO1xuICAgIH1cbiAgICBpZiAoY29udGVudCAhPT0gdGhpcy50ZXh0VmlldygpKSB7XG4gICAgICB0aGlzLm91dENvbnRlbnRTdWIuZW1pdCh0aGlzLmlnbm9yZVRocmVlRG90cygpID8gY29udGVudCA6IGAke2NvbnRlbnR9Li4uYCk7XG4gICAgfVxuICB9XG4gIG5nT25EZXN0cm95KCkge1xuICAgIGNsZWFySW50ZXJ2YWwodGhpcy50aW1lSW50ZXJ2YWwoKSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { NgClass, AsyncPipe } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { signal, input, output, inject, ElementRef, effect, untracked, Directive, Component, ChangeDetectionStrategy, HostListener } from '@angular/core';
|
|
4
|
+
import { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';
|
|
5
|
+
import { LibsUiComponentsPopoverComponent } from '@libs-ui/components-popover';
|
|
6
|
+
import { LibsUiPipesEscapeHtmlPipe } from '@libs-ui/pipes-escape-html';
|
|
7
|
+
import { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';
|
|
8
|
+
import * as i1 from '@ngx-translate/core';
|
|
9
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
10
|
+
|
|
11
|
+
class LibsUiComponentsLineClampDirective {
|
|
12
|
+
/** PROPERTY */
|
|
13
|
+
timeInterval = signal(undefined);
|
|
14
|
+
textView = signal('');
|
|
15
|
+
/** INPUT */
|
|
16
|
+
lengthLimitDisplay = input.required();
|
|
17
|
+
methodDisplay = input.required();
|
|
18
|
+
content = input.required();
|
|
19
|
+
ignoreThreeDots = input();
|
|
20
|
+
/** OUTPUT */
|
|
21
|
+
outContentSub = output();
|
|
22
|
+
/** INJECT */
|
|
23
|
+
elementRef = inject(ElementRef);
|
|
24
|
+
constructor() {
|
|
25
|
+
effect(() => {
|
|
26
|
+
if (!this.content() || !this.methodDisplay() || !this.lengthLimitDisplay()) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
untracked(() => {
|
|
30
|
+
this.textView.set(this.content());
|
|
31
|
+
if (this.textView().length > this.lengthLimitDisplay()) {
|
|
32
|
+
this.textView.update(val => val.substring(0, this.lengthLimitDisplay()));
|
|
33
|
+
}
|
|
34
|
+
if (!this.textView()) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.process();
|
|
38
|
+
this.timeInterval.set(setInterval(() => {
|
|
39
|
+
this.process();
|
|
40
|
+
}, 250));
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** FUNCTIONS */
|
|
45
|
+
process() {
|
|
46
|
+
if (this.elementRef && this.elementRef.nativeElement[this.methodDisplay()]) {
|
|
47
|
+
clearInterval(this.timeInterval());
|
|
48
|
+
this.truncate();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
truncate() {
|
|
52
|
+
let content = this.textView();
|
|
53
|
+
while ((this.elementRef.nativeElement.scrollHeight - 2) > this.elementRef.nativeElement.offsetHeight) { // them -2 fix loi tren windows https://admin-cv.mobio.vn/issues/48107
|
|
54
|
+
if (!content) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
content = content.substring(0, content.length - 3);
|
|
58
|
+
(this.elementRef.nativeElement)[this.methodDisplay()] = this.ignoreThreeDots() ? content : `${content}...`;
|
|
59
|
+
}
|
|
60
|
+
if (content !== this.textView()) {
|
|
61
|
+
this.outContentSub.emit(this.ignoreThreeDots() ? content : `${content}...`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
ngOnDestroy() {
|
|
65
|
+
clearInterval(this.timeInterval());
|
|
66
|
+
}
|
|
67
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsLineClampDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
68
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.13", type: LibsUiComponentsLineClampDirective, isStandalone: true, selector: "[LibsUiComponentsLineClampDirective]", inputs: { lengthLimitDisplay: { classPropertyName: "lengthLimitDisplay", publicName: "lengthLimitDisplay", isSignal: true, isRequired: true, transformFunction: null }, methodDisplay: { classPropertyName: "methodDisplay", publicName: "methodDisplay", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, ignoreThreeDots: { classPropertyName: "ignoreThreeDots", publicName: "ignoreThreeDots", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outContentSub: "outContentSub" }, ngImport: i0 });
|
|
69
|
+
}
|
|
70
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsLineClampDirective, decorators: [{
|
|
71
|
+
type: Directive,
|
|
72
|
+
args: [{
|
|
73
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
74
|
+
selector: '[LibsUiComponentsLineClampDirective]',
|
|
75
|
+
standalone: true
|
|
76
|
+
}]
|
|
77
|
+
}], ctorParameters: () => [] });
|
|
78
|
+
|
|
79
|
+
class LibsUiComponentsLineClampComponent {
|
|
80
|
+
/** PROPERTY */
|
|
81
|
+
displayLineClamp = signal(false);
|
|
82
|
+
isCollapse = signal(false);
|
|
83
|
+
contentClamp = signal('');
|
|
84
|
+
contentDisplay = signal('');
|
|
85
|
+
/** INPUT */
|
|
86
|
+
content = input.required();
|
|
87
|
+
lengthLimitDisplay = input(200, { transform: val => val || 200 });
|
|
88
|
+
maxHeight = input.required(); // maxHeight = (line-height của text)*(số dòng mong muốn)
|
|
89
|
+
ignoreShowButtonCollapseExpand = input();
|
|
90
|
+
ignoreShowButtonCollapse = input();
|
|
91
|
+
showTooltip = input();
|
|
92
|
+
timeHidePopoverOnMouseout = input(50, { transform: val => val ?? 50 });
|
|
93
|
+
maxWidthTooltip = input(250, { transform: val => val ?? 250 });
|
|
94
|
+
maxHeightTooltip = input(150, { transform: val => val ?? 150 });
|
|
95
|
+
zIndexPopover = input(1001, { transform: val => val ?? 1001 });
|
|
96
|
+
isInnerText = input(); // không cần escapeHTML content khi biến bằng true
|
|
97
|
+
classClassLabelButtonCollapseExpand = input('libs-ui-font-h5r', { transform: val => val ?? 'libs-ui-font-h5r' });
|
|
98
|
+
classClassIncludeButtonCollapseExpand = input('!p-0', { transform: val => val ?? '!p-0' });
|
|
99
|
+
ignoreStopPropagationTooltipEvent = input(false, { transform: val => val ?? false });
|
|
100
|
+
ngClassObject = input({ 'libs-ui-line-clamp-content libs-ui-font-h5r': true }, { transform: val => val || { 'libs-ui-line-clamp-content lib-ui-font-h5r': true } }); // object ngClass
|
|
101
|
+
hasBackgroundGradient = input(false, { transform: val => val ?? false });
|
|
102
|
+
labelButtonViewMore = input();
|
|
103
|
+
labelButtonCollapse = input();
|
|
104
|
+
directionTooltip = input('top', { transform: val => val ?? 'top' });
|
|
105
|
+
useXssFilter = input(true, { transform: val => val ?? true });
|
|
106
|
+
;
|
|
107
|
+
/** OUTPUT */
|
|
108
|
+
outDisplayLineClamp = output();
|
|
109
|
+
outAction = output();
|
|
110
|
+
outClick = output();
|
|
111
|
+
outFunctionControl = output();
|
|
112
|
+
constructor() {
|
|
113
|
+
effect(() => {
|
|
114
|
+
untracked(() => {
|
|
115
|
+
this.contentDisplay.set(this.content());
|
|
116
|
+
this.displayLineClamp.set(false);
|
|
117
|
+
this.isCollapse.set(false);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async ngOnInit() {
|
|
122
|
+
this.outFunctionControl.emit({
|
|
123
|
+
refresh: this.refresh.bind(this)
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/** FUNCTIONS */
|
|
127
|
+
async handlerContentSub(content) {
|
|
128
|
+
if (this.content() !== content) {
|
|
129
|
+
this.displayLineClamp.set(true);
|
|
130
|
+
this.isCollapse.set(true);
|
|
131
|
+
this.contentClamp.set(content);
|
|
132
|
+
this.contentDisplay.set(content);
|
|
133
|
+
this.outDisplayLineClamp.emit(true);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
async viewMore(e) {
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
this.isCollapse.set(false);
|
|
139
|
+
this.contentDisplay.set(this.content());
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
this.outAction.emit('view-more');
|
|
142
|
+
}
|
|
143
|
+
async hiddenMore(e) {
|
|
144
|
+
e.stopPropagation();
|
|
145
|
+
this.isCollapse.set(true);
|
|
146
|
+
this.contentDisplay.set(this.contentClamp());
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
this.outAction.emit('hidden-more');
|
|
149
|
+
}
|
|
150
|
+
async resize() {
|
|
151
|
+
this.refresh();
|
|
152
|
+
}
|
|
153
|
+
async refresh() {
|
|
154
|
+
this.contentDisplay.set(this.content());
|
|
155
|
+
this.displayLineClamp.set(false);
|
|
156
|
+
this.isCollapse.set(false);
|
|
157
|
+
}
|
|
158
|
+
async handlerClick(event) {
|
|
159
|
+
if (typeof event === 'string' && event !== 'click') {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.outClick.emit(event);
|
|
163
|
+
}
|
|
164
|
+
ngOnDestroy() {
|
|
165
|
+
this.displayLineClamp.set(false);
|
|
166
|
+
}
|
|
167
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsLineClampComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
168
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.13", type: LibsUiComponentsLineClampComponent, isStandalone: true, selector: "libs_ui-components-line_clamp", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, lengthLimitDisplay: { classPropertyName: "lengthLimitDisplay", publicName: "lengthLimitDisplay", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: true, transformFunction: null }, ignoreShowButtonCollapseExpand: { classPropertyName: "ignoreShowButtonCollapseExpand", publicName: "ignoreShowButtonCollapseExpand", isSignal: true, isRequired: false, transformFunction: null }, ignoreShowButtonCollapse: { classPropertyName: "ignoreShowButtonCollapse", publicName: "ignoreShowButtonCollapse", isSignal: true, isRequired: false, transformFunction: null }, showTooltip: { classPropertyName: "showTooltip", publicName: "showTooltip", isSignal: true, isRequired: false, transformFunction: null }, timeHidePopoverOnMouseout: { classPropertyName: "timeHidePopoverOnMouseout", publicName: "timeHidePopoverOnMouseout", isSignal: true, isRequired: false, transformFunction: null }, maxWidthTooltip: { classPropertyName: "maxWidthTooltip", publicName: "maxWidthTooltip", isSignal: true, isRequired: false, transformFunction: null }, maxHeightTooltip: { classPropertyName: "maxHeightTooltip", publicName: "maxHeightTooltip", isSignal: true, isRequired: false, transformFunction: null }, zIndexPopover: { classPropertyName: "zIndexPopover", publicName: "zIndexPopover", isSignal: true, isRequired: false, transformFunction: null }, isInnerText: { classPropertyName: "isInnerText", publicName: "isInnerText", isSignal: true, isRequired: false, transformFunction: null }, classClassLabelButtonCollapseExpand: { classPropertyName: "classClassLabelButtonCollapseExpand", publicName: "classClassLabelButtonCollapseExpand", isSignal: true, isRequired: false, transformFunction: null }, classClassIncludeButtonCollapseExpand: { classPropertyName: "classClassIncludeButtonCollapseExpand", publicName: "classClassIncludeButtonCollapseExpand", isSignal: true, isRequired: false, transformFunction: null }, ignoreStopPropagationTooltipEvent: { classPropertyName: "ignoreStopPropagationTooltipEvent", publicName: "ignoreStopPropagationTooltipEvent", isSignal: true, isRequired: false, transformFunction: null }, ngClassObject: { classPropertyName: "ngClassObject", publicName: "ngClassObject", isSignal: true, isRequired: false, transformFunction: null }, hasBackgroundGradient: { classPropertyName: "hasBackgroundGradient", publicName: "hasBackgroundGradient", isSignal: true, isRequired: false, transformFunction: null }, labelButtonViewMore: { classPropertyName: "labelButtonViewMore", publicName: "labelButtonViewMore", isSignal: true, isRequired: false, transformFunction: null }, labelButtonCollapse: { classPropertyName: "labelButtonCollapse", publicName: "labelButtonCollapse", isSignal: true, isRequired: false, transformFunction: null }, directionTooltip: { classPropertyName: "directionTooltip", publicName: "directionTooltip", isSignal: true, isRequired: false, transformFunction: null }, useXssFilter: { classPropertyName: "useXssFilter", publicName: "useXssFilter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { outDisplayLineClamp: "outDisplayLineClamp", outAction: "outAction", outClick: "outClick", outFunctionControl: "outFunctionControl" }, host: { listeners: { "window:resize": "resize($event)" } }, ngImport: i0, template: "@if (!displayLineClamp()) {\n @if (!isInnerText()) {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerHTML\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerHtml]=\"(content() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n } @else {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerText\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerText]=\"content() | translate\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n }\n}\n@else {\n <libs_ui-components-popover class=\"relative\"\n type=\"other\"\n [ignoreShowPopover]=\"!showTooltip()\"\n [ignoreStopPropagationEvent]=\"ignoreStopPropagationTooltipEvent()\"\n [config]=\"{\n timerDestroy:timeHidePopoverOnMouseout(),\n maxWidth:maxWidthTooltip() ,\n maxHeight:maxHeightTooltip(),\n direction:directionTooltip(),\n content: isInnerText() ? (this.content() | LibsUiPipesEscapeHtmlPipe) : this.content(),\n zIndex: zIndexPopover()\n }\"\n (outEvent)=\"handlerClick($event)\">\n @if (isCollapse() && hasBackgroundGradient()) {\n <div class=\"h-[40px] libs-ui-line-clamp-bg-gradient\"></div>\n }\n @if (!isInnerText()) {\n <div [ngClass]=\"ngClassObject()\"\n [innerHtml]=\"(contentDisplay() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\">\n </div>\n } @else {\n <div [ngClass]=\"ngClassObject()\"\n [innerText]=\"contentDisplay() | translate\">\n </div>\n }\n </libs_ui-components-popover>\n\n @if (!ignoreShowButtonCollapseExpand()) {\n @if (isCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonViewMore() || 'i18n_view_more'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"viewMore($event)\" />\n } @else {\n @if (!ignoreShowButtonCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonCollapse() || 'i18n_collapse'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"hiddenMore($event)\" />\n }\n }\n }\n}\n", styles: [".libs-ui-line-clamp-content{font-weight:400;text-align:start}.libs-ui-line-clamp-bg-gradient{opacity:.5;background:linear-gradient(180deg,#fff0,#fffffff2 51.56%,#fff);position:absolute;width:100%;bottom:0}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: LibsUiComponentsLineClampDirective, selector: "[LibsUiComponentsLineClampDirective]", inputs: ["lengthLimitDisplay", "methodDisplay", "content", "ignoreThreeDots"], outputs: ["outContentSub"] }, { kind: "pipe", type: LibsUiPipesSecurityTrustPipe, name: "LibsUiPipesSecurityTrustPipe" }, { kind: "pipe", type: LibsUiPipesEscapeHtmlPipe, name: "LibsUiPipesEscapeHtmlPipe" }, { kind: "component", type: LibsUiComponentsPopoverComponent, selector: "libs_ui-components-popover,[LibsUiComponentsPopoverDirective]", inputs: ["debugId", "flagMouse", "type", "mode", "config", "ignoreShowPopover", "elementRefCustom", "classInclude", "ignoreHiddenPopoverContentWhenMouseLeave", "ignoreStopPropagationEvent", "ignoreCursorPointerModeLikeClick", "isAddContentToParentDocument", "ignoreClickOutside"], outputs: ["outEvent", "outChangStageFlagMouse", "outEventPopoverContent", "outFunctionsControl"] }, { kind: "component", type: LibsUiComponentsButtonsButtonComponent, selector: "libs_ui-components-buttons-button", inputs: ["flagMouse", "type", "buttonCustom", "sizeButton", "label", "disable", "isPending", "imageLeft", "classInclude", "classIconLeft", "classIconRight", "classLabel", "iconOnlyType", "popover", "ignoreStopPropagationEvent", "zIndex", "widthLabelPopover", "styleIconLeft", "styleButton", "ignoreFocusWhenInputTab", "ignoreSetClickWhenShowPopover", "ignorePointerEvent", "isActive"], outputs: ["outClick", "outPopoverEvent", "outFunctionsControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
169
|
+
}
|
|
170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LibsUiComponentsLineClampComponent, decorators: [{
|
|
171
|
+
type: Component,
|
|
172
|
+
args: [{ selector: 'libs_ui-components-line_clamp', standalone: true, imports: [
|
|
173
|
+
NgClass, TranslateModule, AsyncPipe,
|
|
174
|
+
LibsUiComponentsLineClampDirective,
|
|
175
|
+
LibsUiPipesSecurityTrustPipe,
|
|
176
|
+
LibsUiPipesEscapeHtmlPipe,
|
|
177
|
+
LibsUiComponentsPopoverComponent,
|
|
178
|
+
LibsUiComponentsButtonsButtonComponent
|
|
179
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!displayLineClamp()) {\n @if (!isInnerText()) {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerHTML\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerHtml]=\"(content() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n } @else {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerText\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerText]=\"content() | translate\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n }\n}\n@else {\n <libs_ui-components-popover class=\"relative\"\n type=\"other\"\n [ignoreShowPopover]=\"!showTooltip()\"\n [ignoreStopPropagationEvent]=\"ignoreStopPropagationTooltipEvent()\"\n [config]=\"{\n timerDestroy:timeHidePopoverOnMouseout(),\n maxWidth:maxWidthTooltip() ,\n maxHeight:maxHeightTooltip(),\n direction:directionTooltip(),\n content: isInnerText() ? (this.content() | LibsUiPipesEscapeHtmlPipe) : this.content(),\n zIndex: zIndexPopover()\n }\"\n (outEvent)=\"handlerClick($event)\">\n @if (isCollapse() && hasBackgroundGradient()) {\n <div class=\"h-[40px] libs-ui-line-clamp-bg-gradient\"></div>\n }\n @if (!isInnerText()) {\n <div [ngClass]=\"ngClassObject()\"\n [innerHtml]=\"(contentDisplay() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\">\n </div>\n } @else {\n <div [ngClass]=\"ngClassObject()\"\n [innerText]=\"contentDisplay() | translate\">\n </div>\n }\n </libs_ui-components-popover>\n\n @if (!ignoreShowButtonCollapseExpand()) {\n @if (isCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonViewMore() || 'i18n_view_more'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"viewMore($event)\" />\n } @else {\n @if (!ignoreShowButtonCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonCollapse() || 'i18n_collapse'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"hiddenMore($event)\" />\n }\n }\n }\n}\n", styles: [".libs-ui-line-clamp-content{font-weight:400;text-align:start}.libs-ui-line-clamp-bg-gradient{opacity:.5;background:linear-gradient(180deg,#fff0,#fffffff2 51.56%,#fff);position:absolute;width:100%;bottom:0}\n"] }]
|
|
180
|
+
}], ctorParameters: () => [], propDecorators: { resize: [{
|
|
181
|
+
type: HostListener,
|
|
182
|
+
args: ['window:resize', ['$event']]
|
|
183
|
+
}] } });
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Generated bundle index. Do not edit.
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
export { LibsUiComponentsLineClampComponent };
|
|
190
|
+
//# sourceMappingURL=libs-ui-components-line-clamp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"libs-ui-components-line-clamp.mjs","sources":["../../../../../libs-ui/components/line-clamp/src/line-clamp.directive.ts","../../../../../libs-ui/components/line-clamp/src/line-clamp.component.ts","../../../../../libs-ui/components/line-clamp/src/line-clamp.component.html","../../../../../libs-ui/components/line-clamp/src/libs-ui-components-line-clamp.ts"],"sourcesContent":["import { Directive, effect, ElementRef, inject, input, OnDestroy, output, signal, untracked } from '@angular/core';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[LibsUiComponentsLineClampDirective]',\n standalone: true\n})\nexport class LibsUiComponentsLineClampDirective implements OnDestroy {\n\n /** PROPERTY */\n private timeInterval = signal<number | undefined>(undefined);\n private textView = signal<string>('');\n\n /** INPUT */\n readonly lengthLimitDisplay = input.required<number>();\n readonly methodDisplay = input.required<string>();\n readonly content = input.required<string>();\n readonly ignoreThreeDots = input<boolean>();\n\n /** OUTPUT */\n readonly outContentSub = output<string>();\n\n /** INJECT */\n private readonly elementRef = inject(ElementRef);\n\n constructor() {\n effect(() => {\n if (!this.content() || !this.methodDisplay() || !this.lengthLimitDisplay()) {\n return;\n }\n untracked(() => {\n this.textView.set(this.content());\n if (this.textView().length > this.lengthLimitDisplay()) {\n this.textView.update(val => val.substring(0, this.lengthLimitDisplay()));\n }\n\n if (!this.textView()) {\n return;\n }\n this.process();\n this.timeInterval.set(setInterval(() => {\n this.process();\n }, 250));\n })\n });\n }\n\n /** FUNCTIONS */\n\n private process() {\n if (this.elementRef && this.elementRef.nativeElement[this.methodDisplay()]) {\n clearInterval(this.timeInterval());\n this.truncate();\n }\n }\n\n private truncate() {\n let content = this.textView();\n while ((this.elementRef.nativeElement.scrollHeight - 2) > this.elementRef.nativeElement.offsetHeight) { // them -2 fix loi tren windows https://admin-cv.mobio.vn/issues/48107\n if (!content) {\n return;\n }\n content = content.substring(0, content.length - 3);\n (this.elementRef.nativeElement)[this.methodDisplay()] = this.ignoreThreeDots() ? content : `${content}...`;\n }\n if (content !== this.textView()) {\n this.outContentSub.emit(this.ignoreThreeDots() ? content : `${content}...`);\n }\n }\n ngOnDestroy() {\n clearInterval(this.timeInterval());\n }\n}\n","import { AsyncPipe, NgClass } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, HostListener, OnDestroy, OnInit, effect, input, output, signal, untracked } from '@angular/core';\nimport { LibsUiComponentsButtonsButtonComponent } from '@libs-ui/components-buttons-button';\nimport { LibsUiComponentsPopoverComponent, TYPE_POPOVER_DIRECTION, TYPE_POPOVER_EVENT } from '@libs-ui/components-popover';\nimport { LibsUiPipesEscapeHtmlPipe } from '@libs-ui/pipes-escape-html';\nimport { LibsUiPipesSecurityTrustPipe } from '@libs-ui/pipes-security-trust';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { ILineClampFunctionControlEvent } from './interfaces';\nimport { LibsUiComponentsLineClampDirective } from './line-clamp.directive';\nimport { TYPE_OBJECT } from '@libs-ui/interfaces-types';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'libs_ui-components-line_clamp',\n templateUrl: './line-clamp.component.html',\n styleUrls: ['./line-clamp.component.scss'],\n standalone: true,\n imports: [\n NgClass, TranslateModule, AsyncPipe,\n LibsUiComponentsLineClampDirective,\n LibsUiPipesSecurityTrustPipe,\n LibsUiPipesEscapeHtmlPipe,\n LibsUiComponentsPopoverComponent,\n LibsUiComponentsButtonsButtonComponent\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LibsUiComponentsLineClampComponent implements OnInit, OnDestroy {\n /** PROPERTY */\n protected displayLineClamp = signal<boolean>(false);\n protected isCollapse = signal<boolean>(false)\n protected contentClamp = signal<string>('');\n protected contentDisplay = signal<string>('');\n\n /** INPUT */\n readonly content = input.required<string>();\n readonly lengthLimitDisplay = input<number, number | undefined>(200, { transform: val => val || 200 });\n readonly maxHeight = input.required<number>(); // maxHeight = (line-height của text)*(số dòng mong muốn)\n readonly ignoreShowButtonCollapseExpand = input<boolean>();\n readonly ignoreShowButtonCollapse = input<boolean>();\n readonly showTooltip = input<boolean>();\n readonly timeHidePopoverOnMouseout = input<number, number | undefined>(50, { transform: val => val ?? 50 });\n readonly maxWidthTooltip = input<number, number | undefined>(250, { transform: val => val ?? 250 });\n readonly maxHeightTooltip = input<number, number | undefined>(150, { transform: val => val ?? 150 });\n readonly zIndexPopover = input<number, number | undefined>(1001, { transform: val => val ?? 1001 });\n readonly isInnerText = input<boolean>(); // không cần escapeHTML content khi biến bằng true\n readonly classClassLabelButtonCollapseExpand = input<string, string | undefined>('libs-ui-font-h5r', { transform: val => val ?? 'libs-ui-font-h5r' });\n readonly classClassIncludeButtonCollapseExpand = input<string, string | undefined>('!p-0', { transform: val => val ?? '!p-0' });\n readonly ignoreStopPropagationTooltipEvent = input<boolean, boolean | undefined>(false, { transform: val => val ?? false });\n readonly ngClassObject = input<TYPE_OBJECT, TYPE_OBJECT | undefined>({ 'libs-ui-line-clamp-content libs-ui-font-h5r': true }, { transform: val => val || { 'libs-ui-line-clamp-content lib-ui-font-h5r': true } }); // object ngClass\n readonly hasBackgroundGradient = input<boolean, boolean | undefined>(false, { transform: val => val ?? false });\n readonly labelButtonViewMore = input<string>();\n readonly labelButtonCollapse = input<string>();\n readonly directionTooltip = input<TYPE_POPOVER_DIRECTION, TYPE_POPOVER_DIRECTION | undefined>('top', { transform: val => val ?? 'top' });\n readonly useXssFilter = input<boolean, boolean | undefined>(true, { transform: val => val ?? true });;\n\n /** OUTPUT */\n protected readonly outDisplayLineClamp = output<boolean>();\n protected readonly outAction = output<string>();\n protected readonly outClick = output<Event | TYPE_POPOVER_EVENT>();\n protected readonly outFunctionControl = output<ILineClampFunctionControlEvent>();\n\n constructor() {\n effect(() => {\n untracked(() => {\n this.contentDisplay.set(this.content());\n this.displayLineClamp.set(false);\n this.isCollapse.set(false);\n })\n });\n }\n\n async ngOnInit() {\n this.outFunctionControl.emit({\n refresh: this.refresh.bind(this)\n });\n }\n\n /** FUNCTIONS */\n\n protected async handlerContentSub(content: string) {\n if (this.content() !== content) {\n this.displayLineClamp.set(true);\n this.isCollapse.set(true);\n this.contentClamp.set(content);\n this.contentDisplay.set(content);\n this.outDisplayLineClamp.emit(true);\n }\n }\n\n protected async viewMore(e: Event) {\n e.stopPropagation();\n this.isCollapse.set(false);\n this.contentDisplay.set(this.content());\n e.preventDefault();\n this.outAction.emit('view-more');\n }\n\n protected async hiddenMore(e: Event) {\n e.stopPropagation();\n this.isCollapse.set(true);\n this.contentDisplay.set(this.contentClamp());\n e.preventDefault();\n this.outAction.emit('hidden-more');\n }\n\n\n @HostListener('window:resize', ['$event'])\n protected async resize() {\n this.refresh();\n }\n\n protected async refresh() {\n this.contentDisplay.set(this.content());\n this.displayLineClamp.set(false);\n this.isCollapse.set(false);\n }\n\n protected async handlerClick(event: Event | TYPE_POPOVER_EVENT) {\n if (typeof event === 'string' && event !== 'click') {\n return;\n }\n this.outClick.emit(event);\n }\n\n ngOnDestroy() {\n this.displayLineClamp.set(false);\n }\n}\n","@if (!displayLineClamp()) {\n @if (!isInnerText()) {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerHTML\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerHtml]=\"(content() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n } @else {\n <div LibsUiComponentsLineClampDirective\n [lengthLimitDisplay]=\"lengthLimitDisplay()\"\n [ignoreThreeDots]=\"hasBackgroundGradient()\"\n methodDisplay=\"innerText\"\n class=\"overflow-hidden\"\n [content]=\"content()\"\n [ngClass]=\"ngClassObject()\"\n [style.maxHeight.px]=\"maxHeight()\"\n [innerText]=\"content() | translate\"\n (click)=\"handlerClick($event)\"\n (outContentSub)=\"handlerContentSub($event)\">\n </div>\n }\n}\n@else {\n <libs_ui-components-popover class=\"relative\"\n type=\"other\"\n [ignoreShowPopover]=\"!showTooltip()\"\n [ignoreStopPropagationEvent]=\"ignoreStopPropagationTooltipEvent()\"\n [config]=\"{\n timerDestroy:timeHidePopoverOnMouseout(),\n maxWidth:maxWidthTooltip() ,\n maxHeight:maxHeightTooltip(),\n direction:directionTooltip(),\n content: isInnerText() ? (this.content() | LibsUiPipesEscapeHtmlPipe) : this.content(),\n zIndex: zIndexPopover()\n }\"\n (outEvent)=\"handlerClick($event)\">\n @if (isCollapse() && hasBackgroundGradient()) {\n <div class=\"h-[40px] libs-ui-line-clamp-bg-gradient\"></div>\n }\n @if (!isInnerText()) {\n <div [ngClass]=\"ngClassObject()\"\n [innerHtml]=\"(contentDisplay() | translate | LibsUiPipesSecurityTrustPipe: 'html': useXssFilter()) | async\">\n </div>\n } @else {\n <div [ngClass]=\"ngClassObject()\"\n [innerText]=\"contentDisplay() | translate\">\n </div>\n }\n </libs_ui-components-popover>\n\n @if (!ignoreShowButtonCollapseExpand()) {\n @if (isCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonViewMore() || 'i18n_view_more'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"viewMore($event)\" />\n } @else {\n @if (!ignoreShowButtonCollapse()) {\n <libs_ui-components-buttons-button type=\"button-link-primary\"\n [label]=\"labelButtonCollapse() || 'i18n_collapse'\"\n [classInclude]=\"classClassIncludeButtonCollapseExpand()\"\n [classLabel]=\"classClassLabelButtonCollapseExpand()\"\n (outClick)=\"hiddenMore($event)\" />\n }\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;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
|
3
|
+
maxHeight?: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
ignoreShowButtonCollapseExpand?: boolean;
|
|
6
|
+
showTooltip?: boolean;
|
|
7
|
+
maxWidthTooltip?: number;
|
|
8
|
+
maxHeightTooltip?: number;
|
|
9
|
+
ngClassObject?: TYPE_OBJECT;
|
|
10
|
+
isInnerText?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { TYPE_POPOVER_DIRECTION, TYPE_POPOVER_EVENT } from '@libs-ui/components-popover';
|
|
3
|
+
import { ILineClampFunctionControlEvent } from './interfaces';
|
|
4
|
+
import { TYPE_OBJECT } from '@libs-ui/interfaces-types';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class LibsUiComponentsLineClampComponent implements OnInit, OnDestroy {
|
|
7
|
+
/** PROPERTY */
|
|
8
|
+
protected displayLineClamp: import("@angular/core").WritableSignal<boolean>;
|
|
9
|
+
protected isCollapse: import("@angular/core").WritableSignal<boolean>;
|
|
10
|
+
protected contentClamp: import("@angular/core").WritableSignal<string>;
|
|
11
|
+
protected contentDisplay: import("@angular/core").WritableSignal<string>;
|
|
12
|
+
/** INPUT */
|
|
13
|
+
readonly content: import("@angular/core").InputSignal<string>;
|
|
14
|
+
readonly lengthLimitDisplay: import("@angular/core").InputSignalWithTransform<number, number | undefined>;
|
|
15
|
+
readonly maxHeight: import("@angular/core").InputSignal<number>;
|
|
16
|
+
readonly ignoreShowButtonCollapseExpand: import("@angular/core").InputSignal<boolean | undefined>;
|
|
17
|
+
readonly ignoreShowButtonCollapse: import("@angular/core").InputSignal<boolean | undefined>;
|
|
18
|
+
readonly showTooltip: import("@angular/core").InputSignal<boolean | undefined>;
|
|
19
|
+
readonly timeHidePopoverOnMouseout: import("@angular/core").InputSignalWithTransform<number, number | undefined>;
|
|
20
|
+
readonly maxWidthTooltip: import("@angular/core").InputSignalWithTransform<number, number | undefined>;
|
|
21
|
+
readonly maxHeightTooltip: import("@angular/core").InputSignalWithTransform<number, number | undefined>;
|
|
22
|
+
readonly zIndexPopover: import("@angular/core").InputSignalWithTransform<number, number | undefined>;
|
|
23
|
+
readonly isInnerText: import("@angular/core").InputSignal<boolean | undefined>;
|
|
24
|
+
readonly classClassLabelButtonCollapseExpand: import("@angular/core").InputSignalWithTransform<string, string | undefined>;
|
|
25
|
+
readonly classClassIncludeButtonCollapseExpand: import("@angular/core").InputSignalWithTransform<string, string | undefined>;
|
|
26
|
+
readonly ignoreStopPropagationTooltipEvent: import("@angular/core").InputSignalWithTransform<boolean, boolean | undefined>;
|
|
27
|
+
readonly ngClassObject: import("@angular/core").InputSignalWithTransform<TYPE_OBJECT, TYPE_OBJECT | undefined>;
|
|
28
|
+
readonly hasBackgroundGradient: import("@angular/core").InputSignalWithTransform<boolean, boolean | undefined>;
|
|
29
|
+
readonly labelButtonViewMore: import("@angular/core").InputSignal<string | undefined>;
|
|
30
|
+
readonly labelButtonCollapse: import("@angular/core").InputSignal<string | undefined>;
|
|
31
|
+
readonly directionTooltip: import("@angular/core").InputSignalWithTransform<TYPE_POPOVER_DIRECTION, TYPE_POPOVER_DIRECTION | undefined>;
|
|
32
|
+
readonly useXssFilter: import("@angular/core").InputSignalWithTransform<boolean, boolean | undefined>;
|
|
33
|
+
/** OUTPUT */
|
|
34
|
+
protected readonly outDisplayLineClamp: import("@angular/core").OutputEmitterRef<boolean>;
|
|
35
|
+
protected readonly outAction: import("@angular/core").OutputEmitterRef<string>;
|
|
36
|
+
protected readonly outClick: import("@angular/core").OutputEmitterRef<Event | TYPE_POPOVER_EVENT>;
|
|
37
|
+
protected readonly outFunctionControl: import("@angular/core").OutputEmitterRef<ILineClampFunctionControlEvent>;
|
|
38
|
+
constructor();
|
|
39
|
+
ngOnInit(): Promise<void>;
|
|
40
|
+
/** FUNCTIONS */
|
|
41
|
+
protected handlerContentSub(content: string): Promise<void>;
|
|
42
|
+
protected viewMore(e: Event): Promise<void>;
|
|
43
|
+
protected hiddenMore(e: Event): Promise<void>;
|
|
44
|
+
protected resize(): Promise<void>;
|
|
45
|
+
protected refresh(): Promise<void>;
|
|
46
|
+
protected handlerClick(event: Event | TYPE_POPOVER_EVENT): Promise<void>;
|
|
47
|
+
ngOnDestroy(): void;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsLineClampComponent, never>;
|
|
49
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LibsUiComponentsLineClampComponent, "libs_ui-components-line_clamp", never, { "content": { "alias": "content"; "required": true; "isSignal": true; }; "lengthLimitDisplay": { "alias": "lengthLimitDisplay"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": true; "isSignal": true; }; "ignoreShowButtonCollapseExpand": { "alias": "ignoreShowButtonCollapseExpand"; "required": false; "isSignal": true; }; "ignoreShowButtonCollapse": { "alias": "ignoreShowButtonCollapse"; "required": false; "isSignal": true; }; "showTooltip": { "alias": "showTooltip"; "required": false; "isSignal": true; }; "timeHidePopoverOnMouseout": { "alias": "timeHidePopoverOnMouseout"; "required": false; "isSignal": true; }; "maxWidthTooltip": { "alias": "maxWidthTooltip"; "required": false; "isSignal": true; }; "maxHeightTooltip": { "alias": "maxHeightTooltip"; "required": false; "isSignal": true; }; "zIndexPopover": { "alias": "zIndexPopover"; "required": false; "isSignal": true; }; "isInnerText": { "alias": "isInnerText"; "required": false; "isSignal": true; }; "classClassLabelButtonCollapseExpand": { "alias": "classClassLabelButtonCollapseExpand"; "required": false; "isSignal": true; }; "classClassIncludeButtonCollapseExpand": { "alias": "classClassIncludeButtonCollapseExpand"; "required": false; "isSignal": true; }; "ignoreStopPropagationTooltipEvent": { "alias": "ignoreStopPropagationTooltipEvent"; "required": false; "isSignal": true; }; "ngClassObject": { "alias": "ngClassObject"; "required": false; "isSignal": true; }; "hasBackgroundGradient": { "alias": "hasBackgroundGradient"; "required": false; "isSignal": true; }; "labelButtonViewMore": { "alias": "labelButtonViewMore"; "required": false; "isSignal": true; }; "labelButtonCollapse": { "alias": "labelButtonCollapse"; "required": false; "isSignal": true; }; "directionTooltip": { "alias": "directionTooltip"; "required": false; "isSignal": true; }; "useXssFilter": { "alias": "useXssFilter"; "required": false; "isSignal": true; }; }, { "outDisplayLineClamp": "outDisplayLineClamp"; "outAction": "outAction"; "outClick": "outClick"; "outFunctionControl": "outFunctionControl"; }, never, never, true, never>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class LibsUiComponentsLineClampDirective implements OnDestroy {
|
|
4
|
+
/** PROPERTY */
|
|
5
|
+
private timeInterval;
|
|
6
|
+
private textView;
|
|
7
|
+
/** INPUT */
|
|
8
|
+
readonly lengthLimitDisplay: import("@angular/core").InputSignal<number>;
|
|
9
|
+
readonly methodDisplay: import("@angular/core").InputSignal<string>;
|
|
10
|
+
readonly content: import("@angular/core").InputSignal<string>;
|
|
11
|
+
readonly ignoreThreeDots: import("@angular/core").InputSignal<boolean | undefined>;
|
|
12
|
+
/** OUTPUT */
|
|
13
|
+
readonly outContentSub: import("@angular/core").OutputEmitterRef<string>;
|
|
14
|
+
/** INJECT */
|
|
15
|
+
private readonly elementRef;
|
|
16
|
+
constructor();
|
|
17
|
+
/** FUNCTIONS */
|
|
18
|
+
private process;
|
|
19
|
+
private truncate;
|
|
20
|
+
ngOnDestroy(): void;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LibsUiComponentsLineClampDirective, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LibsUiComponentsLineClampDirective, "[LibsUiComponentsLineClampDirective]", never, { "lengthLimitDisplay": { "alias": "lengthLimitDisplay"; "required": true; "isSignal": true; }; "methodDisplay": { "alias": "methodDisplay"; "required": true; "isSignal": true; }; "content": { "alias": "content"; "required": true; "isSignal": true; }; "ignoreThreeDots": { "alias": "ignoreThreeDots"; "required": false; "isSignal": true; }; }, { "outContentSub": "outContentSub"; }, never, never, true, never>;
|
|
23
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@libs-ui/components-line-clamp",
|
|
3
|
+
"version": "0.2.106.2",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^18.2.0",
|
|
6
|
+
"@angular/core": "^18.2.0"
|
|
7
|
+
},
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"module": "fesm2022/libs-ui-components-line-clamp.mjs",
|
|
10
|
+
"typings": "index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
"./package.json": {
|
|
13
|
+
"default": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./index.d.ts",
|
|
17
|
+
"esm2022": "./esm2022/libs-ui-components-line-clamp.mjs",
|
|
18
|
+
"esm": "./esm2022/libs-ui-components-line-clamp.mjs",
|
|
19
|
+
"default": "./fesm2022/libs-ui-components-line-clamp.mjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.3.0"
|
|
24
|
+
}
|
|
25
|
+
}
|