@coolon/angular-ui-powerups 14.39.0 → 14.39.1
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/esm2020/lib/components/forms/select-input/select-input.component.mjs +14 -13
- package/esm2020/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.mjs +4 -11
- package/fesm2015/coolon-angular-ui-powerups.mjs +16 -21
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +16 -21
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/forms/select-input/select-input.component.d.ts +1 -0
- package/package.json +3 -3
|
@@ -39,7 +39,7 @@ import { MatTableModule } from '@angular/material/table';
|
|
|
39
39
|
import * as i4 from '@angular/material/tooltip';
|
|
40
40
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
41
41
|
import * as i1$3 from '@coolon/pectin';
|
|
42
|
-
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, PageController, PagedListModel, ComputedListModel, Deferred
|
|
42
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, PageController, PagedListModel, ComputedListModel, Deferred } from '@coolon/pectin';
|
|
43
43
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
44
44
|
import * as i1 from '@angular/platform-browser';
|
|
45
45
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
@@ -2156,23 +2156,24 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
2156
2156
|
this._options$ = new DelegatingListModel();
|
|
2157
2157
|
this.optionLabelFormat = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;
|
|
2158
2158
|
this.id$ = new MutableValueModel();
|
|
2159
|
-
this.
|
|
2159
|
+
this.delegatedIdentityOf = (item) => this.options$.identityOf(item);
|
|
2160
|
+
this.trackByIdentity = (index, item) => this.delegatedIdentityOf(item) ?? index;
|
|
2160
2161
|
const { chain } = Dsl.disposeWith(this);
|
|
2161
|
-
this.cookedOptions$ = chain(this.options$).reduceToList(options => {
|
|
2162
|
-
return options.length < 1 && !isNil(this.componentValue$.value) ? [this.componentValue$.value] : options;
|
|
2163
|
-
}, { dependsOn: this.componentValue$ })
|
|
2164
|
-
.identifiedWith(this.options$.identityOf);
|
|
2165
2162
|
this.cookedOptions$ = chain(this.options$)
|
|
2166
|
-
.
|
|
2167
|
-
.
|
|
2163
|
+
.reduceToList(options => {
|
|
2164
|
+
return options.length < 1 && !isNil(this.componentValue$.value) ? [this.componentValue$.value] : options;
|
|
2165
|
+
}, {
|
|
2166
|
+
dependsOn: this.componentValue$
|
|
2167
|
+
})
|
|
2168
|
+
.identifiedWith(this.delegatedIdentityOf);
|
|
2168
2169
|
}
|
|
2169
2170
|
select(item) {
|
|
2170
|
-
this.id$.value = this.
|
|
2171
|
+
this.id$.value = this.delegatedIdentityOf(item);
|
|
2171
2172
|
}
|
|
2172
2173
|
ngOnInit() {
|
|
2173
2174
|
// NOTE: this has to be done after our parameter have been bound or we'll clobber the initial selected values with the writeRight
|
|
2174
2175
|
const { chain, before, when } = Dsl.disposeWith(this);
|
|
2175
|
-
const lookup = chain(this.options$).indexUsing(this.
|
|
2176
|
+
const lookup = chain(this.options$).indexUsing(this.delegatedIdentityOf);
|
|
2176
2177
|
const self = this;
|
|
2177
2178
|
const binding = this.registerDisposable(new Binding(this.componentValue$, this.id$, {
|
|
2178
2179
|
toLeft(selectedId, currentValue) {
|
|
@@ -2181,7 +2182,7 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
2181
2182
|
},
|
|
2182
2183
|
leftDependsOn: lookup,
|
|
2183
2184
|
toRight(selectedValue, selectedId) {
|
|
2184
|
-
return self.
|
|
2185
|
+
return self.delegatedIdentityOf(selectedValue);
|
|
2185
2186
|
}
|
|
2186
2187
|
})).writeRight();
|
|
2187
2188
|
// TODO: we have to do this as the options identity function can change from identity to somethign else after
|
|
@@ -2191,7 +2192,7 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
2191
2192
|
// the function change things under the hood.
|
|
2192
2193
|
const snapshotValueAndId = (value) => ({
|
|
2193
2194
|
value: value,
|
|
2194
|
-
id: this.
|
|
2195
|
+
id: this.delegatedIdentityOf(value)
|
|
2195
2196
|
});
|
|
2196
2197
|
let lastIdSnapshot = snapshotValueAndId(this.componentValue$.value);
|
|
2197
2198
|
console.log(lastIdSnapshot);
|
|
@@ -2203,7 +2204,7 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
2203
2204
|
const newIdSnapshot = snapshotValueAndId(lastIdSnapshot.value);
|
|
2204
2205
|
console.log(lastIdSnapshot, newIdSnapshot);
|
|
2205
2206
|
if (newIdSnapshot !== lastIdSnapshot.id) {
|
|
2206
|
-
this.id$.value = this.
|
|
2207
|
+
this.id$.value = this.delegatedIdentityOf(this.componentValue$.value);
|
|
2207
2208
|
}
|
|
2208
2209
|
});
|
|
2209
2210
|
}
|
|
@@ -8803,6 +8804,7 @@ class InPlaceInteractionContextComponent extends DisposableComponent {
|
|
|
8803
8804
|
}
|
|
8804
8805
|
}
|
|
8805
8806
|
// this is a regsitration callback from the interaction service
|
|
8807
|
+
// @Trace() // webstorm says no usages... but I'm not sure.
|
|
8806
8808
|
onInplaceInteractionContextRegistered(id, api) {
|
|
8807
8809
|
this.activityContainerComponent.initialise(id, api);
|
|
8808
8810
|
}
|
|
@@ -8844,13 +8846,6 @@ class InPlaceInteractionContextComponent extends DisposableComponent {
|
|
|
8844
8846
|
}
|
|
8845
8847
|
InPlaceInteractionContextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: InPlaceInteractionContextComponent, deps: [{ token: InteractionService }, { token: MAT_TABS_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
8846
8848
|
InPlaceInteractionContextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: InPlaceInteractionContextComponent, selector: "aup-in-place-interaction-context", inputs: { animateFirstActivity: "animateFirstActivity", syncWithRoutes: "syncWithRoutes" }, host: { properties: { "class.active": "this.active" } }, viewQueries: [{ propertyName: "activityContainerComponent", first: true, predicate: ["activityContainer"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<mat-tab-group no-tab-header [selectedIndex]=\"isActive() ? 1 : 0\" full-height-tabs\n (selectedTabChange)=\"onTabChanged($event)\"\n [dynamicHeight]=\"false\"\n [animationDuration]=\"animationDuration\">\n <mat-tab>\n <ng-content></ng-content>\n </mat-tab>\n <mat-tab>\n <aup-activity-container #activityContainer [dynamicHeight]=\"false\"></aup-activity-container>\n </mat-tab>\n</mat-tab-group>\n\n", styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}aup-activity-container{flex:1}\n"], dependencies: [{ kind: "component", type: i2$6.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { kind: "component", type: i2$6.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: ActivityContainerComponent, selector: "aup-activity-container", inputs: ["dynamicHeight"] }] });
|
|
8847
|
-
__decorate([
|
|
8848
|
-
Trace() // webstorm says no usages... but I'm not sure.
|
|
8849
|
-
,
|
|
8850
|
-
__metadata("design:type", Function),
|
|
8851
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
8852
|
-
__metadata("design:returntype", void 0)
|
|
8853
|
-
], InPlaceInteractionContextComponent.prototype, "onInplaceInteractionContextRegistered", null);
|
|
8854
8849
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: InPlaceInteractionContextComponent, decorators: [{
|
|
8855
8850
|
type: Component,
|
|
8856
8851
|
args: [{ selector: "aup-in-place-interaction-context", template: "<mat-tab-group no-tab-header [selectedIndex]=\"isActive() ? 1 : 0\" full-height-tabs\n (selectedTabChange)=\"onTabChanged($event)\"\n [dynamicHeight]=\"false\"\n [animationDuration]=\"animationDuration\">\n <mat-tab>\n <ng-content></ng-content>\n </mat-tab>\n <mat-tab>\n <aup-activity-container #activityContainer [dynamicHeight]=\"false\"></aup-activity-container>\n </mat-tab>\n</mat-tab-group>\n\n", styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}aup-activity-container{flex:1}\n"] }]
|
|
@@ -8869,7 +8864,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
8869
8864
|
}], active: [{
|
|
8870
8865
|
type: HostBinding,
|
|
8871
8866
|
args: ["class.active"]
|
|
8872
|
-
}]
|
|
8867
|
+
}] } });
|
|
8873
8868
|
|
|
8874
8869
|
/**
|
|
8875
8870
|
*
|