@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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/platform-browser'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@coolon/pectin/lib/promise/deferred.class'), require('@angular/material/dialog'), require('@angular/material/list'), require('@angular/material/tabs'), require('@angular/material/tooltip'), require('@angular/router'), require('@angular/animations'), require('resize-observer-polyfill'), require('@typescript-plus/fast-memoize-decorator'), require('lodash'), require('reflect-metadata'), require('@coolon/typescript-utilities'), require('@typescript-plus/fast-memoize-decorator/dist/src')) :
3
- typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/platform-browser', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@coolon/pectin/lib/promise/deferred.class', '@angular/material/dialog', '@angular/material/list', '@angular/material/tabs', '@angular/material/tooltip', '@angular/router', '@angular/animations', 'resize-observer-polyfill', '@typescript-plus/fast-memoize-decorator', 'lodash', 'reflect-metadata', '@coolon/typescript-utilities', '@typescript-plus/fast-memoize-decorator/dist/src'], factory) :
4
- (global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.platformBrowser, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.deferred_class, global.ng.material.dialog, global.ng.material.list, global.ng.material.tabs, global.ng.material.tooltip, global.ng.router, global.ng.animations, global.ResizeObserver, global.fastMemoizeDecorator, global.lodash, null, global.typescriptUtilities, global.src));
5
- }(this, function (exports, common, core, forms, material, platformBrowser, animations, pectin, portal, deferred_class, dialog, list, tabs, tooltip, router, animations$1, ResizeObserver, fastMemoizeDecorator, lodash, reflectMetadata, typescriptUtilities, src) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/platform-browser'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@coolon/pectin/lib/promise/deferred.class'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('@angular/material/list'), require('@angular/material/tabs'), require('@angular/material/tooltip'), require('@angular/router'), require('@angular/animations'), require('resize-observer-polyfill'), require('@typescript-plus/fast-memoize-decorator'), require('lodash'), require('reflect-metadata'), require('@typescript-plus/fast-memoize-decorator/dist/src')) :
3
+ typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/platform-browser', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@coolon/pectin/lib/promise/deferred.class', '@coolon/typescript-utilities', '@angular/material/dialog', '@angular/material/list', '@angular/material/tabs', '@angular/material/tooltip', '@angular/router', '@angular/animations', 'resize-observer-polyfill', '@typescript-plus/fast-memoize-decorator', 'lodash', 'reflect-metadata', '@typescript-plus/fast-memoize-decorator/dist/src'], factory) :
4
+ (global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.platformBrowser, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.deferred_class, global.typescriptUtilities, global.ng.material.dialog, global.ng.material.list, global.ng.material.tabs, global.ng.material.tooltip, global.ng.router, global.ng.animations, global.ResizeObserver, global.fastMemoizeDecorator, global.lodash, null, global.src));
5
+ }(this, function (exports, common, core, forms, material, platformBrowser, animations, pectin, portal, deferred_class, typescriptUtilities, dialog, list, tabs, tooltip, router, animations$1, ResizeObserver, fastMemoizeDecorator, lodash, reflectMetadata, src) { 'use strict';
6
6
 
7
7
  ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
8
8
 
@@ -228,8 +228,6 @@
228
228
  * @fileoverview added by tsickle
229
229
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
230
230
  */
231
- /** @type {?} */
232
- var EMPTY_ERRORS = new pectin.MutableListModel().readonly;
233
231
  /**
234
232
  * @abstract
235
233
  * @template T
@@ -238,6 +236,7 @@
238
236
  __extends(AbstractInputComponent, _super);
239
237
  function AbstractInputComponent() {
240
238
  var _this = _super.call(this) || this;
239
+ _this.valueModel = new pectin.DelegatingFormValueModel();
241
240
  // TODO: fix this.
242
241
  // tslint:disable-next-line:no-output-native
243
242
  _this.focus = new core.EventEmitter();
@@ -261,6 +260,17 @@
261
260
  };
262
261
  return _this;
263
262
  }
263
+ Object.defineProperty(AbstractInputComponent.prototype, "userValueModel", {
264
+ set: /**
265
+ * @param {?} model
266
+ * @return {?}
267
+ */
268
+ function (model) {
269
+ this.valueModel.setDelegate(model);
270
+ },
271
+ enumerable: true,
272
+ configurable: true
273
+ });
264
274
  /**
265
275
  * @return {?}
266
276
  */
@@ -332,7 +342,6 @@
332
342
  * @return {?}
333
343
  */
334
344
  function () {
335
- // this._focused = this.valueModel['focused'] || new ValueHolder();
336
345
  };
337
346
  /**
338
347
  * @return {?}
@@ -348,8 +357,7 @@
348
357
  * @return {?}
349
358
  */
350
359
  function () {
351
- // @ts-ignore
352
- return ((/** @type {?} */ (this.valueModel))).enabled || pectin.Constant.TRUE;
360
+ return this.valueModel.enabled;
353
361
  },
354
362
  enumerable: true,
355
363
  configurable: true
@@ -368,7 +376,7 @@
368
376
  * @return {?}
369
377
  */
370
378
  function () {
371
- return ((/** @type {?} */ (this.valueModel))).errorList || EMPTY_ERRORS;
379
+ return this.valueModel.errorList;
372
380
  },
373
381
  enumerable: true,
374
382
  configurable: true
@@ -384,7 +392,7 @@
384
392
  configurable: true
385
393
  });
386
394
  AbstractInputComponent.propDecorators = {
387
- valueModel: [{ type: core.Input }],
395
+ userValueModel: [{ type: core.Input, args: ['valueModel',] }],
388
396
  label: [{ type: core.Input }],
389
397
  floatLabel: [{ type: core.Input }],
390
398
  hint: [{ type: core.Input }],
@@ -404,8 +412,9 @@
404
412
  };
405
413
  __decorate([
406
414
  pectin.UseDelegate(),
407
- __metadata("design:type", pectin.MutableValueModel)
408
- ], AbstractInputComponent.prototype, "valueModel", void 0);
415
+ __metadata("design:type", pectin.ValueModel),
416
+ __metadata("design:paramtypes", [pectin.ValueModel])
417
+ ], AbstractInputComponent.prototype, "userValueModel", null);
409
418
  return AbstractInputComponent;
410
419
  }(DisposableComponent));
411
420
  if (false) {
@@ -643,7 +652,7 @@
643
652
  */
644
653
  function () {
645
654
  if (this.hasBinding()) {
646
- this.pectinFocusBinding.focusCallbacks.notifyFocusIn();
655
+ this.pectinFocusBinding.focusContext.notifyFocusIn();
647
656
  }
648
657
  };
649
658
  /**
@@ -654,7 +663,7 @@
654
663
  */
655
664
  function () {
656
665
  if (this.hasBinding()) {
657
- this.pectinFocusBinding.focusCallbacks.notifyFocusOut();
666
+ this.pectinFocusBinding.focusContext.notifyFocusOut();
658
667
  }
659
668
  };
660
669
  /**
@@ -676,7 +685,7 @@
676
685
  // TODO: Make this also track the current enabled/disabled state.
677
686
  if (this.hasBinding()) {
678
687
  var chain = pectin.Dsl.disposeWith(this).chain;
679
- chain.value(this.pectinFocusBinding.focused).subscribe((/**
688
+ chain.value(this.pectinFocusBinding.focusContext.focused).subscribe((/**
680
689
  * @param {?} focused
681
690
  * @return {?}
682
691
  */
@@ -699,7 +708,7 @@
699
708
  * @return {?}
700
709
  */
701
710
  function () {
702
- return this.pectinFocusBinding && this.pectinFocusBinding.focused;
711
+ return !!this.pectinFocusBinding && !!this.pectinFocusBinding.focusContext;
703
712
  };
704
713
  // Hook method for debugging via tracing.
705
714
  // Hook method for debugging via tracing.
@@ -784,7 +793,7 @@
784
793
  * @return {?}
785
794
  */
786
795
  function () {
787
- return this.hasBinding() && this.pectinFocusBinding.focused.value;
796
+ return this.hasBinding() && this.pectinFocusBinding.focusContext.focused.value;
788
797
  };
789
798
  // Hook method for debugging via tracing.
790
799
  // Hook method for debugging via tracing.
@@ -1664,6 +1673,7 @@
1664
1673
  function DialogInteractionService(dialogService) {
1665
1674
  var _this = _super.call(this) || this;
1666
1675
  _this.dialogService = dialogService;
1676
+ typescriptUtilities.assert.notNil(dialogService);
1667
1677
  return _this;
1668
1678
  }
1669
1679
  /**
@@ -1835,7 +1845,7 @@
1835
1845
  };
1836
1846
  BusyOverlayComponent.decorators = [
1837
1847
  { type: core.Component, args: [{
1838
- selector: 'aup-busy-overlay',
1848
+ selector: 'angular-ui-powerups-busy-overlay',
1839
1849
  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",
1840
1850
  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}"]
1841
1851
  }] }
@@ -1847,7 +1857,7 @@
1847
1857
  busy: [{ type: core.Input }]
1848
1858
  };
1849
1859
  __decorate([
1850
- pectin.UseDelegatingValueModel(),
1860
+ pectin.UseDelegate(),
1851
1861
  __metadata("design:type", pectin.ValueModel)
1852
1862
  ], BusyOverlayComponent.prototype, "busyModel", void 0);
1853
1863
  __decorate([
@@ -2152,6 +2162,7 @@
2152
2162
  * @return {?}
2153
2163
  */
2154
2164
  function slideDownAndUpAnimation(triggerName, options) {
2165
+ // SEE to fix this: https://github.com/angular/angular/issues/15587#issuecomment-351510501
2155
2166
  /** @type {?} */
2156
2167
  var duration = pectin.OptionsHelper.get(options).getOptional('duration', '100ms');
2157
2168
  /** @type {?} */
@@ -3544,7 +3555,17 @@
3544
3555
  * @return {?}
3545
3556
  */
3546
3557
  function QueryParameter(type, options) {
3547
- return RouteParameter(type, options);
3558
+ return (/**
3559
+ * @param {?} prototype
3560
+ * @param {?} propertyKey
3561
+ * @return {?}
3562
+ */
3563
+ function (prototype, propertyKey) {
3564
+ /** @type {?} */
3565
+ var param = createDefinition(propertyKey, type, options, false);
3566
+ typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(exports.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
3567
+ pectin.UseDelegate()(prototype, propertyKey);
3568
+ });
3548
3569
  }
3549
3570
  /**
3550
3571
  * @template T
@@ -3574,7 +3595,18 @@
3574
3595
  * @return {?}
3575
3596
  */
3576
3597
  function QueryParameterList(elementType, options) {
3577
- return RouteParameterList(elementType, options);
3598
+ // assert.isTruthy(type.isValid());
3599
+ return (/**
3600
+ * @param {?} prototype
3601
+ * @param {?} propertyKey
3602
+ * @return {?}
3603
+ */
3604
+ function (prototype, propertyKey) {
3605
+ /** @type {?} */
3606
+ var param = createArrayDefinition(propertyKey, elementType, options);
3607
+ typescriptUtilities.Klass.get(prototype).addToOwnMetadataList(exports.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY, param);
3608
+ pectin.UseDelegate()(prototype, propertyKey);
3609
+ });
3578
3610
  }
3579
3611
  /**
3580
3612
  * @template E