@coolon/angular-ui-powerups 16.1.0-aplpha.121 → 16.1.0-aplpha.123
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/esm2022/lib/animations/slide-animations.mjs +14 -14
- package/esm2022/lib/components/disposable-component.mjs +5 -2
- package/esm2022/lib/components/forms/number-input/number-input.component.mjs +5 -5
- package/esm2022/lib/components/tables/column/column-model.mjs +4 -4
- package/esm2022/lib/components/tables/renderer/cell-portal-ref.mjs +6 -6
- package/esm2022/lib/components/tables/renderer/table-cell/table-cell.component.mjs +6 -6
- package/fesm2022/coolon-angular-ui-powerups.mjs +33 -30
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/disposable-component.d.ts +1 -0
- package/lib/components/forms/number-input/number-input.component.d.ts +1 -1
- package/lib/components/tables/renderer/cell-portal-ref.d.ts +7 -7
- package/lib/components/tables/renderer/table-cell/table-cell.component.d.ts +1 -2
- package/package.json +2 -2
|
@@ -280,7 +280,10 @@ class DisposableComponent extends GarbageCollector {
|
|
|
280
280
|
*/
|
|
281
281
|
viewStateDependsOn(...models) {
|
|
282
282
|
const { when } = Dsl.disposeWith(this);
|
|
283
|
-
when.anyOf(...models).changes(() => this.
|
|
283
|
+
when.anyOf(...models).changes(() => this.markForCheck());
|
|
284
|
+
}
|
|
285
|
+
markForCheck() {
|
|
286
|
+
this.cdr.markForCheck();
|
|
284
287
|
}
|
|
285
288
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: DisposableComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
286
289
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.9", type: DisposableComponent, usesInheritance: true, ngImport: i0 });
|
|
@@ -2254,7 +2257,7 @@ class NumberInputComponent extends AbstractValueInputComponent {
|
|
|
2254
2257
|
super();
|
|
2255
2258
|
const { chain } = Dsl.disposeWith(this);
|
|
2256
2259
|
this.step$ = chain(this.significantDigits$).map(v => 10 ** (-v)).otherwise(1);
|
|
2257
|
-
this.displayValue$ = chain(this.value$).map(v => this.
|
|
2260
|
+
this.displayValue$ = chain(this.value$).map(v => this.clampSignificantDigits(v), {
|
|
2258
2261
|
dependsOn: this.significantDigits$
|
|
2259
2262
|
});
|
|
2260
2263
|
const normalisedValue$ = chain(this.value$).otherwise(0);
|
|
@@ -2266,12 +2269,12 @@ class NumberInputComponent extends AbstractValueInputComponent {
|
|
|
2266
2269
|
}).enableWhile(chain.numericValue(normalisedValue$).isGreaterThan(this.min$).and(this.enabled$));
|
|
2267
2270
|
}
|
|
2268
2271
|
increment(value) {
|
|
2269
|
-
return this.
|
|
2272
|
+
return this.clampSignificantDigits((value ?? 0) + this.step$.value);
|
|
2270
2273
|
}
|
|
2271
2274
|
decrement(value) {
|
|
2272
|
-
return this.
|
|
2275
|
+
return this.clampSignificantDigits((value ?? 0) - this.step$.value);
|
|
2273
2276
|
}
|
|
2274
|
-
|
|
2277
|
+
clampSignificantDigits(value) {
|
|
2275
2278
|
return Number(value.toFixed(this.significantDigits));
|
|
2276
2279
|
}
|
|
2277
2280
|
onValueChange(value) {
|
|
@@ -2836,7 +2839,7 @@ class CellHeaderPortalRef extends CellPortalRef {
|
|
|
2836
2839
|
this.componentType = componentType;
|
|
2837
2840
|
this.initialiseHeader = initialiseHeader;
|
|
2838
2841
|
}
|
|
2839
|
-
initialiseHost(host
|
|
2842
|
+
initialiseHost(host) {
|
|
2840
2843
|
assert$1.isTruthy(host);
|
|
2841
2844
|
host[HEADER_CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);
|
|
2842
2845
|
}
|
|
@@ -2855,7 +2858,7 @@ class ComponentCellRendererPortalRef extends CellRendererPortalRef {
|
|
|
2855
2858
|
this.componentType = componentType;
|
|
2856
2859
|
this.updateComponent = updateComponent;
|
|
2857
2860
|
}
|
|
2858
|
-
initialiseHost(host
|
|
2861
|
+
initialiseHost(host) {
|
|
2859
2862
|
host[CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);
|
|
2860
2863
|
}
|
|
2861
2864
|
// @Trace()
|
|
@@ -2878,7 +2881,7 @@ class CellEditorPortalRef extends CellPortalRef {
|
|
|
2878
2881
|
this.componentType = componentType;
|
|
2879
2882
|
this.initialiseEditorSession = initialiseEditorSession;
|
|
2880
2883
|
}
|
|
2881
|
-
initialiseHost(host
|
|
2884
|
+
initialiseHost(host) {
|
|
2882
2885
|
assert$1.isTruthy(host);
|
|
2883
2886
|
host[CELL_EDITOR_PORTAL] = new ComponentPortal(this.componentType);
|
|
2884
2887
|
}
|
|
@@ -2902,7 +2905,7 @@ class TemplateCellRendererPortalRef extends CellRendererPortalRef {
|
|
|
2902
2905
|
this.fillCell = fillCell;
|
|
2903
2906
|
this.padChild = padChild;
|
|
2904
2907
|
}
|
|
2905
|
-
initialiseHost(host
|
|
2908
|
+
initialiseHost(host) {
|
|
2906
2909
|
assert$1.isTruthy(host);
|
|
2907
2910
|
}
|
|
2908
2911
|
// @Trace()
|
|
@@ -2927,7 +2930,7 @@ class CellFooterPortalRef extends CellPortalRef {
|
|
|
2927
2930
|
this.componentType = componentType;
|
|
2928
2931
|
this.initialiseHeader = initialiseHeader;
|
|
2929
2932
|
}
|
|
2930
|
-
initialiseHost(host
|
|
2933
|
+
initialiseHost(host) {
|
|
2931
2934
|
assert$1.isTruthy(host);
|
|
2932
2935
|
host[HEADER_CELL_RENDERER_PORTAL] = new ComponentPortal(this.componentType);
|
|
2933
2936
|
}
|
|
@@ -3128,12 +3131,12 @@ class ColumnModel extends GarbageCollector {
|
|
|
3128
3131
|
return !!this._cellEditorPortalRef;
|
|
3129
3132
|
}
|
|
3130
3133
|
attachHeaderCell(host) {
|
|
3131
|
-
this._columnHeaderPortalRef.initialiseHost(host
|
|
3134
|
+
this._columnHeaderPortalRef.initialiseHost(host);
|
|
3132
3135
|
}
|
|
3133
3136
|
attachCell(host) {
|
|
3134
|
-
this._cellRendererPortalRef.initialiseHost(host
|
|
3137
|
+
this._cellRendererPortalRef.initialiseHost(host);
|
|
3135
3138
|
if (this.hasEditorPortal()) {
|
|
3136
|
-
this._cellEditorPortalRef.initialiseHost(host
|
|
3139
|
+
this._cellEditorPortalRef.initialiseHost(host);
|
|
3137
3140
|
}
|
|
3138
3141
|
}
|
|
3139
3142
|
onHeaderAttached(host, ref) {
|
|
@@ -4505,15 +4508,15 @@ class TableCellComponent extends DisposableComponent {
|
|
|
4505
4508
|
defaultClassNames = 'aup-cell-renderer';
|
|
4506
4509
|
fillCell = false;
|
|
4507
4510
|
padChild = false;
|
|
4508
|
-
firstEditableColumn;
|
|
4509
4511
|
constructor() {
|
|
4510
4512
|
super();
|
|
4511
4513
|
this.editRowCommand = Command.create(() => {
|
|
4512
4514
|
this.tableModel.startEditSession(this.row);
|
|
4513
4515
|
});
|
|
4514
4516
|
this.onInit(() => {
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
+
// This binding was triggering a memory leak... not sure why.
|
|
4518
|
+
// const { chain} = Dsl.disposeWith(this);
|
|
4519
|
+
// this.firstEditableColumn = chain(this.tableModel.firstEditableColumn$).equals(this.column); // this would break if the column changed.
|
|
4517
4520
|
this.column.attachCell(this);
|
|
4518
4521
|
});
|
|
4519
4522
|
}
|
|
@@ -4525,7 +4528,7 @@ class TableCellComponent extends DisposableComponent {
|
|
|
4525
4528
|
}
|
|
4526
4529
|
initialiseEditor(ref) {
|
|
4527
4530
|
this.column.onEditorAttached(this, ref);
|
|
4528
|
-
if (this.firstEditableColumn.
|
|
4531
|
+
if (this.tableModel.firstEditableColumn$.value === this.column) {
|
|
4529
4532
|
// @see https://github.com/angular/components/issues/12070
|
|
4530
4533
|
setTimeout(() => this.tryAndFocusEditor(ref));
|
|
4531
4534
|
}
|
|
@@ -10903,25 +10906,12 @@ const slideDownOnEnterDef = style({
|
|
|
10903
10906
|
paddingTop: '0',
|
|
10904
10907
|
paddingBottom: '0'
|
|
10905
10908
|
});
|
|
10906
|
-
// TODO: params aren't getting customised in the view. Need to figure out the correct approach.
|
|
10907
|
-
const slideDownOnEnterAnimation = trigger('slideDownOnEnter', [
|
|
10908
|
-
transition(':enter', [slideDownOnEnterDef, animate('{{duration}}')], { params: { duration: '100ms' } }),
|
|
10909
|
-
transition(':leave', [animate('{{duration}}', slideDownOnEnterDef)], { params: { duration: '100ms' } })
|
|
10910
|
-
]);
|
|
10911
|
-
const slideDownWhenOpenAnimation = trigger('slideDownWhenOpen', [
|
|
10912
|
-
transition('closed => open', [slideDownOnEnterDef, animate('{{duration}}')], { params: { duration: '100ms' } }),
|
|
10913
|
-
transition('open => closed', [animate('{{duration}}', slideDownOnEnterDef)], { params: { duration: '100ms' } })
|
|
10914
|
-
]);
|
|
10915
10909
|
const slideLeftOnEnterDef = style({
|
|
10916
10910
|
opacity: 0,
|
|
10917
10911
|
'width': '0',
|
|
10918
10912
|
paddingLeft: '0',
|
|
10919
10913
|
paddingRight: '0'
|
|
10920
10914
|
});
|
|
10921
|
-
const slideRightOnEnterAnimation = trigger('slideRightOnEnter', [
|
|
10922
|
-
transition(':enter', [slideLeftOnEnterDef, animate('{{duration}}')], { params: { duration: '100ms' } }),
|
|
10923
|
-
transition(':leave', [animate('{{duration}}', slideLeftOnEnterDef)], { params: { duration: '100ms' } })
|
|
10924
|
-
]);
|
|
10925
10915
|
const ZERO_WIDTH = {
|
|
10926
10916
|
opacity: 0,
|
|
10927
10917
|
width: '0',
|
|
@@ -10934,6 +10924,19 @@ const ZERO_HEIGHT = {
|
|
|
10934
10924
|
paddingTop: '0',
|
|
10935
10925
|
paddingBottom: '0',
|
|
10936
10926
|
};
|
|
10927
|
+
// TODO: params aren't getting customised in the view. Need to figure out the correct approach.
|
|
10928
|
+
const slideDownOnEnterAnimation = trigger('slideDownOnEnter', [
|
|
10929
|
+
transition(':enter', [slideDownOnEnterDef, animate('{{duration}}')], { params: { duration: '100ms' } }),
|
|
10930
|
+
transition(':leave', [animate('{{duration}}', slideDownOnEnterDef)], { params: { duration: '100ms' } })
|
|
10931
|
+
]);
|
|
10932
|
+
const slideDownWhenOpenAnimation = trigger('slideDownWhenOpen', [
|
|
10933
|
+
transition('closed => open', [slideDownOnEnterDef, animate('{{duration}}')], { params: { duration: '100ms' } }),
|
|
10934
|
+
transition('open => closed', [animate('{{duration}}', slideDownOnEnterDef)], { params: { duration: '100ms' } })
|
|
10935
|
+
]);
|
|
10936
|
+
const slideRightOnEnterAnimation = trigger('slideRightOnEnter', [
|
|
10937
|
+
transition(':enter', [slideLeftOnEnterDef, animate('{{duration}}')], { params: { duration: '100ms' } }),
|
|
10938
|
+
transition(':leave', [animate('{{duration}}', slideLeftOnEnterDef)], { params: { duration: '100ms' } })
|
|
10939
|
+
]);
|
|
10937
10940
|
const slideDownAndRightOnEnterAnimation = trigger('slideDownAndRightOnEnter', [
|
|
10938
10941
|
transition(':enter', [
|
|
10939
10942
|
style({ overflow: "hidden", whiteSpace: "nowrap", ...ZERO_WIDTH, ...ZERO_HEIGHT }),
|