@coolon/angular-ui-powerups 0.0.2 → 0.0.3
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 +292 -35
- 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.d.ts +16 -15
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +16 -15
- package/esm2015/index.js +2 -2
- package/esm2015/lib/components/index.js +18 -0
- package/esm2015/lib/components/resize-aware.component.js +96 -0
- package/esm2015/lib/components/types/bounds.class.js +56 -0
- package/esm2015/lib/components/types/dimension.class.js +21 -0
- package/esm2015/lib/components/types/point.class.js +36 -0
- package/esm2015/lib/directives/index.js +10 -0
- package/esm2015/public_api.js +4 -3
- package/esm5/coolon-angular-ui-powerups.js +16 -15
- package/esm5/index.js +2 -2
- package/esm5/lib/components/index.js +18 -0
- package/esm5/lib/components/resize-aware.component.js +124 -0
- package/esm5/lib/components/types/bounds.class.js +59 -0
- package/esm5/lib/components/types/dimension.class.js +19 -0
- package/esm5/lib/components/types/point.class.js +43 -0
- package/esm5/lib/directives/index.js +10 -0
- package/esm5/public_api.js +4 -3
- package/fesm2015/coolon-angular-ui-powerups.js +216 -2
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +246 -2
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/index.d.ts +13 -0
- package/lib/components/resize-aware.component.d.ts +22 -0
- package/lib/components/types/bounds.class.d.ts +16 -0
- package/lib/components/types/dimension.class.d.ts +5 -0
- package/lib/components/types/point.class.d.ts +10 -0
- package/lib/directives/index.d.ts +5 -0
- package/package.json +1 -1
- 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';
|
|
@@ -1833,6 +1834,249 @@ var AngularUiPowerupsModule = /** @class */ (function () {
|
|
|
1833
1834
|
return AngularUiPowerupsModule;
|
|
1834
1835
|
}());
|
|
1835
1836
|
|
|
1837
|
+
/**
|
|
1838
|
+
* @fileoverview added by tsickle
|
|
1839
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1840
|
+
*/
|
|
1841
|
+
var Dimension = /** @class */ (function () {
|
|
1842
|
+
function Dimension(width, height) {
|
|
1843
|
+
this.width = width;
|
|
1844
|
+
this.height = height;
|
|
1845
|
+
}
|
|
1846
|
+
return Dimension;
|
|
1847
|
+
}());
|
|
1848
|
+
if (false) {
|
|
1849
|
+
/** @type {?} */
|
|
1850
|
+
Dimension.prototype.width;
|
|
1851
|
+
/** @type {?} */
|
|
1852
|
+
Dimension.prototype.height;
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* @fileoverview added by tsickle
|
|
1857
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1858
|
+
*/
|
|
1859
|
+
var Point = /** @class */ (function () {
|
|
1860
|
+
function Point(x, y) {
|
|
1861
|
+
this.x = x;
|
|
1862
|
+
this.y = y;
|
|
1863
|
+
}
|
|
1864
|
+
/**
|
|
1865
|
+
* @param {?} data
|
|
1866
|
+
* @return {?}
|
|
1867
|
+
*/
|
|
1868
|
+
Point.from = /**
|
|
1869
|
+
* @param {?} data
|
|
1870
|
+
* @return {?}
|
|
1871
|
+
*/
|
|
1872
|
+
function (data) {
|
|
1873
|
+
return new Point(data.x, data.y);
|
|
1874
|
+
};
|
|
1875
|
+
/**
|
|
1876
|
+
* @param {?} x
|
|
1877
|
+
* @param {?} y
|
|
1878
|
+
* @return {?}
|
|
1879
|
+
*/
|
|
1880
|
+
Point.prototype.translate = /**
|
|
1881
|
+
* @param {?} x
|
|
1882
|
+
* @param {?} y
|
|
1883
|
+
* @return {?}
|
|
1884
|
+
*/
|
|
1885
|
+
function (x, y) {
|
|
1886
|
+
return new Point(this.x + x, this.y + y);
|
|
1887
|
+
};
|
|
1888
|
+
return Point;
|
|
1889
|
+
}());
|
|
1890
|
+
if (false) {
|
|
1891
|
+
/** @type {?} */
|
|
1892
|
+
Point.prototype.x;
|
|
1893
|
+
/** @type {?} */
|
|
1894
|
+
Point.prototype.y;
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* @fileoverview added by tsickle
|
|
1899
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1900
|
+
*/
|
|
1901
|
+
var Bounds = /** @class */ (function (_super) {
|
|
1902
|
+
__extends(Bounds, _super);
|
|
1903
|
+
function Bounds(top, left, width, height) {
|
|
1904
|
+
var _this = _super.call(this, width, height) || this;
|
|
1905
|
+
_this.top = top;
|
|
1906
|
+
_this.left = left;
|
|
1907
|
+
_this.width = width;
|
|
1908
|
+
_this.height = height;
|
|
1909
|
+
return _this;
|
|
1910
|
+
}
|
|
1911
|
+
/**
|
|
1912
|
+
* @param {?} point
|
|
1913
|
+
* @return {?}
|
|
1914
|
+
*/
|
|
1915
|
+
Bounds.prototype.relativePositionOf = /**
|
|
1916
|
+
* @param {?} point
|
|
1917
|
+
* @return {?}
|
|
1918
|
+
*/
|
|
1919
|
+
function (point) {
|
|
1920
|
+
if (point instanceof MouseEvent) {
|
|
1921
|
+
return new Point(point.clientX - this.left, point.clientY - this.top);
|
|
1922
|
+
}
|
|
1923
|
+
else {
|
|
1924
|
+
return new Point(point.x - this.left, point.y - this.top);
|
|
1925
|
+
}
|
|
1926
|
+
};
|
|
1927
|
+
return Bounds;
|
|
1928
|
+
}(Dimension));
|
|
1929
|
+
if (false) {
|
|
1930
|
+
/** @type {?} */
|
|
1931
|
+
Bounds.prototype.top;
|
|
1932
|
+
/** @type {?} */
|
|
1933
|
+
Bounds.prototype.left;
|
|
1934
|
+
/** @type {?} */
|
|
1935
|
+
Bounds.prototype.width;
|
|
1936
|
+
/** @type {?} */
|
|
1937
|
+
Bounds.prototype.height;
|
|
1938
|
+
}
|
|
1939
|
+
(function (Bounds) {
|
|
1940
|
+
/**
|
|
1941
|
+
* @param {?} element
|
|
1942
|
+
* @return {?}
|
|
1943
|
+
*/
|
|
1944
|
+
function ofElement(element) {
|
|
1945
|
+
/** @type {?} */
|
|
1946
|
+
var rect = element.getBoundingClientRect();
|
|
1947
|
+
return new Bounds(rect.top, rect.left, rect.width, rect.height);
|
|
1948
|
+
}
|
|
1949
|
+
Bounds.ofElement = ofElement;
|
|
1950
|
+
})(Bounds || (Bounds = {}));
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* @fileoverview added by tsickle
|
|
1954
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1955
|
+
*/
|
|
1956
|
+
var ResizeAwareComponent = /** @class */ (function (_super) {
|
|
1957
|
+
__extends(ResizeAwareComponent, _super);
|
|
1958
|
+
function ResizeAwareComponent(elementRef, ngZone) {
|
|
1959
|
+
var _this = _super.call(this) || this;
|
|
1960
|
+
_this.elementRef = elementRef;
|
|
1961
|
+
_this.ngZone = ngZone;
|
|
1962
|
+
_this._boundsModel = new ValueHolder(new Bounds(0, 0, 0, 0));
|
|
1963
|
+
return _this;
|
|
1964
|
+
}
|
|
1965
|
+
/**
|
|
1966
|
+
* @return {?}
|
|
1967
|
+
*/
|
|
1968
|
+
ResizeAwareComponent.prototype.ngAfterViewInit = /**
|
|
1969
|
+
* @return {?}
|
|
1970
|
+
*/
|
|
1971
|
+
function () {
|
|
1972
|
+
var _this = this;
|
|
1973
|
+
this.updateBounds();
|
|
1974
|
+
/** @type {?} */
|
|
1975
|
+
var element = this.elementRef.nativeElement;
|
|
1976
|
+
/** @type {?} */
|
|
1977
|
+
var ro = new ResizeObserver((/**
|
|
1978
|
+
* @param {?} entries
|
|
1979
|
+
* @param {?} observer
|
|
1980
|
+
* @return {?}
|
|
1981
|
+
*/
|
|
1982
|
+
function (entries, observer) {
|
|
1983
|
+
_this.ngZone.run((/**
|
|
1984
|
+
* @return {?}
|
|
1985
|
+
*/
|
|
1986
|
+
function () { return _this.updateBounds(); }));
|
|
1987
|
+
}));
|
|
1988
|
+
ro.observe(element);
|
|
1989
|
+
this.onDispose((/**
|
|
1990
|
+
* @return {?}
|
|
1991
|
+
*/
|
|
1992
|
+
function () { return ro.disconnect(); }));
|
|
1993
|
+
};
|
|
1994
|
+
Object.defineProperty(ResizeAwareComponent.prototype, "boundsModel", {
|
|
1995
|
+
get: /**
|
|
1996
|
+
* @return {?}
|
|
1997
|
+
*/
|
|
1998
|
+
function () {
|
|
1999
|
+
return this._boundsModel.readonly;
|
|
2000
|
+
},
|
|
2001
|
+
enumerable: true,
|
|
2002
|
+
configurable: true
|
|
2003
|
+
});
|
|
2004
|
+
Object.defineProperty(ResizeAwareComponent.prototype, "nativeElement", {
|
|
2005
|
+
get: /**
|
|
2006
|
+
* @return {?}
|
|
2007
|
+
*/
|
|
2008
|
+
function () {
|
|
2009
|
+
return this.elementRef.nativeElement;
|
|
2010
|
+
},
|
|
2011
|
+
enumerable: true,
|
|
2012
|
+
configurable: true
|
|
2013
|
+
});
|
|
2014
|
+
// TODO: Make this handle body scroll
|
|
2015
|
+
// TODO: Make this handle body scroll
|
|
2016
|
+
/**
|
|
2017
|
+
* @param {?} point
|
|
2018
|
+
* @return {?}
|
|
2019
|
+
*/
|
|
2020
|
+
ResizeAwareComponent.prototype.relativePositionOf =
|
|
2021
|
+
// TODO: Make this handle body scroll
|
|
2022
|
+
/**
|
|
2023
|
+
* @param {?} point
|
|
2024
|
+
* @return {?}
|
|
2025
|
+
*/
|
|
2026
|
+
function (point) {
|
|
2027
|
+
return this.bounds.relativePositionOf(point);
|
|
2028
|
+
};
|
|
2029
|
+
Object.defineProperty(ResizeAwareComponent.prototype, "bounds", {
|
|
2030
|
+
get: /**
|
|
2031
|
+
* @return {?}
|
|
2032
|
+
*/
|
|
2033
|
+
function () {
|
|
2034
|
+
return this._boundsModel.value;
|
|
2035
|
+
},
|
|
2036
|
+
enumerable: true,
|
|
2037
|
+
configurable: true
|
|
2038
|
+
});
|
|
2039
|
+
/**
|
|
2040
|
+
* @private
|
|
2041
|
+
* @return {?}
|
|
2042
|
+
*/
|
|
2043
|
+
ResizeAwareComponent.prototype.updateBounds = /**
|
|
2044
|
+
* @private
|
|
2045
|
+
* @return {?}
|
|
2046
|
+
*/
|
|
2047
|
+
function () {
|
|
2048
|
+
this._boundsModel.value = Bounds.ofElement(this.nativeElement);
|
|
2049
|
+
};
|
|
2050
|
+
return ResizeAwareComponent;
|
|
2051
|
+
}(DisposableComponent));
|
|
2052
|
+
if (false) {
|
|
2053
|
+
/**
|
|
2054
|
+
* @type {?}
|
|
2055
|
+
* @private
|
|
2056
|
+
*/
|
|
2057
|
+
ResizeAwareComponent.prototype._boundsModel;
|
|
2058
|
+
/**
|
|
2059
|
+
* @type {?}
|
|
2060
|
+
* @protected
|
|
2061
|
+
*/
|
|
2062
|
+
ResizeAwareComponent.prototype.elementRef;
|
|
2063
|
+
/**
|
|
2064
|
+
* @type {?}
|
|
2065
|
+
* @protected
|
|
2066
|
+
*/
|
|
2067
|
+
ResizeAwareComponent.prototype.ngZone;
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
/**
|
|
2071
|
+
* @fileoverview added by tsickle
|
|
2072
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2073
|
+
*/
|
|
2074
|
+
|
|
2075
|
+
/**
|
|
2076
|
+
* @fileoverview added by tsickle
|
|
2077
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2078
|
+
*/
|
|
2079
|
+
|
|
1836
2080
|
/**
|
|
1837
2081
|
* @fileoverview added by tsickle
|
|
1838
2082
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
@@ -2918,5 +3162,5 @@ var ParameterType;
|
|
|
2918
3162
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2919
3163
|
*/
|
|
2920
3164
|
|
|
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,
|
|
3165
|
+
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, InteractionModule as ɵi, ActivityContainerComponent as ɵj, ConfirmationDialogComponent as ɵk, AbstractActivity as ɵl, ACTIVITY_DATA as ɵm, AlertDialogComponent as ɵo, ActivityOutletComponent as ɵq, DialogInteractionService as ɵr, InteractionContext as ɵs, PlaceModule as ɵt, EmptyStateComponent as ɵu, BusyOverlayComponent as ɵv, PlaceOutletComponent as ɵw, PlaceService as ɵx };
|
|
2922
3166
|
//# sourceMappingURL=coolon-angular-ui-powerups.js.map
|