@pepperi-addons/ngx-lib 0.4.2-beta.316 → 0.4.2-beta.318
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/core/common/directives/auto-width.directive.d.ts +2 -0
- package/esm2020/core/common/directives/auto-width.directive.mjs +17 -9
- package/esm2020/list/list-pager.component.mjs +4 -6
- package/esm2020/list/list.model.mjs +1 -1
- package/fesm2015/pepperi-addons-ngx-lib-list.mjs +3 -5
- package/fesm2015/pepperi-addons-ngx-lib-list.mjs.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib.mjs +17 -8
- package/fesm2015/pepperi-addons-ngx-lib.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-lib-list.mjs +3 -5
- package/fesm2020/pepperi-addons-ngx-lib-list.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-lib.mjs +16 -8
- package/fesm2020/pepperi-addons-ngx-lib.mjs.map +1 -1
- package/list/list-pager.component.d.ts +2 -3
- package/package.json +1 -1
|
@@ -906,24 +906,33 @@ class PepInputAutoWidthDirective {
|
|
|
906
906
|
this.el = el;
|
|
907
907
|
this.includePadding = true;
|
|
908
908
|
this.input = null;
|
|
909
|
+
this.onBlurHandler = () => this.setWidthUsingText();
|
|
910
|
+
this.onKeyupHandler = () => this.setWidthUsingText();
|
|
909
911
|
}
|
|
910
912
|
ngAfterViewInit() {
|
|
911
|
-
|
|
912
|
-
|
|
913
|
+
var _a, _b, _c;
|
|
914
|
+
if (((_b = (_a = this.el.nativeElement) === null || _a === void 0 ? void 0 : _a.tagName) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'input') {
|
|
915
|
+
this.input = this.el.nativeElement;
|
|
913
916
|
}
|
|
914
917
|
else {
|
|
915
|
-
const list = this.el.nativeElement.querySelectorAll
|
|
916
|
-
|
|
918
|
+
const list = ((_c = this.el.nativeElement) === null || _c === void 0 ? void 0 : _c.querySelectorAll)
|
|
919
|
+
? this.el.nativeElement.querySelectorAll('input')
|
|
920
|
+
: null;
|
|
921
|
+
this.input = list && list.length > 0 ? list[0] : null;
|
|
917
922
|
}
|
|
918
923
|
if (this.input) {
|
|
919
|
-
this.input.addEventListener('blur', this.
|
|
920
|
-
this.input.addEventListener('keyup', this.
|
|
924
|
+
this.input.addEventListener('blur', this.onBlurHandler);
|
|
925
|
+
this.input.addEventListener('keyup', this.onKeyupHandler);
|
|
921
926
|
}
|
|
922
927
|
this.setWidthUsingText();
|
|
923
928
|
}
|
|
924
929
|
ngOnDestroy() {
|
|
925
|
-
this.input
|
|
926
|
-
|
|
930
|
+
if (!this.input) {
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
this.input.removeEventListener('blur', this.onBlurHandler);
|
|
934
|
+
this.input.removeEventListener('keyup', this.onKeyupHandler);
|
|
935
|
+
this.input = null;
|
|
927
936
|
}
|
|
928
937
|
get paddingWidth() {
|
|
929
938
|
return this.includePadding
|