@stemy/ngx-utils 13.4.0 → 13.4.2
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/esm2020/ngx-utils/common-types.mjs +2 -1
- package/esm2020/ngx-utils/ngx-utils.module.mjs +6 -2
- package/esm2020/ngx-utils/plugins/resize-event.plugin.mjs +16 -5
- package/esm2020/public_api.mjs +2 -2
- package/fesm2015/stemy-ngx-utils.mjs +20 -5
- package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
- package/fesm2020/stemy-ngx-utils.mjs +19 -5
- package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +2 -0
- package/ngx-utils/plugins/resize-event.plugin.d.ts +3 -2
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
|
@@ -432,6 +432,7 @@ const CONFIG_SERVICE = new InjectionToken("config-service");
|
|
|
432
432
|
const BASE_CONFIG = new InjectionToken("base-config");
|
|
433
433
|
const SCRIPT_PARAMS = new InjectionToken("script-params");
|
|
434
434
|
const ROOT_ELEMENT = new InjectionToken("app-root-element");
|
|
435
|
+
const RESIZE_DELAY = new InjectionToken("resize-event-delay");
|
|
435
436
|
const ERROR_HANDLER = new InjectionToken("error-handler-callback");
|
|
436
437
|
const GLOBAL_TEMPLATES = new InjectionToken("global-templates");
|
|
437
438
|
// --- Valued promise ---
|
|
@@ -3526,8 +3527,9 @@ const detector = elementResizeDetectorMaker({
|
|
|
3526
3527
|
strategy: "scroll" // For ultra performance.
|
|
3527
3528
|
});
|
|
3528
3529
|
class ResizeEventPlugin extends ɵDomEventsPlugin {
|
|
3529
|
-
constructor(doc, universal) {
|
|
3530
|
+
constructor(doc, resizeDelay, universal) {
|
|
3530
3531
|
super(doc);
|
|
3532
|
+
this.resizeDelay = resizeDelay;
|
|
3531
3533
|
this.universal = universal;
|
|
3532
3534
|
}
|
|
3533
3535
|
supports(eventName) {
|
|
@@ -3538,9 +3540,11 @@ class ResizeEventPlugin extends ɵDomEventsPlugin {
|
|
|
3538
3540
|
return zone.runOutsideAngular(() => {
|
|
3539
3541
|
if (this.universal.isServer)
|
|
3540
3542
|
return emptyRemove$1;
|
|
3543
|
+
const timer = TimerUtils.createTimeout();
|
|
3541
3544
|
const cb = el => {
|
|
3542
|
-
|
|
3543
|
-
|
|
3545
|
+
timer.set(() => {
|
|
3546
|
+
zone.run(() => handler(el));
|
|
3547
|
+
}, this.resizeDelay);
|
|
3544
3548
|
};
|
|
3545
3549
|
if (isWindow(element)) {
|
|
3546
3550
|
element.addEventListener(eventName, cb);
|
|
@@ -3559,18 +3563,24 @@ class ResizeEventPlugin extends ɵDomEventsPlugin {
|
|
|
3559
3563
|
}
|
|
3560
3564
|
catch (e) {
|
|
3561
3565
|
}
|
|
3566
|
+
finally {
|
|
3567
|
+
timer.clear();
|
|
3568
|
+
}
|
|
3562
3569
|
};
|
|
3563
3570
|
});
|
|
3564
3571
|
}
|
|
3565
3572
|
}
|
|
3566
3573
|
ResizeEventPlugin.EVENT_NAME = "resize";
|
|
3567
|
-
ResizeEventPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ResizeEventPlugin, deps: [{ token: DOCUMENT }, { token: UniversalService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3574
|
+
ResizeEventPlugin.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ResizeEventPlugin, deps: [{ token: DOCUMENT }, { token: RESIZE_DELAY }, { token: UniversalService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3568
3575
|
ResizeEventPlugin.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ResizeEventPlugin });
|
|
3569
3576
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: ResizeEventPlugin, decorators: [{
|
|
3570
3577
|
type: Injectable
|
|
3571
3578
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
3572
3579
|
type: Inject,
|
|
3573
3580
|
args: [DOCUMENT]
|
|
3581
|
+
}] }, { type: undefined, decorators: [{
|
|
3582
|
+
type: Inject,
|
|
3583
|
+
args: [RESIZE_DELAY]
|
|
3574
3584
|
}] }, { type: UniversalService }]; } });
|
|
3575
3585
|
|
|
3576
3586
|
function emptyRemove() {
|
|
@@ -5567,6 +5577,10 @@ class NgxUtilsModule {
|
|
|
5567
5577
|
provide: ROOT_ELEMENT,
|
|
5568
5578
|
useValue: null
|
|
5569
5579
|
},
|
|
5580
|
+
{
|
|
5581
|
+
provide: RESIZE_DELAY,
|
|
5582
|
+
useValue: (!config ? null : config.resizeDelay) ?? 200,
|
|
5583
|
+
},
|
|
5570
5584
|
{
|
|
5571
5585
|
provide: APP_INITIALIZER,
|
|
5572
5586
|
useFactory: (!config ? null : config.initializeApp) || loadConfig,
|
|
@@ -5615,5 +5629,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
5615
5629
|
* Generated bundle index. Do not edit.
|
|
5616
5630
|
*/
|
|
5617
5631
|
|
|
5618
|
-
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService };
|
|
5632
|
+
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService };
|
|
5619
5633
|
//# sourceMappingURL=stemy-ngx-utils.mjs.map
|