@stemy/ngx-utils 19.8.0 → 19.8.1
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.
|
@@ -5976,6 +5976,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
5976
5976
|
}]
|
|
5977
5977
|
}] });
|
|
5978
5978
|
|
|
5979
|
+
async function defaultMethod() {
|
|
5980
|
+
return null;
|
|
5981
|
+
}
|
|
5979
5982
|
class AsyncMethodBase {
|
|
5980
5983
|
constructor() {
|
|
5981
5984
|
this.disabled = signal(false);
|
|
@@ -6005,25 +6008,18 @@ class AsyncMethodBase {
|
|
|
6005
6008
|
switchClass(previous, "loading", false);
|
|
6006
6009
|
});
|
|
6007
6010
|
}
|
|
6008
|
-
getMethod() {
|
|
6009
|
-
return async () => null;
|
|
6010
|
-
}
|
|
6011
6011
|
ngOnChanges() {
|
|
6012
6012
|
this.cdr.detectChanges();
|
|
6013
6013
|
}
|
|
6014
|
-
|
|
6015
|
-
ev
|
|
6016
|
-
if (this.disabled())
|
|
6017
|
-
return true;
|
|
6018
|
-
this.callMethod(ev);
|
|
6019
|
-
return true;
|
|
6014
|
+
onClick(ev) {
|
|
6015
|
+
return this.handleClick(ev);
|
|
6020
6016
|
}
|
|
6021
6017
|
callMethod(ev) {
|
|
6022
6018
|
if (this.loading())
|
|
6023
6019
|
return true;
|
|
6024
6020
|
this.loading.set(true);
|
|
6025
|
-
const method = this.getMethod();
|
|
6026
|
-
const result =
|
|
6021
|
+
const method = this.getMethod() || defaultMethod;
|
|
6022
|
+
const result = method(...this.getArgs(ev));
|
|
6027
6023
|
if (!(result instanceof Promise)) {
|
|
6028
6024
|
this.loading.set(false);
|
|
6029
6025
|
return false;
|
|
@@ -6047,8 +6043,21 @@ class AsyncMethodBase {
|
|
|
6047
6043
|
});
|
|
6048
6044
|
return true;
|
|
6049
6045
|
}
|
|
6046
|
+
handleClick(ev) {
|
|
6047
|
+
ev?.preventDefault();
|
|
6048
|
+
if (this.disabled())
|
|
6049
|
+
return true;
|
|
6050
|
+
this.callMethod(ev);
|
|
6051
|
+
return true;
|
|
6052
|
+
}
|
|
6053
|
+
getMethod() {
|
|
6054
|
+
return null;
|
|
6055
|
+
}
|
|
6056
|
+
getArgs(ev) {
|
|
6057
|
+
return untracked(() => [this.context(), ev]);
|
|
6058
|
+
}
|
|
6050
6059
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AsyncMethodBase, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6051
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.14", type: AsyncMethodBase, isStandalone: false, selector: "[__asmb__]", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSuccess: "onSuccess", onError: "onError" }, host: { listeners: { "click": "
|
|
6060
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.14", type: AsyncMethodBase, isStandalone: false, selector: "[__asmb__]", inputs: { context: { classPropertyName: "context", publicName: "context", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSuccess: "onSuccess", onError: "onError" }, host: { listeners: { "click": "onClick($event)" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
6052
6061
|
}
|
|
6053
6062
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AsyncMethodBase, decorators: [{
|
|
6054
6063
|
type: Directive,
|
|
@@ -6056,7 +6065,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
6056
6065
|
standalone: false,
|
|
6057
6066
|
selector: "[__asmb__]"
|
|
6058
6067
|
}]
|
|
6059
|
-
}], ctorParameters: () => [], propDecorators: {
|
|
6068
|
+
}], ctorParameters: () => [], propDecorators: { onClick: [{
|
|
6060
6069
|
type: HostListener,
|
|
6061
6070
|
args: ["click", ["$event"]]
|
|
6062
6071
|
}] } });
|
|
@@ -6067,7 +6076,7 @@ class AsyncMethodDirective extends AsyncMethodBase {
|
|
|
6067
6076
|
this.method = input(null, { alias: "async-method" });
|
|
6068
6077
|
}
|
|
6069
6078
|
getMethod() {
|
|
6070
|
-
return this.method();
|
|
6079
|
+
return untracked(() => this.method());
|
|
6071
6080
|
}
|
|
6072
6081
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AsyncMethodDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6073
6082
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.14", type: AsyncMethodDirective, isStandalone: false, selector: "[async-method]", inputs: { method: { classPropertyName: "method", publicName: "async-method", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
@@ -7010,7 +7019,7 @@ class DropdownToggleDirective extends AsyncMethodBase {
|
|
|
7010
7019
|
this.dropdown = inject(DropdownDirective);
|
|
7011
7020
|
}
|
|
7012
7021
|
getMethod() {
|
|
7013
|
-
return this.beforeOpen();
|
|
7022
|
+
return untracked(() => this.beforeOpen());
|
|
7014
7023
|
}
|
|
7015
7024
|
callMethod(ev) {
|
|
7016
7025
|
if (this.dropdown.isOpened) {
|