@pepperi-addons/ngx-lib 0.4.2-beta.318 → 0.4.2-beta.319
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 +4 -2
- package/esm2020/core/common/directives/auto-width.directive.mjs +13 -1
- package/esm2020/list/list-pager.component.mjs +3 -3
- package/fesm2015/pepperi-addons-ngx-lib-list.mjs +2 -2
- package/fesm2015/pepperi-addons-ngx-lib-list.mjs.map +1 -1
- package/fesm2015/pepperi-addons-ngx-lib.mjs +12 -0
- package/fesm2015/pepperi-addons-ngx-lib.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-lib-list.mjs +2 -2
- package/fesm2020/pepperi-addons-ngx-lib-list.mjs.map +1 -1
- package/fesm2020/pepperi-addons-ngx-lib.mjs +12 -0
- package/fesm2020/pepperi-addons-ngx-lib.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -906,6 +906,7 @@ class PepInputAutoWidthDirective {
|
|
|
906
906
|
this.el = el;
|
|
907
907
|
this.includePadding = true;
|
|
908
908
|
this.input = null;
|
|
909
|
+
this.lastValue = null;
|
|
909
910
|
this.onBlurHandler = () => this.setWidthUsingText();
|
|
910
911
|
this.onKeyupHandler = () => this.setWidthUsingText();
|
|
911
912
|
}
|
|
@@ -926,6 +927,16 @@ class PepInputAutoWidthDirective {
|
|
|
926
927
|
}
|
|
927
928
|
this.setWidthUsingText();
|
|
928
929
|
}
|
|
930
|
+
ngDoCheck() {
|
|
931
|
+
if (!this.input) {
|
|
932
|
+
return;
|
|
933
|
+
}
|
|
934
|
+
// Keep the width in sync when value is updated programmatically (Angular bindings),
|
|
935
|
+
// not only on user key events.
|
|
936
|
+
if (this.input.value !== this.lastValue) {
|
|
937
|
+
this.setWidthUsingText();
|
|
938
|
+
}
|
|
939
|
+
}
|
|
929
940
|
ngOnDestroy() {
|
|
930
941
|
if (!this.input) {
|
|
931
942
|
return;
|
|
@@ -949,6 +960,7 @@ class PepInputAutoWidthDirective {
|
|
|
949
960
|
if (this.input) {
|
|
950
961
|
const text = this.input.value;
|
|
951
962
|
this.setWidth(this.textWidth(text) + this.paddingWidth);
|
|
963
|
+
this.lastValue = text;
|
|
952
964
|
}
|
|
953
965
|
}
|
|
954
966
|
_sumPropertyValues(properties) {
|