@coolon/angular-ui-powerups 14.42.0 → 14.44.0
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 +4 -1
- package/esm2020/lib/interaction/components/input-activities/input-activity.mjs +16 -10
- package/esm2020/lib/interaction/components/input-activities/select-input-activity.mjs +16 -6
- package/esm2020/lib/interaction/components/input-activities/string-input-activity.mjs +19 -19
- package/fesm2015/coolon-angular-ui-powerups.mjs +52 -32
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +51 -32
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/interaction/components/input-activities/input-activity.d.ts +3 -1
- package/lib/interaction/components/input-activities/select-input-activity.d.ts +3 -1
- package/package.json +2 -2
|
@@ -2177,6 +2177,9 @@ class SelectInputComponent extends AbstractValueInputComponent {
|
|
|
2177
2177
|
const self = this;
|
|
2178
2178
|
const binding = this.registerDisposable(new Binding(this.componentValue$, this.id$, {
|
|
2179
2179
|
toLeft(selectedId, currentValue) {
|
|
2180
|
+
if (isNil(selectedId)) {
|
|
2181
|
+
return undefined;
|
|
2182
|
+
}
|
|
2180
2183
|
const newValue = lookup.get(selectedId); // the list is empty or we're missing form it so don't touch the real value.
|
|
2181
2184
|
return isNil(newValue) ? currentValue : newValue;
|
|
2182
2185
|
},
|
|
@@ -9330,8 +9333,8 @@ class InputActivity extends Activity {
|
|
|
9330
9333
|
super();
|
|
9331
9334
|
this.class = 'aup-input-activity';
|
|
9332
9335
|
const form = new DirtyTrackingForm();
|
|
9333
|
-
this.
|
|
9334
|
-
this.
|
|
9336
|
+
this.value$ = form.valueModel(this.activityData.initialValue);
|
|
9337
|
+
this.value$.validateUsing(this.activityData.validators || []);
|
|
9335
9338
|
// TODO: move to global configuration
|
|
9336
9339
|
this.confirmFace = this.activityData.confirmFace ?? {
|
|
9337
9340
|
icon: () => 'mat:check'
|
|
@@ -9340,19 +9343,19 @@ class InputActivity extends Activity {
|
|
|
9340
9343
|
icon: () => 'mat:clear'
|
|
9341
9344
|
};
|
|
9342
9345
|
this.confirmCommand = Command.create(async () => {
|
|
9343
|
-
if (this.
|
|
9346
|
+
if (this.value$.validate()) {
|
|
9344
9347
|
if (this.activityData.save) {
|
|
9345
9348
|
const self = this;
|
|
9346
9349
|
try {
|
|
9347
9350
|
let allGood = true;
|
|
9348
|
-
const result = await this.activityData.save(this.
|
|
9351
|
+
const result = await this.activityData.save(this.value$.value, {
|
|
9349
9352
|
injectError(error) {
|
|
9350
9353
|
allGood = false;
|
|
9351
|
-
self.
|
|
9354
|
+
self.value$.injectErrors([error]);
|
|
9352
9355
|
}
|
|
9353
9356
|
});
|
|
9354
9357
|
if (allGood) {
|
|
9355
|
-
this.done(this.
|
|
9358
|
+
this.done(this.value$.value);
|
|
9356
9359
|
}
|
|
9357
9360
|
}
|
|
9358
9361
|
catch (e) {
|
|
@@ -9360,7 +9363,7 @@ class InputActivity extends Activity {
|
|
|
9360
9363
|
}
|
|
9361
9364
|
}
|
|
9362
9365
|
else {
|
|
9363
|
-
this.done(this.
|
|
9366
|
+
this.done(this.value$.value);
|
|
9364
9367
|
}
|
|
9365
9368
|
}
|
|
9366
9369
|
});
|
|
@@ -9368,7 +9371,7 @@ class InputActivity extends Activity {
|
|
|
9368
9371
|
this.cancel();
|
|
9369
9372
|
});
|
|
9370
9373
|
this.busyWhile(this.confirmCommand.busy$);
|
|
9371
|
-
this.onActivityReady(() => this.
|
|
9374
|
+
this.onActivityReady(() => this.value$.focusContext.requestFocus());
|
|
9372
9375
|
}
|
|
9373
9376
|
get layout() {
|
|
9374
9377
|
return this.activityData?.layout ?? InputActivity.Layout.BLOCK;
|
|
@@ -9376,6 +9379,9 @@ class InputActivity extends Activity {
|
|
|
9376
9379
|
get additionalCssClassName() {
|
|
9377
9380
|
return this.activityData.cssClassName ?? '';
|
|
9378
9381
|
}
|
|
9382
|
+
get dataCyAttribute() {
|
|
9383
|
+
return this.activityData.dataCy ?? '';
|
|
9384
|
+
}
|
|
9379
9385
|
onEscape() {
|
|
9380
9386
|
if (this.shouldCancelOnEscape() && this.cancelCommand.enabled$.value) {
|
|
9381
9387
|
this.cancelCommand.execute();
|
|
@@ -9387,7 +9393,7 @@ class InputActivity extends Activity {
|
|
|
9387
9393
|
}
|
|
9388
9394
|
}
|
|
9389
9395
|
InputActivity.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: InputActivity, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
9390
|
-
InputActivity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: InputActivity, selector: "ng-component", inputs: { layout: "layout" }, host: { listeners: { "keydown.escape": "onEscape()" }, properties: { "class": "this.additionalCssClassName", "attr.layout": "this.layout" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
9396
|
+
InputActivity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: InputActivity, selector: "ng-component", inputs: { layout: "layout" }, host: { listeners: { "keydown.escape": "onEscape()" }, properties: { "class": "this.additionalCssClassName", "attr.layout": "this.layout", "attr.data-cy": "this.dataCyAttribute" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
9391
9397
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: InputActivity, decorators: [{
|
|
9392
9398
|
type: Component,
|
|
9393
9399
|
args: [{ template: `` }]
|
|
@@ -9402,6 +9408,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9402
9408
|
}], additionalCssClassName: [{
|
|
9403
9409
|
type: HostBinding,
|
|
9404
9410
|
args: ["class"]
|
|
9411
|
+
}], dataCyAttribute: [{
|
|
9412
|
+
type: HostBinding,
|
|
9413
|
+
args: ["attr.data-cy"]
|
|
9405
9414
|
}], onEscape: [{
|
|
9406
9415
|
type: HostListener,
|
|
9407
9416
|
args: ['keydown.escape']
|
|
@@ -9417,30 +9426,30 @@ class StringInputActivity extends InputActivity {
|
|
|
9417
9426
|
}
|
|
9418
9427
|
StringInputActivity.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: StringInputActivity, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9419
9428
|
StringInputActivity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: StringInputActivity, selector: "aup-string-input-activity", usesInheritance: true, ngImport: i0, template: `
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
+
<aup-string-input [value$]="value$"
|
|
9430
|
+
[label]="activityData.label"
|
|
9431
|
+
[placeholder]="activityData.placeholder"
|
|
9432
|
+
[command.enter]="confirmCommand"
|
|
9433
|
+
[command.escape]="cancelCommand"></aup-string-input>
|
|
9434
|
+
<aup-activity-actions [layout]="layout" align="end"
|
|
9435
|
+
[confirmFace]="confirmFace"
|
|
9436
|
+
[cancelFace]="cancelFace"
|
|
9437
|
+
></aup-activity-actions>
|
|
9429
9438
|
`, isInline: true, dependencies: [{ kind: "component", type: StringInputComponent, selector: "aup-string-input", inputs: ["autocomplete", "enableClear$", "enableClear", "iconPrefix"] }, { kind: "component", type: ActivityActionsComponent, selector: "aup-activity-actions", inputs: ["confirmCommand", "cancelCommand", "faces", "confirmFace", "cancelFace", "style", "layout", "align"] }] });
|
|
9430
9439
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: StringInputActivity, decorators: [{
|
|
9431
9440
|
type: Component,
|
|
9432
9441
|
args: [{
|
|
9433
9442
|
selector: 'aup-string-input-activity',
|
|
9434
9443
|
template: `
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
+
<aup-string-input [value$]="value$"
|
|
9445
|
+
[label]="activityData.label"
|
|
9446
|
+
[placeholder]="activityData.placeholder"
|
|
9447
|
+
[command.enter]="confirmCommand"
|
|
9448
|
+
[command.escape]="cancelCommand"></aup-string-input>
|
|
9449
|
+
<aup-activity-actions [layout]="layout" align="end"
|
|
9450
|
+
[confirmFace]="confirmFace"
|
|
9451
|
+
[cancelFace]="cancelFace"
|
|
9452
|
+
></aup-activity-actions>
|
|
9444
9453
|
`
|
|
9445
9454
|
}]
|
|
9446
9455
|
}] });
|
|
@@ -9449,7 +9458,11 @@ class SelectInputActivity extends InputActivity {
|
|
|
9449
9458
|
constructor() {
|
|
9450
9459
|
super(...arguments);
|
|
9451
9460
|
this.defaultOptionLabelFormat = (option) => {
|
|
9452
|
-
return
|
|
9461
|
+
return option ?
|
|
9462
|
+
this.activityData.optionLabel ?
|
|
9463
|
+
option[this.activityData.optionLabel]
|
|
9464
|
+
: option
|
|
9465
|
+
: "";
|
|
9453
9466
|
};
|
|
9454
9467
|
}
|
|
9455
9468
|
get optionLabelFormat() {
|
|
@@ -9461,14 +9474,17 @@ class SelectInputActivity extends InputActivity {
|
|
|
9461
9474
|
}
|
|
9462
9475
|
SelectInputActivity.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: SelectInputActivity, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
9463
9476
|
SelectInputActivity.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: SelectInputActivity, selector: "aup-select-input-activity", usesInheritance: true, ngImport: i0, template: `
|
|
9464
|
-
<aup-select-input [value$]="
|
|
9477
|
+
<aup-select-input [value$]="value$"
|
|
9465
9478
|
[label]="activityData.label"
|
|
9466
9479
|
[placeholder]="activityData.placeholder"
|
|
9467
9480
|
[command.enter]="confirmCommand"
|
|
9468
9481
|
[command.escape]="cancelCommand"
|
|
9469
9482
|
[options]="options"
|
|
9470
9483
|
[optionLabelFormat]="optionLabelFormat"
|
|
9471
|
-
|
|
9484
|
+
[allowNil]="activityData.allowNil"
|
|
9485
|
+
>
|
|
9486
|
+
<ng-template #nilOptionTemplate>{{activityData.nilLabel}}</ng-template>
|
|
9487
|
+
</aup-select-input>
|
|
9472
9488
|
<aup-activity-actions [layout]="layout" align="end"
|
|
9473
9489
|
[confirmFace]="confirmFace"
|
|
9474
9490
|
[cancelFace]="cancelFace"
|
|
@@ -9479,14 +9495,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
9479
9495
|
args: [{
|
|
9480
9496
|
selector: 'aup-select-input-activity',
|
|
9481
9497
|
template: `
|
|
9482
|
-
<aup-select-input [value$]="
|
|
9498
|
+
<aup-select-input [value$]="value$"
|
|
9483
9499
|
[label]="activityData.label"
|
|
9484
9500
|
[placeholder]="activityData.placeholder"
|
|
9485
9501
|
[command.enter]="confirmCommand"
|
|
9486
9502
|
[command.escape]="cancelCommand"
|
|
9487
9503
|
[options]="options"
|
|
9488
9504
|
[optionLabelFormat]="optionLabelFormat"
|
|
9489
|
-
|
|
9505
|
+
[allowNil]="activityData.allowNil"
|
|
9506
|
+
>
|
|
9507
|
+
<ng-template #nilOptionTemplate>{{activityData.nilLabel}}</ng-template>
|
|
9508
|
+
</aup-select-input>
|
|
9490
9509
|
<aup-activity-actions [layout]="layout" align="end"
|
|
9491
9510
|
[confirmFace]="confirmFace"
|
|
9492
9511
|
[cancelFace]="cancelFace"
|