@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 { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __values } 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';
@@ -1816,7 +1817,9 @@ var AngularUiPowerupsModule = /** @class */ (function () {
1816
1817
  FormsModule,
1817
1818
  MatInputModule,
1818
1819
  MatFormFieldModule,
1819
- MatSelectModule
1820
+ MatSelectModule,
1821
+ PlaceModule,
1822
+ InteractionModule
1820
1823
  ],
1821
1824
  exports: [
1822
1825
  CommandDirective,
@@ -1833,6 +1836,249 @@ var AngularUiPowerupsModule = /** @class */ (function () {
1833
1836
  return AngularUiPowerupsModule;
1834
1837
  }());
1835
1838
 
1839
+ /**
1840
+ * @fileoverview added by tsickle
1841
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1842
+ */
1843
+ var Dimension = /** @class */ (function () {
1844
+ function Dimension(width, height) {
1845
+ this.width = width;
1846
+ this.height = height;
1847
+ }
1848
+ return Dimension;
1849
+ }());
1850
+ if (false) {
1851
+ /** @type {?} */
1852
+ Dimension.prototype.width;
1853
+ /** @type {?} */
1854
+ Dimension.prototype.height;
1855
+ }
1856
+
1857
+ /**
1858
+ * @fileoverview added by tsickle
1859
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1860
+ */
1861
+ var Point = /** @class */ (function () {
1862
+ function Point(x, y) {
1863
+ this.x = x;
1864
+ this.y = y;
1865
+ }
1866
+ /**
1867
+ * @param {?} data
1868
+ * @return {?}
1869
+ */
1870
+ Point.from = /**
1871
+ * @param {?} data
1872
+ * @return {?}
1873
+ */
1874
+ function (data) {
1875
+ return new Point(data.x, data.y);
1876
+ };
1877
+ /**
1878
+ * @param {?} x
1879
+ * @param {?} y
1880
+ * @return {?}
1881
+ */
1882
+ Point.prototype.translate = /**
1883
+ * @param {?} x
1884
+ * @param {?} y
1885
+ * @return {?}
1886
+ */
1887
+ function (x, y) {
1888
+ return new Point(this.x + x, this.y + y);
1889
+ };
1890
+ return Point;
1891
+ }());
1892
+ if (false) {
1893
+ /** @type {?} */
1894
+ Point.prototype.x;
1895
+ /** @type {?} */
1896
+ Point.prototype.y;
1897
+ }
1898
+
1899
+ /**
1900
+ * @fileoverview added by tsickle
1901
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1902
+ */
1903
+ var Bounds = /** @class */ (function (_super) {
1904
+ __extends(Bounds, _super);
1905
+ function Bounds(top, left, width, height) {
1906
+ var _this = _super.call(this, width, height) || this;
1907
+ _this.top = top;
1908
+ _this.left = left;
1909
+ _this.width = width;
1910
+ _this.height = height;
1911
+ return _this;
1912
+ }
1913
+ /**
1914
+ * @param {?} point
1915
+ * @return {?}
1916
+ */
1917
+ Bounds.prototype.relativePositionOf = /**
1918
+ * @param {?} point
1919
+ * @return {?}
1920
+ */
1921
+ function (point) {
1922
+ if (point instanceof MouseEvent) {
1923
+ return new Point(point.clientX - this.left, point.clientY - this.top);
1924
+ }
1925
+ else {
1926
+ return new Point(point.x - this.left, point.y - this.top);
1927
+ }
1928
+ };
1929
+ return Bounds;
1930
+ }(Dimension));
1931
+ if (false) {
1932
+ /** @type {?} */
1933
+ Bounds.prototype.top;
1934
+ /** @type {?} */
1935
+ Bounds.prototype.left;
1936
+ /** @type {?} */
1937
+ Bounds.prototype.width;
1938
+ /** @type {?} */
1939
+ Bounds.prototype.height;
1940
+ }
1941
+ (function (Bounds) {
1942
+ /**
1943
+ * @param {?} element
1944
+ * @return {?}
1945
+ */
1946
+ function ofElement(element) {
1947
+ /** @type {?} */
1948
+ var rect = element.getBoundingClientRect();
1949
+ return new Bounds(rect.top, rect.left, rect.width, rect.height);
1950
+ }
1951
+ Bounds.ofElement = ofElement;
1952
+ })(Bounds || (Bounds = {}));
1953
+
1954
+ /**
1955
+ * @fileoverview added by tsickle
1956
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1957
+ */
1958
+ var ResizeAwareComponent = /** @class */ (function (_super) {
1959
+ __extends(ResizeAwareComponent, _super);
1960
+ function ResizeAwareComponent(elementRef, ngZone) {
1961
+ var _this = _super.call(this) || this;
1962
+ _this.elementRef = elementRef;
1963
+ _this.ngZone = ngZone;
1964
+ _this._boundsModel = new ValueHolder(new Bounds(0, 0, 0, 0));
1965
+ return _this;
1966
+ }
1967
+ /**
1968
+ * @return {?}
1969
+ */
1970
+ ResizeAwareComponent.prototype.ngAfterViewInit = /**
1971
+ * @return {?}
1972
+ */
1973
+ function () {
1974
+ var _this = this;
1975
+ this.updateBounds();
1976
+ /** @type {?} */
1977
+ var element = this.elementRef.nativeElement;
1978
+ /** @type {?} */
1979
+ var ro = new ResizeObserver((/**
1980
+ * @param {?} entries
1981
+ * @param {?} observer
1982
+ * @return {?}
1983
+ */
1984
+ function (entries, observer) {
1985
+ _this.ngZone.run((/**
1986
+ * @return {?}
1987
+ */
1988
+ function () { return _this.updateBounds(); }));
1989
+ }));
1990
+ ro.observe(element);
1991
+ this.onDispose((/**
1992
+ * @return {?}
1993
+ */
1994
+ function () { return ro.disconnect(); }));
1995
+ };
1996
+ Object.defineProperty(ResizeAwareComponent.prototype, "boundsModel", {
1997
+ get: /**
1998
+ * @return {?}
1999
+ */
2000
+ function () {
2001
+ return this._boundsModel.readonly;
2002
+ },
2003
+ enumerable: true,
2004
+ configurable: true
2005
+ });
2006
+ Object.defineProperty(ResizeAwareComponent.prototype, "nativeElement", {
2007
+ get: /**
2008
+ * @return {?}
2009
+ */
2010
+ function () {
2011
+ return this.elementRef.nativeElement;
2012
+ },
2013
+ enumerable: true,
2014
+ configurable: true
2015
+ });
2016
+ // TODO: Make this handle body scroll
2017
+ // TODO: Make this handle body scroll
2018
+ /**
2019
+ * @param {?} point
2020
+ * @return {?}
2021
+ */
2022
+ ResizeAwareComponent.prototype.relativePositionOf =
2023
+ // TODO: Make this handle body scroll
2024
+ /**
2025
+ * @param {?} point
2026
+ * @return {?}
2027
+ */
2028
+ function (point) {
2029
+ return this.bounds.relativePositionOf(point);
2030
+ };
2031
+ Object.defineProperty(ResizeAwareComponent.prototype, "bounds", {
2032
+ get: /**
2033
+ * @return {?}
2034
+ */
2035
+ function () {
2036
+ return this._boundsModel.value;
2037
+ },
2038
+ enumerable: true,
2039
+ configurable: true
2040
+ });
2041
+ /**
2042
+ * @private
2043
+ * @return {?}
2044
+ */
2045
+ ResizeAwareComponent.prototype.updateBounds = /**
2046
+ * @private
2047
+ * @return {?}
2048
+ */
2049
+ function () {
2050
+ this._boundsModel.value = Bounds.ofElement(this.nativeElement);
2051
+ };
2052
+ return ResizeAwareComponent;
2053
+ }(DisposableComponent));
2054
+ if (false) {
2055
+ /**
2056
+ * @type {?}
2057
+ * @private
2058
+ */
2059
+ ResizeAwareComponent.prototype._boundsModel;
2060
+ /**
2061
+ * @type {?}
2062
+ * @protected
2063
+ */
2064
+ ResizeAwareComponent.prototype.elementRef;
2065
+ /**
2066
+ * @type {?}
2067
+ * @protected
2068
+ */
2069
+ ResizeAwareComponent.prototype.ngZone;
2070
+ }
2071
+
2072
+ /**
2073
+ * @fileoverview added by tsickle
2074
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2075
+ */
2076
+
2077
+ /**
2078
+ * @fileoverview added by tsickle
2079
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2080
+ */
2081
+
1836
2082
  /**
1837
2083
  * @fileoverview added by tsickle
1838
2084
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
@@ -2918,5 +3164,5 @@ var ParameterType;
2918
3164
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2919
3165
  */
2920
3166
 
2921
- 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 };
3167
+ 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 };
2922
3168
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map