@stemy/ngx-utils 19.5.20 → 19.5.22
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 +76 -22
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/directives/async-method.base.d.ts +2 -2
- package/ngx-utils/ngx-utils.imports.d.ts +1 -1
- package/ngx-utils/utils/misc.d.ts +1 -0
- package/ngx-utils/utils/signal-utils.d.ts +36 -0
- package/package.json +1 -1
- package/public_api.d.ts +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectorRef, ElementRef, OnChanges
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, OnChanges } from "@angular/core";
|
|
2
2
|
import { AsyncMethod, IAsyncMessage } from "../common-types";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class AsyncMethodBase implements OnChanges {
|
|
@@ -8,10 +8,10 @@ export declare class AsyncMethodBase implements OnChanges {
|
|
|
8
8
|
readonly onError: import("@angular/core").OutputEmitterRef<IAsyncMessage>;
|
|
9
9
|
readonly toaster: import("../common-types").IToasterService;
|
|
10
10
|
readonly cdr: ChangeDetectorRef;
|
|
11
|
-
readonly renderer: Renderer2;
|
|
12
11
|
readonly element: ElementRef<HTMLElement>;
|
|
13
12
|
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
14
13
|
readonly target: import("@angular/core").WritableSignal<HTMLElement>;
|
|
14
|
+
readonly previousTarget: import("@angular/core").Signal<HTMLElement>;
|
|
15
15
|
constructor();
|
|
16
16
|
protected getMethod(): AsyncMethod;
|
|
17
17
|
ngOnChanges(): void;
|
|
@@ -67,7 +67,7 @@ import { UploadComponent } from "./components/upload/upload.component";
|
|
|
67
67
|
export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
|
|
68
68
|
export declare const directives: (typeof AsyncMethodBase | typeof AsyncMethodTargetDirective | typeof BackgroundDirective | typeof ComponentLoaderDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof StickyClassDirective | typeof DropdownDirective | typeof DropdownContentDirective | typeof TabsItemDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
|
|
69
69
|
export declare const components: (typeof ChipsComponent | typeof DropListComponent | typeof DynamicTableComponent | typeof FakeModuleComponent | typeof InteractiveCanvasComponent | typeof InteractiveCircleComponent | typeof InteractiveRectComponent | typeof PaginationMenuComponent | typeof UnorderedListComponent | typeof UploadComponent)[];
|
|
70
|
-
export declare const providers: (typeof
|
|
70
|
+
export declare const providers: (typeof BaseHttpService | typeof BaseHttpClient | typeof StorageService | typeof UniversalService | typeof StateService | typeof AuthGuard | typeof WasmService | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof BaseToasterService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof PromiseService | typeof SocketService | typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof DeviceDetectorService | {
|
|
71
71
|
provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
|
|
72
72
|
useClass: typeof DragDropEventPlugin;
|
|
73
73
|
multi: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Type, ValueProvider, ɵComponentDef as ComponentDef } from "@angular/core";
|
|
2
2
|
import { CssSelector, CssSelectorList } from "../common-types";
|
|
3
|
+
export declare function switchClass(elem: HTMLElement, className: string, status?: boolean): void;
|
|
3
4
|
export declare function getCssVariables(elem: HTMLElement): Record<string, string>;
|
|
4
5
|
export declare function checkTransitions(el: HTMLElement, cb: () => any): void;
|
|
5
6
|
export declare function getComponentDef<T>(type: Type<T>): ComponentDef<T>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type Signal } from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a signal that emits the previous value of the given signal.
|
|
4
|
+
* The first time the signal is emitted, the previous value will be the same as the current value.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* const value = signal(0);
|
|
9
|
+
* const previous = computedPrevious(value);
|
|
10
|
+
*
|
|
11
|
+
* effect(() => {
|
|
12
|
+
* console.log("Current value:", value());
|
|
13
|
+
* console.log("Previous value:", previous());
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* Logs:
|
|
17
|
+
* // Current value: 0
|
|
18
|
+
* // Previous value: 0
|
|
19
|
+
*
|
|
20
|
+
* value.set(1);
|
|
21
|
+
*
|
|
22
|
+
* Logs:
|
|
23
|
+
* // Current value: 1
|
|
24
|
+
* // Previous value: 0
|
|
25
|
+
*
|
|
26
|
+
* value.set(2);
|
|
27
|
+
*
|
|
28
|
+
* Logs:
|
|
29
|
+
* // Current value: 2
|
|
30
|
+
* // Previous value: 1
|
|
31
|
+
*```
|
|
32
|
+
*
|
|
33
|
+
* @param s Signal to compute previous value for
|
|
34
|
+
* @returns Signal that emits previous value of `s`
|
|
35
|
+
*/
|
|
36
|
+
export declare function computedPrevious<T>(s: Signal<T>): Signal<T>;
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -18,12 +18,13 @@ export { JSONfn } from "./ngx-utils/utils/jsonfn";
|
|
|
18
18
|
export { ReflectUtils } from "./ngx-utils/utils/reflect.utils";
|
|
19
19
|
export { LoaderUtils } from "./ngx-utils/utils/loader.utils";
|
|
20
20
|
export { MathUtils } from "./ngx-utils/utils/math.utils";
|
|
21
|
-
export { checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents } from "./ngx-utils/utils/misc";
|
|
21
|
+
export { switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents } from "./ngx-utils/utils/misc";
|
|
22
22
|
export { ObjectUtils } from "./ngx-utils/utils/object.utils";
|
|
23
23
|
export { ObservableUtils, ISubscriberInfo } from "./ngx-utils/utils/observable.utils";
|
|
24
24
|
export { CancelablePromise, cancelablePromise, impatientPromise } from "./ngx-utils/utils/promise.utils";
|
|
25
25
|
export { StringUtils, hashCode } from "./ngx-utils/utils/string.utils";
|
|
26
26
|
export { SetUtils } from "./ngx-utils/utils/set.utils";
|
|
27
|
+
export { computedPrevious } from "./ngx-utils/utils/signal-utils";
|
|
27
28
|
export { SocketFactory, SocketData, SocketDataValue, SocketDataObj, SocketClient } from "./ngx-utils/utils/socket-client";
|
|
28
29
|
export { TimerUtils } from "./ngx-utils/utils/timer.utils";
|
|
29
30
|
export { UniqueUtils } from "./ngx-utils/utils/unique.utils";
|