@coolon/angular-ui-powerups 0.0.9 → 0.0.11
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/bundles/coolon-angular-ui-powerups.umd.js +54 -22
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/animations/slideDownAndUpAnimation.js +2 -1
- package/esm2015/lib/components/forms/abstract-input.component.js +16 -11
- package/esm2015/lib/directives/focus-binding.directive.js +6 -6
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +3 -1
- package/esm2015/lib/place/components/busy-overlay/busy-overlay.component.js +4 -4
- package/esm2015/lib/place/route/parameter-decorators.js +24 -3
- package/esm5/lib/animations/slideDownAndUpAnimation.js +2 -1
- package/esm5/lib/components/forms/abstract-input.component.js +20 -11
- package/esm5/lib/directives/focus-binding.directive.js +6 -6
- package/esm5/lib/interaction/services/dialog-interaction.service.js +3 -1
- package/esm5/lib/place/components/busy-overlay/busy-overlay.component.js +4 -4
- package/esm5/lib/place/route/parameter-decorators.js +24 -3
- package/fesm2015/coolon-angular-ui-powerups.js +48 -20
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +52 -20
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-input.component.d.ts +3 -2
- package/package.json +2 -2
|
@@ -5,9 +5,10 @@ import { MatDialog, MatButtonModule, MatDialogModule, MatTabsModule, MatProgress
|
|
|
5
5
|
import { BrowserModule } from '@angular/platform-browser';
|
|
6
6
|
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
7
|
import { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __values } from 'tslib';
|
|
8
|
-
import { GarbageCollector,
|
|
8
|
+
import { GarbageCollector, DelegatingFormValueModel, UseDelegate, ValueModel, assert, UnaryCommand, lang, Dsl, Logger, ListModel, StoreInListModel, EventListenerList, DelegatingValueModel, MutableListModel, StoreInValueModel, Trace, OptionsHelper, ValueHolder, MutableValueModel, TransactionObserver, Binding } from '@coolon/pectin';
|
|
9
9
|
import { PortalModule } from '@angular/cdk/portal';
|
|
10
10
|
import { Deferred } from '@coolon/pectin/lib/promise/deferred.class';
|
|
11
|
+
import { assert as assert$1, Klass, Opts } from '@coolon/typescript-utilities';
|
|
11
12
|
import { MatDialog as MatDialog$1 } from '@angular/material/dialog';
|
|
12
13
|
import { MatListModule } from '@angular/material/list';
|
|
13
14
|
import { MatTabsModule as MatTabsModule$1 } from '@angular/material/tabs';
|
|
@@ -18,7 +19,6 @@ import ResizeObserver from 'resize-observer-polyfill';
|
|
|
18
19
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator';
|
|
19
20
|
import { isNil } from 'lodash';
|
|
20
21
|
import 'reflect-metadata';
|
|
21
|
-
import { Klass, Opts } from '@coolon/typescript-utilities';
|
|
22
22
|
import { Memoize as Memoize$1 } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -46,8 +46,6 @@ var DisposableComponent = /** @class */ (function (_super) {
|
|
|
46
46
|
* @fileoverview added by tsickle
|
|
47
47
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
48
48
|
*/
|
|
49
|
-
/** @type {?} */
|
|
50
|
-
var EMPTY_ERRORS = new MutableListModel().readonly;
|
|
51
49
|
/**
|
|
52
50
|
* @abstract
|
|
53
51
|
* @template T
|
|
@@ -56,6 +54,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
56
54
|
__extends(AbstractInputComponent, _super);
|
|
57
55
|
function AbstractInputComponent() {
|
|
58
56
|
var _this = _super.call(this) || this;
|
|
57
|
+
_this.valueModel = new DelegatingFormValueModel();
|
|
59
58
|
// TODO: fix this.
|
|
60
59
|
// tslint:disable-next-line:no-output-native
|
|
61
60
|
_this.focus = new EventEmitter();
|
|
@@ -79,6 +78,17 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
79
78
|
};
|
|
80
79
|
return _this;
|
|
81
80
|
}
|
|
81
|
+
Object.defineProperty(AbstractInputComponent.prototype, "userValueModel", {
|
|
82
|
+
set: /**
|
|
83
|
+
* @param {?} model
|
|
84
|
+
* @return {?}
|
|
85
|
+
*/
|
|
86
|
+
function (model) {
|
|
87
|
+
this.valueModel.setDelegate(model);
|
|
88
|
+
},
|
|
89
|
+
enumerable: true,
|
|
90
|
+
configurable: true
|
|
91
|
+
});
|
|
82
92
|
/**
|
|
83
93
|
* @return {?}
|
|
84
94
|
*/
|
|
@@ -150,7 +160,6 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
150
160
|
* @return {?}
|
|
151
161
|
*/
|
|
152
162
|
function () {
|
|
153
|
-
// this._focused = this.valueModel['focused'] || new ValueHolder();
|
|
154
163
|
};
|
|
155
164
|
/**
|
|
156
165
|
* @return {?}
|
|
@@ -166,8 +175,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
166
175
|
* @return {?}
|
|
167
176
|
*/
|
|
168
177
|
function () {
|
|
169
|
-
|
|
170
|
-
return ((/** @type {?} */ (this.valueModel))).enabled || Constant.TRUE;
|
|
178
|
+
return this.valueModel.enabled;
|
|
171
179
|
},
|
|
172
180
|
enumerable: true,
|
|
173
181
|
configurable: true
|
|
@@ -186,7 +194,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
186
194
|
* @return {?}
|
|
187
195
|
*/
|
|
188
196
|
function () {
|
|
189
|
-
return
|
|
197
|
+
return this.valueModel.errorList;
|
|
190
198
|
},
|
|
191
199
|
enumerable: true,
|
|
192
200
|
configurable: true
|
|
@@ -202,7 +210,7 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
202
210
|
configurable: true
|
|
203
211
|
});
|
|
204
212
|
AbstractInputComponent.propDecorators = {
|
|
205
|
-
|
|
213
|
+
userValueModel: [{ type: Input, args: ['valueModel',] }],
|
|
206
214
|
label: [{ type: Input }],
|
|
207
215
|
floatLabel: [{ type: Input }],
|
|
208
216
|
hint: [{ type: Input }],
|
|
@@ -222,8 +230,9 @@ var AbstractInputComponent = /** @class */ (function (_super) {
|
|
|
222
230
|
};
|
|
223
231
|
__decorate([
|
|
224
232
|
UseDelegate(),
|
|
225
|
-
__metadata("design:type",
|
|
226
|
-
|
|
233
|
+
__metadata("design:type", ValueModel),
|
|
234
|
+
__metadata("design:paramtypes", [ValueModel])
|
|
235
|
+
], AbstractInputComponent.prototype, "userValueModel", null);
|
|
227
236
|
return AbstractInputComponent;
|
|
228
237
|
}(DisposableComponent));
|
|
229
238
|
if (false) {
|
|
@@ -461,7 +470,7 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
461
470
|
*/
|
|
462
471
|
function () {
|
|
463
472
|
if (this.hasBinding()) {
|
|
464
|
-
this.pectinFocusBinding.
|
|
473
|
+
this.pectinFocusBinding.focusContext.notifyFocusIn();
|
|
465
474
|
}
|
|
466
475
|
};
|
|
467
476
|
/**
|
|
@@ -472,7 +481,7 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
472
481
|
*/
|
|
473
482
|
function () {
|
|
474
483
|
if (this.hasBinding()) {
|
|
475
|
-
this.pectinFocusBinding.
|
|
484
|
+
this.pectinFocusBinding.focusContext.notifyFocusOut();
|
|
476
485
|
}
|
|
477
486
|
};
|
|
478
487
|
/**
|
|
@@ -494,7 +503,7 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
494
503
|
// TODO: Make this also track the current enabled/disabled state.
|
|
495
504
|
if (this.hasBinding()) {
|
|
496
505
|
var chain = Dsl.disposeWith(this).chain;
|
|
497
|
-
chain.value(this.pectinFocusBinding.focused).subscribe((/**
|
|
506
|
+
chain.value(this.pectinFocusBinding.focusContext.focused).subscribe((/**
|
|
498
507
|
* @param {?} focused
|
|
499
508
|
* @return {?}
|
|
500
509
|
*/
|
|
@@ -517,7 +526,7 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
517
526
|
* @return {?}
|
|
518
527
|
*/
|
|
519
528
|
function () {
|
|
520
|
-
return this.pectinFocusBinding && this.pectinFocusBinding.
|
|
529
|
+
return !!this.pectinFocusBinding && !!this.pectinFocusBinding.focusContext;
|
|
521
530
|
};
|
|
522
531
|
// Hook method for debugging via tracing.
|
|
523
532
|
// Hook method for debugging via tracing.
|
|
@@ -602,7 +611,7 @@ var FocusBindingDirective = /** @class */ (function (_super) {
|
|
|
602
611
|
* @return {?}
|
|
603
612
|
*/
|
|
604
613
|
function () {
|
|
605
|
-
return this.hasBinding() && this.pectinFocusBinding.focused.value;
|
|
614
|
+
return this.hasBinding() && this.pectinFocusBinding.focusContext.focused.value;
|
|
606
615
|
};
|
|
607
616
|
// Hook method for debugging via tracing.
|
|
608
617
|
// Hook method for debugging via tracing.
|
|
@@ -1482,6 +1491,7 @@ var DialogInteractionService = /** @class */ (function (_super) {
|
|
|
1482
1491
|
function DialogInteractionService(dialogService) {
|
|
1483
1492
|
var _this = _super.call(this) || this;
|
|
1484
1493
|
_this.dialogService = dialogService;
|
|
1494
|
+
assert$1.notNil(dialogService);
|
|
1485
1495
|
return _this;
|
|
1486
1496
|
}
|
|
1487
1497
|
/**
|
|
@@ -1653,7 +1663,7 @@ var BusyOverlayComponent = /** @class */ (function () {
|
|
|
1653
1663
|
};
|
|
1654
1664
|
BusyOverlayComponent.decorators = [
|
|
1655
1665
|
{ type: Component, args: [{
|
|
1656
|
-
selector: '
|
|
1666
|
+
selector: 'angular-ui-powerups-busy-overlay',
|
|
1657
1667
|
template: "<ng-content></ng-content>\n<div class=\"busy-overlay-backdrop\" *ngIf=\"busyModel.value\">\n <mat-progress-spinner mode=\"indeterminate\" [diameter]=\"52\"></mat-progress-spinner>\n</div>\n",
|
|
1658
1668
|
styles: [":host{position:relative}div.busy-overlay-backdrop{position:absolute;background-color:rgba(0,0,0,.2);top:0;left:0;bottom:0;right:0;display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;-ms-grid-rows:auto;grid-template-rows:auto;place-content:center}"]
|
|
1659
1669
|
}] }
|
|
@@ -1665,7 +1675,7 @@ var BusyOverlayComponent = /** @class */ (function () {
|
|
|
1665
1675
|
busy: [{ type: Input }]
|
|
1666
1676
|
};
|
|
1667
1677
|
__decorate([
|
|
1668
|
-
|
|
1678
|
+
UseDelegate(),
|
|
1669
1679
|
__metadata("design:type", ValueModel)
|
|
1670
1680
|
], BusyOverlayComponent.prototype, "busyModel", void 0);
|
|
1671
1681
|
__decorate([
|
|
@@ -1970,6 +1980,7 @@ var defaultHiddenStyleDef = style({
|
|
|
1970
1980
|
* @return {?}
|
|
1971
1981
|
*/
|
|
1972
1982
|
function slideDownAndUpAnimation(triggerName, options) {
|
|
1983
|
+
// SEE to fix this: https://github.com/angular/angular/issues/15587#issuecomment-351510501
|
|
1973
1984
|
/** @type {?} */
|
|
1974
1985
|
var duration = OptionsHelper.get(options).getOptional('duration', '100ms');
|
|
1975
1986
|
/** @type {?} */
|
|
@@ -3362,7 +3373,17 @@ function RouteId(type, options) {
|
|
|
3362
3373
|
* @return {?}
|
|
3363
3374
|
*/
|
|
3364
3375
|
function QueryParameter(type, options) {
|
|
3365
|
-
return
|
|
3376
|
+
return (/**
|
|
3377
|
+
* @param {?} prototype
|
|
3378
|
+
* @param {?} propertyKey
|
|
3379
|
+
* @return {?}
|
|
3380
|
+
*/
|
|
3381
|
+
function (prototype, propertyKey) {
|
|
3382
|
+
/** @type {?} */
|
|
3383
|
+
var param = createDefinition(propertyKey, type, options, false);
|
|
3384
|
+
Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
|
|
3385
|
+
UseDelegate()(prototype, propertyKey);
|
|
3386
|
+
});
|
|
3366
3387
|
}
|
|
3367
3388
|
/**
|
|
3368
3389
|
* @template T
|
|
@@ -3392,7 +3413,18 @@ function RouteParameter(type, options) {
|
|
|
3392
3413
|
* @return {?}
|
|
3393
3414
|
*/
|
|
3394
3415
|
function QueryParameterList(elementType, options) {
|
|
3395
|
-
|
|
3416
|
+
// assert.isTruthy(type.isValid());
|
|
3417
|
+
return (/**
|
|
3418
|
+
* @param {?} prototype
|
|
3419
|
+
* @param {?} propertyKey
|
|
3420
|
+
* @return {?}
|
|
3421
|
+
*/
|
|
3422
|
+
function (prototype, propertyKey) {
|
|
3423
|
+
/** @type {?} */
|
|
3424
|
+
var param = createArrayDefinition(propertyKey, elementType, options);
|
|
3425
|
+
Klass.get(prototype).addToOwnMetadataList(RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
|
|
3426
|
+
UseDelegate()(prototype, propertyKey);
|
|
3427
|
+
});
|
|
3396
3428
|
}
|
|
3397
3429
|
/**
|
|
3398
3430
|
* @template E
|