@stemy/ngx-utils 19.9.25 → 19.9.26
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/fesm2022/stemy-ngx-utils.mjs +54 -32
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +1 -1
- package/ngx-utils/components/btn/btn.component.d.ts +2 -2
- package/ngx-utils/components/tabs/tabs.component.d.ts +2 -4
- package/ngx-utils/ngx-utils.imports.d.ts +3 -2
- package/ngx-utils/services/href-serializer.d.ts +15 -0
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
|
@@ -3,11 +3,11 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
import { InjectionToken, runInInjectionContext, PLATFORM_ID, Inject, Injectable, Optional, inject, Injector, untracked, computed, signal, DestroyRef, isDevMode, ErrorHandler, EventEmitter, createComponent, NgZone, Pipe, input, output, ChangeDetectorRef, ElementRef, effect, HostListener, Directive, Input, HostBinding, Output, TemplateRef, ChangeDetectionStrategy, ViewEncapsulation, Component, ViewChild, forwardRef, ContentChild, contentChild, contentChildren, Renderer2, model, ContentChildren, provideAppInitializer, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
4
4
|
import 'reflect-metadata';
|
|
5
5
|
import * as i2 from '@angular/router';
|
|
6
|
-
import { ActivatedRouteSnapshot, Scroll, NavigationEnd, Router, DefaultUrlSerializer,
|
|
6
|
+
import { ActivatedRouteSnapshot, Scroll, NavigationEnd, UrlTree, Router, DefaultUrlSerializer, UrlSegmentGroup, UrlSegment, UrlSerializer, ROUTES } from '@angular/router';
|
|
7
7
|
import { BehaviorSubject, Observable, firstValueFrom, isObservable, Subject, Subscription, from, delay, timer, TimeoutError, combineLatest, of, lastValueFrom } from 'rxjs';
|
|
8
8
|
import { skipWhile, debounceTime, distinctUntilChanged, map, filter, mergeMap, takeUntil, timeout } from 'rxjs/operators';
|
|
9
9
|
import * as i1$3 from '@angular/common';
|
|
10
|
-
import { isPlatformBrowser, isPlatformServer, DOCUMENT, AsyncPipe,
|
|
10
|
+
import { isPlatformBrowser, isPlatformServer, APP_BASE_HREF, DOCUMENT, AsyncPipe, CommonModule } from '@angular/common';
|
|
11
11
|
import * as i1 from 'ngx-device-detector';
|
|
12
12
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
13
13
|
import { DateTime } from 'luxon';
|
|
@@ -3639,9 +3639,16 @@ class BaseHttpService {
|
|
|
3639
3639
|
return new Promise(resolve => {
|
|
3640
3640
|
this.getPromise(url, options).then(data => {
|
|
3641
3641
|
if (ObjectUtils.isArray(data)) {
|
|
3642
|
+
const params = options?.params ?? {};
|
|
3643
|
+
const limit = isNaN(params.limit) || Number(params.limit) <= 0
|
|
3644
|
+
? Number.MAX_SAFE_INTEGER
|
|
3645
|
+
: Number(params.limit);
|
|
3646
|
+
const page = Math.max(Number(params.page), 0);
|
|
3647
|
+
const start = Math.max(page * limit, 0);
|
|
3648
|
+
const end = Math.min(start + limit, data.length - 1);
|
|
3642
3649
|
resolve({
|
|
3643
3650
|
total: data.length,
|
|
3644
|
-
items: data,
|
|
3651
|
+
items: data.slice(start, end),
|
|
3645
3652
|
meta: {}
|
|
3646
3653
|
});
|
|
3647
3654
|
return;
|
|
@@ -4261,6 +4268,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
4261
4268
|
type: Injectable
|
|
4262
4269
|
}], ctorParameters: () => [] });
|
|
4263
4270
|
|
|
4271
|
+
class HrefSerializer {
|
|
4272
|
+
get count() {
|
|
4273
|
+
return this.promiseCount;
|
|
4274
|
+
}
|
|
4275
|
+
get onChanged() {
|
|
4276
|
+
return this.promiseChanged;
|
|
4277
|
+
}
|
|
4278
|
+
constructor(baseHref, urlSerializer) {
|
|
4279
|
+
this.baseHref = baseHref;
|
|
4280
|
+
this.urlSerializer = urlSerializer;
|
|
4281
|
+
this.promiseCount = 0;
|
|
4282
|
+
this.promiseChanged = new EventEmitter();
|
|
4283
|
+
}
|
|
4284
|
+
serialize(url) {
|
|
4285
|
+
const serialized = url instanceof UrlTree
|
|
4286
|
+
? this.urlSerializer.serialize(url)
|
|
4287
|
+
: (url != null ? url : null);
|
|
4288
|
+
return serialized && serialized.startsWith("/") && !serialized.startsWith(this.baseHref)
|
|
4289
|
+
? `${this.baseHref}${serialized}`.replace(/\/\/$/, "/")
|
|
4290
|
+
: serialized;
|
|
4291
|
+
}
|
|
4292
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: HrefSerializer, deps: [{ token: APP_BASE_HREF }, { token: i2.UrlSerializer }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4293
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: HrefSerializer }); }
|
|
4294
|
+
}
|
|
4295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: HrefSerializer, decorators: [{
|
|
4296
|
+
type: Injectable
|
|
4297
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
4298
|
+
type: Inject,
|
|
4299
|
+
args: [APP_BASE_HREF]
|
|
4300
|
+
}] }, { type: i2.UrlSerializer }] });
|
|
4301
|
+
|
|
4264
4302
|
class LocalHttpService extends BaseHttpService {
|
|
4265
4303
|
get name() {
|
|
4266
4304
|
return "local-http";
|
|
@@ -6267,7 +6305,13 @@ class AsyncMethodBase {
|
|
|
6267
6305
|
return true;
|
|
6268
6306
|
}
|
|
6269
6307
|
handleClick(ev) {
|
|
6270
|
-
ev
|
|
6308
|
+
if (ev) {
|
|
6309
|
+
// If it's a new tab action then we dont handle the click
|
|
6310
|
+
if (ev.ctrlKey || ev.metaKey || ev.button === 1) {
|
|
6311
|
+
return true;
|
|
6312
|
+
}
|
|
6313
|
+
ev.preventDefault();
|
|
6314
|
+
}
|
|
6271
6315
|
if (this.disabled())
|
|
6272
6316
|
return true;
|
|
6273
6317
|
this.callMethod(ev);
|
|
@@ -7440,22 +7484,13 @@ class BtnComponent {
|
|
|
7440
7484
|
contains(target) {
|
|
7441
7485
|
return !(target instanceof HTMLElement) || this.element.nativeElement?.contains(target);
|
|
7442
7486
|
}
|
|
7443
|
-
onBtnClick(event) {
|
|
7444
|
-
const isNewTabAction = event.ctrlKey || event.metaKey || event.button === 1;
|
|
7445
|
-
if (!isNewTabAction) {
|
|
7446
|
-
event.preventDefault();
|
|
7447
|
-
}
|
|
7448
|
-
}
|
|
7449
7487
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: BtnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7450
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.19", type: BtnComponent, isStandalone: false, selector: "btn", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } },
|
|
7488
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.19", type: BtnComponent, isStandalone: false, selector: "btn", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-container [ngComponentOutlet]=\"buttonType\"\r\n [ngComponentOutletInputs]=\"$any(buttonProps())\"></ng-container>\r\n", dependencies: [{ kind: "directive", type: i1$3.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
7451
7489
|
}
|
|
7452
7490
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImport: i0, type: BtnComponent, decorators: [{
|
|
7453
7491
|
type: Component,
|
|
7454
7492
|
args: [{ standalone: false, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, selector: "btn", template: "<ng-container [ngComponentOutlet]=\"buttonType\"\r\n [ngComponentOutletInputs]=\"$any(buttonProps())\"></ng-container>\r\n" }]
|
|
7455
|
-
}]
|
|
7456
|
-
type: HostListener,
|
|
7457
|
-
args: ["click", ["$event"]]
|
|
7458
|
-
}] } });
|
|
7493
|
+
}] });
|
|
7459
7494
|
|
|
7460
7495
|
class IconComponent {
|
|
7461
7496
|
constructor() {
|
|
@@ -9114,7 +9149,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
9114
9149
|
|
|
9115
9150
|
class TabsComponent {
|
|
9116
9151
|
constructor() {
|
|
9117
|
-
this.urlSerializer = inject(UrlSerializer);
|
|
9118
9152
|
this.router = inject(Router);
|
|
9119
9153
|
this.value = model();
|
|
9120
9154
|
this.options = input([]);
|
|
@@ -9127,16 +9161,7 @@ class TabsComponent {
|
|
|
9127
9161
|
this.template = signal(null);
|
|
9128
9162
|
this.tabs = computed(() => {
|
|
9129
9163
|
const options = (this.options() || [])
|
|
9130
|
-
.filter(option => ObjectUtils.isStringWithValue(option?.label))
|
|
9131
|
-
.map(option => {
|
|
9132
|
-
const path = !option.path
|
|
9133
|
-
? null
|
|
9134
|
-
: (option.path instanceof UrlTree ? this.urlSerializer.serialize(option.path) : option.path);
|
|
9135
|
-
return {
|
|
9136
|
-
...option,
|
|
9137
|
-
path
|
|
9138
|
-
};
|
|
9139
|
-
});
|
|
9164
|
+
.filter(option => ObjectUtils.isStringWithValue(option?.label));
|
|
9140
9165
|
const current = this.value();
|
|
9141
9166
|
this.tabItems().forEach(item => {
|
|
9142
9167
|
const value = item.value();
|
|
@@ -9146,7 +9171,6 @@ class TabsComponent {
|
|
|
9146
9171
|
const label = item.label();
|
|
9147
9172
|
if (!label)
|
|
9148
9173
|
return;
|
|
9149
|
-
const path = item.path();
|
|
9150
9174
|
options.push({
|
|
9151
9175
|
value,
|
|
9152
9176
|
label,
|
|
@@ -9154,9 +9178,7 @@ class TabsComponent {
|
|
|
9154
9178
|
tooltip: item.tooltip(),
|
|
9155
9179
|
icon: item.icon(),
|
|
9156
9180
|
disabled: item.disabled(),
|
|
9157
|
-
path:
|
|
9158
|
-
? null
|
|
9159
|
-
: (path instanceof UrlTree ? this.urlSerializer.serialize(path) : path),
|
|
9181
|
+
path: item.path(),
|
|
9160
9182
|
template: item.template
|
|
9161
9183
|
});
|
|
9162
9184
|
});
|
|
@@ -9684,6 +9706,7 @@ const providers = [
|
|
|
9684
9706
|
EventsService,
|
|
9685
9707
|
FormatterService,
|
|
9686
9708
|
GlobalTemplateService,
|
|
9709
|
+
HrefSerializer,
|
|
9687
9710
|
IconService,
|
|
9688
9711
|
LanguageService,
|
|
9689
9712
|
LocalHttpService,
|
|
@@ -9699,7 +9722,6 @@ const providers = [
|
|
|
9699
9722
|
TranslatedUrlSerializer,
|
|
9700
9723
|
UniversalService,
|
|
9701
9724
|
DeviceDetectorService,
|
|
9702
|
-
GlobalTemplateService,
|
|
9703
9725
|
{
|
|
9704
9726
|
provide: EVENT_MANAGER_PLUGINS,
|
|
9705
9727
|
useClass: DragDropEventPlugin,
|
|
@@ -9929,5 +9951,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.19", ngImpo
|
|
|
9929
9951
|
* Generated bundle index. Do not edit.
|
|
9930
9952
|
*/
|
|
9931
9953
|
|
|
9932
|
-
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AsyncMethodTargetDirective, AuthGuard, BASE_CONFIG, BUTTON_TYPE, BackgroundDirective, BaseDialogService, BaseHttpClient, BaseHttpService, BaseToasterService, BtnComponent, BtnDefaultComponent, CONFIG_SERVICE, CacheService, CanvasColor, CanvasUtils, ChipsComponent, ChunkPipe, Circle, CloseBtnComponent, ComponentLoaderDirective, ComponentLoaderService, ConfigService, DIALOG_SERVICE, DateUtils, DragDropEventPlugin, DropListComponent, DropdownBoxComponent, DropdownContentDirective, DropdownDirective, DropdownToggleDirective, DynamicTableCellComponent, DynamicTableComponent, DynamicTableTemplateDirective, EPSILON, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, Enum, ErrorHandlerService, EventsService, ExclusionsRenderer, ExtraItemPropertiesPipe, FactoryDependencies, FakeModuleComponent, FileSystemEntry, FileUtils, FilterPipe, FindPipe, ForbiddenZone, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GetValuePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HitZoneRenderer, ICON_MAP, ICON_SERVICE, ICON_TYPE, IConfiguration, IconComponent, IconDefaultComponent, IconDirective, IconService, IncludesPipe, Initializer, InteractiveCanvasComponent, InteractiveCircleComponent, InteractiveItemComponent, InteractiveRectComponent, IsTypePipe, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, Oval, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, RequestBag, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, RulerCanvasRenderer, SCHEMA_SELECTOR, SCRIPT_PARAMS, STATIC_SCHEMAS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShapeGroup, ShiftPipe, SocketClient, SocketService, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, SyncAsyncPipe, TOASTER_SERVICE, TabsComponent, TabsItemDirective, TabsTemplateDirective, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UploadComponent, ValuedPromise, ValuesPipe, WysiwygComponent, addPts, cachedFactory, cancelablePromise, checkTransitions, clamp, computedPrevious, createTypedProvider, cssStyles, cssVariables, diffEntities, distance, distanceSq, dividePts, dotProduct, ensurePoint, eqPts, getComponentDef, getCssVariables, getRoot, impatientPromise, injectOptions, isBrowser, isEqual, isPoint, isZero, lengthOfPt, lengthSq$1 as lengthSq, lerpPts, md5, multiplyPts, negatePt, normalizePt, normalizeRange, overflow, parseSelector, perpendicular, promiseTimeout, provideEntryComponents, provideOptions, provideWithOptions, rotateDeg, rotateRad, scalePt, selectorMatchesList, stringify, subPts, svgToDataUri, switchClass, toDegrees, toRadians, tripleProduct };
|
|
9954
|
+
export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AsyncMethodTargetDirective, AuthGuard, BASE_CONFIG, BUTTON_TYPE, BackgroundDirective, BaseDialogService, BaseHttpClient, BaseHttpService, BaseToasterService, BtnComponent, BtnDefaultComponent, CONFIG_SERVICE, CacheService, CanvasColor, CanvasUtils, ChipsComponent, ChunkPipe, Circle, CloseBtnComponent, ComponentLoaderDirective, ComponentLoaderService, ConfigService, DIALOG_SERVICE, DateUtils, DragDropEventPlugin, DropListComponent, DropdownBoxComponent, DropdownContentDirective, DropdownDirective, DropdownToggleDirective, DynamicTableCellComponent, DynamicTableComponent, DynamicTableTemplateDirective, EPSILON, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, Enum, ErrorHandlerService, EventsService, ExclusionsRenderer, ExtraItemPropertiesPipe, FactoryDependencies, FakeModuleComponent, FileSystemEntry, FileUtils, FilterPipe, FindPipe, ForbiddenZone, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GetValuePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HitZoneRenderer, HrefSerializer, ICON_MAP, ICON_SERVICE, ICON_TYPE, IConfiguration, IconComponent, IconDefaultComponent, IconDirective, IconService, IncludesPipe, Initializer, InteractiveCanvasComponent, InteractiveCircleComponent, InteractiveItemComponent, InteractiveRectComponent, IsTypePipe, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, Oval, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, RequestBag, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, RulerCanvasRenderer, SCHEMA_SELECTOR, SCRIPT_PARAMS, STATIC_SCHEMAS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShapeGroup, ShiftPipe, SocketClient, SocketService, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, SyncAsyncPipe, TOASTER_SERVICE, TabsComponent, TabsItemDirective, TabsTemplateDirective, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UploadComponent, ValuedPromise, ValuesPipe, WysiwygComponent, addPts, cachedFactory, cancelablePromise, checkTransitions, clamp, computedPrevious, createTypedProvider, cssStyles, cssVariables, diffEntities, distance, distanceSq, dividePts, dotProduct, ensurePoint, eqPts, getComponentDef, getCssVariables, getRoot, impatientPromise, injectOptions, isBrowser, isEqual, isPoint, isZero, lengthOfPt, lengthSq$1 as lengthSq, lerpPts, md5, multiplyPts, negatePt, normalizePt, normalizeRange, overflow, parseSelector, perpendicular, promiseTimeout, provideEntryComponents, provideOptions, provideWithOptions, rotateDeg, rotateRad, scalePt, selectorMatchesList, stringify, subPts, svgToDataUri, switchClass, toDegrees, toRadians, tripleProduct };
|
|
9933
9955
|
//# sourceMappingURL=stemy-ngx-utils.mjs.map
|