@coolon/angular-ui-powerups 0.0.2 → 0.0.4

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.
Files changed (38) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +295 -36
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.d.ts +16 -15
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +16 -15
  8. package/esm2015/index.js +2 -2
  9. package/esm2015/lib/angular-ui-powerups.module.js +4 -2
  10. package/esm2015/lib/components/index.js +18 -0
  11. package/esm2015/lib/components/resize-aware.component.js +96 -0
  12. package/esm2015/lib/components/types/bounds.class.js +56 -0
  13. package/esm2015/lib/components/types/dimension.class.js +21 -0
  14. package/esm2015/lib/components/types/point.class.js +36 -0
  15. package/esm2015/lib/directives/index.js +10 -0
  16. package/esm2015/public_api.js +4 -3
  17. package/esm5/coolon-angular-ui-powerups.js +16 -15
  18. package/esm5/index.js +2 -2
  19. package/esm5/lib/angular-ui-powerups.module.js +4 -2
  20. package/esm5/lib/components/index.js +18 -0
  21. package/esm5/lib/components/resize-aware.component.js +124 -0
  22. package/esm5/lib/components/types/bounds.class.js +59 -0
  23. package/esm5/lib/components/types/dimension.class.js +19 -0
  24. package/esm5/lib/components/types/point.class.js +43 -0
  25. package/esm5/lib/directives/index.js +10 -0
  26. package/esm5/public_api.js +4 -3
  27. package/fesm2015/coolon-angular-ui-powerups.js +219 -3
  28. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  29. package/fesm5/coolon-angular-ui-powerups.js +249 -3
  30. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  31. package/lib/components/index.d.ts +13 -0
  32. package/lib/components/resize-aware.component.d.ts +22 -0
  33. package/lib/components/types/bounds.class.d.ts +16 -0
  34. package/lib/components/types/dimension.class.d.ts +5 -0
  35. package/lib/components/types/point.class.d.ts +10 -0
  36. package/lib/directives/index.d.ts +5 -0
  37. package/package.json +1 -1
  38. package/public_api.d.ts +2 -1
@@ -5,11 +5,12 @@ 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 { __decorate, __metadata, __awaiter } from 'tslib';
8
- import { GarbageCollector, MutableListModel, Constant, UseDelegate, MutableValueModel, assert, Dsl, Logger, ListModel, StoreInListModel, EventListenerList, DelegatingValueModel, lang, UseDelegatingValueModel, ValueModel, StoreInValueModel, Trace, TransactionObserver, Binding } from '@coolon/pectin';
8
+ import { GarbageCollector, MutableListModel, Constant, UseDelegate, MutableValueModel, assert, Dsl, Logger, ListModel, StoreInListModel, EventListenerList, DelegatingValueModel, lang, UseDelegatingValueModel, ValueModel, StoreInValueModel, Trace, ValueHolder, 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
11
  import { MatDialog as MatDialog$1 } from '@angular/material/dialog';
12
12
  import { RouterModule, Router, ActivatedRoute, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
13
+ import ResizeObserver from 'resize-observer-polyfill';
13
14
  import { Memoize } from '@typescript-plus/fast-memoize-decorator';
14
15
  import { isNil } from 'lodash';
15
16
  import 'reflect-metadata';
@@ -1501,7 +1502,9 @@ AngularUiPowerupsModule.decorators = [
1501
1502
  FormsModule,
1502
1503
  MatInputModule,
1503
1504
  MatFormFieldModule,
1504
- MatSelectModule
1505
+ MatSelectModule,
1506
+ PlaceModule,
1507
+ InteractionModule
1505
1508
  ],
1506
1509
  exports: [
1507
1510
  CommandDirective,
@@ -1516,6 +1519,219 @@ AngularUiPowerupsModule.decorators = [
1516
1519
  },] }
1517
1520
  ];
1518
1521
 
1522
+ /**
1523
+ * @fileoverview added by tsickle
1524
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1525
+ */
1526
+ class Dimension {
1527
+ /**
1528
+ * @param {?} width
1529
+ * @param {?} height
1530
+ */
1531
+ constructor(width, height) {
1532
+ this.width = width;
1533
+ this.height = height;
1534
+ }
1535
+ }
1536
+ if (false) {
1537
+ /** @type {?} */
1538
+ Dimension.prototype.width;
1539
+ /** @type {?} */
1540
+ Dimension.prototype.height;
1541
+ }
1542
+
1543
+ /**
1544
+ * @fileoverview added by tsickle
1545
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1546
+ */
1547
+ class Point {
1548
+ /**
1549
+ * @param {?} x
1550
+ * @param {?} y
1551
+ */
1552
+ constructor(x, y) {
1553
+ this.x = x;
1554
+ this.y = y;
1555
+ }
1556
+ /**
1557
+ * @param {?} data
1558
+ * @return {?}
1559
+ */
1560
+ static from(data) {
1561
+ return new Point(data.x, data.y);
1562
+ }
1563
+ /**
1564
+ * @param {?} x
1565
+ * @param {?} y
1566
+ * @return {?}
1567
+ */
1568
+ translate(x, y) {
1569
+ return new Point(this.x + x, this.y + y);
1570
+ }
1571
+ }
1572
+ if (false) {
1573
+ /** @type {?} */
1574
+ Point.prototype.x;
1575
+ /** @type {?} */
1576
+ Point.prototype.y;
1577
+ }
1578
+
1579
+ /**
1580
+ * @fileoverview added by tsickle
1581
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1582
+ */
1583
+ class Bounds extends Dimension {
1584
+ /**
1585
+ * @param {?} top
1586
+ * @param {?} left
1587
+ * @param {?} width
1588
+ * @param {?} height
1589
+ */
1590
+ constructor(top, left, width, height) {
1591
+ super(width, height);
1592
+ this.top = top;
1593
+ this.left = left;
1594
+ this.width = width;
1595
+ this.height = height;
1596
+ }
1597
+ /**
1598
+ * @param {?} point
1599
+ * @return {?}
1600
+ */
1601
+ relativePositionOf(point) {
1602
+ if (point instanceof MouseEvent) {
1603
+ return new Point(point.clientX - this.left, point.clientY - this.top);
1604
+ }
1605
+ else {
1606
+ return new Point(point.x - this.left, point.y - this.top);
1607
+ }
1608
+ }
1609
+ }
1610
+ if (false) {
1611
+ /** @type {?} */
1612
+ Bounds.prototype.top;
1613
+ /** @type {?} */
1614
+ Bounds.prototype.left;
1615
+ /** @type {?} */
1616
+ Bounds.prototype.width;
1617
+ /** @type {?} */
1618
+ Bounds.prototype.height;
1619
+ }
1620
+ (function (Bounds) {
1621
+ /**
1622
+ * @param {?} element
1623
+ * @return {?}
1624
+ */
1625
+ function ofElement(element) {
1626
+ /** @type {?} */
1627
+ const rect = element.getBoundingClientRect();
1628
+ return new Bounds(rect.top, rect.left, rect.width, rect.height);
1629
+ }
1630
+ Bounds.ofElement = ofElement;
1631
+ })(Bounds || (Bounds = {}));
1632
+
1633
+ /**
1634
+ * @fileoverview added by tsickle
1635
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1636
+ */
1637
+ class ResizeAwareComponent extends DisposableComponent {
1638
+ /**
1639
+ * @param {?} elementRef
1640
+ * @param {?} ngZone
1641
+ */
1642
+ constructor(elementRef, ngZone) {
1643
+ super();
1644
+ this.elementRef = elementRef;
1645
+ this.ngZone = ngZone;
1646
+ this._boundsModel = new ValueHolder(new Bounds(0, 0, 0, 0));
1647
+ }
1648
+ /**
1649
+ * @return {?}
1650
+ */
1651
+ ngAfterViewInit() {
1652
+ this.updateBounds();
1653
+ /** @type {?} */
1654
+ const element = this.elementRef.nativeElement;
1655
+ /** @type {?} */
1656
+ const ro = new ResizeObserver((/**
1657
+ * @param {?} entries
1658
+ * @param {?} observer
1659
+ * @return {?}
1660
+ */
1661
+ (entries, observer) => {
1662
+ this.ngZone.run((/**
1663
+ * @return {?}
1664
+ */
1665
+ () => this.updateBounds()));
1666
+ }));
1667
+ ro.observe(element);
1668
+ this.onDispose((/**
1669
+ * @return {?}
1670
+ */
1671
+ () => ro.disconnect()));
1672
+ }
1673
+ /**
1674
+ * @return {?}
1675
+ */
1676
+ get boundsModel() {
1677
+ return this._boundsModel.readonly;
1678
+ }
1679
+ /**
1680
+ * @return {?}
1681
+ */
1682
+ get nativeElement() {
1683
+ return this.elementRef.nativeElement;
1684
+ }
1685
+ // TODO: Make this handle body scroll
1686
+ /**
1687
+ * @param {?} point
1688
+ * @return {?}
1689
+ */
1690
+ relativePositionOf(point) {
1691
+ return this.bounds.relativePositionOf(point);
1692
+ }
1693
+ /**
1694
+ * @return {?}
1695
+ */
1696
+ get bounds() {
1697
+ return this._boundsModel.value;
1698
+ }
1699
+ /**
1700
+ * @private
1701
+ * @return {?}
1702
+ */
1703
+ updateBounds() {
1704
+ this._boundsModel.value = Bounds.ofElement(this.nativeElement);
1705
+ }
1706
+ }
1707
+ if (false) {
1708
+ /**
1709
+ * @type {?}
1710
+ * @private
1711
+ */
1712
+ ResizeAwareComponent.prototype._boundsModel;
1713
+ /**
1714
+ * @type {?}
1715
+ * @protected
1716
+ */
1717
+ ResizeAwareComponent.prototype.elementRef;
1718
+ /**
1719
+ * @type {?}
1720
+ * @protected
1721
+ */
1722
+ ResizeAwareComponent.prototype.ngZone;
1723
+ }
1724
+
1725
+ /**
1726
+ * @fileoverview added by tsickle
1727
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1728
+ */
1729
+
1730
+ /**
1731
+ * @fileoverview added by tsickle
1732
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1733
+ */
1734
+
1519
1735
  /**
1520
1736
  * @fileoverview added by tsickle
1521
1737
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -2471,5 +2687,5 @@ var ParameterType;
2471
2687
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2472
2688
  */
2473
2689
 
2474
- export { ACTIVITY_DATA, AbstractActivity, AbstractPlaceComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, BusyOverlayComponent, ConfirmationDialogComponent, DialogInteractionService, EmptyStateComponent, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LeavePlaceGuard, ParameterType, Place, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, QueryParameter, RouteId, RouteParameterBindings, RouteParameterSanitiser, CommandDirective as ɵa, FocusBindingDirective as ɵb, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, ActivityContainerComponent as ɵi, ConfirmationDialogComponent as ɵj, AbstractActivity as ɵk, ACTIVITY_DATA as ɵl, AlertDialogComponent as ɵn, ActivityOutletComponent as ɵp, DialogInteractionService as ɵq, InteractionContext as ɵr, PlaceModule as ɵs, EmptyStateComponent as ɵt, BusyOverlayComponent as ɵu, PlaceOutletComponent as ɵv, PlaceService as ɵw };
2690
+ export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceComponent, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ConfirmationDialogComponent, DialogInteractionService, Dimension, DisposableComponent, EmptyStateComponent, FocusBindingDirective, INTERACTION_CONTEXT, InteractionContext, InteractionModule, LeavePlaceGuard, NumberInputComponent, ParameterType, PasswordInputComponent, Place, PlaceModule, PlaceOutletComponent, PlaceRouteGuard, PlaceService, Point, QueryParameter, ResizeAwareComponent, RouteId, RouteParameterBindings, RouteParameterSanitiser, SelectInputComponent, StringInputComponent, CommandDirective as ɵa, FocusBindingDirective as ɵb, DisposableComponent as ɵc, NumberInputComponent as ɵd, AbstractInputComponent as ɵe, StringInputComponent as ɵf, PasswordInputComponent as ɵg, SelectInputComponent as ɵh, PlaceModule as ɵi, EmptyStateComponent as ɵj, BusyOverlayComponent as ɵk, PlaceOutletComponent as ɵl, PlaceService as ɵm, InteractionModule as ɵn, ActivityContainerComponent as ɵo, ConfirmationDialogComponent as ɵp, AbstractActivity as ɵq, ACTIVITY_DATA as ɵr, AlertDialogComponent as ɵt, ActivityOutletComponent as ɵv, DialogInteractionService as ɵw, InteractionContext as ɵx };
2475
2691
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map