@kuzntsv/uikit 1.0.43 → 1.0.44
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.
|
@@ -2295,9 +2295,6 @@ var BasePageClass = class BasePageClass {
|
|
|
2295
2295
|
this.loadData$.next(null);
|
|
2296
2296
|
this.loadLength$.next(null);
|
|
2297
2297
|
}
|
|
2298
|
-
entityFactory(type) {
|
|
2299
|
-
return new type();
|
|
2300
|
-
}
|
|
2301
2298
|
onSelectionChange(selected) {
|
|
2302
2299
|
this.selected = selected;
|
|
2303
2300
|
this.editBtnDisabledUpdate(this.selected);
|
|
@@ -2856,9 +2853,6 @@ var BaseSignalPageClass = class BaseSignalPageClass {
|
|
|
2856
2853
|
sortDirection: sortState.sortDirection
|
|
2857
2854
|
}));
|
|
2858
2855
|
}
|
|
2859
|
-
entityFactory(type) {
|
|
2860
|
-
return new type();
|
|
2861
|
-
}
|
|
2862
2856
|
onSelectionChange(selected) {
|
|
2863
2857
|
this.selected = selected;
|
|
2864
2858
|
this.editBtnDisabledUpdate(this.selected);
|
|
@@ -3102,10 +3096,15 @@ var BaseSignalServiceClass = class BaseSignalServiceClass {
|
|
|
3102
3096
|
const idSignal = typeof id === "function" ? id : () => id;
|
|
3103
3097
|
return httpResource(() => {
|
|
3104
3098
|
this._refreshTrigger();
|
|
3105
|
-
|
|
3099
|
+
const currentId = idSignal();
|
|
3100
|
+
if (currentId === null || currentId === void 0) return;
|
|
3101
|
+
return { url: `${this.baseRoute}${currentId}` };
|
|
3106
3102
|
}, {
|
|
3107
3103
|
...this.getHttpContext(),
|
|
3108
|
-
parse: (data) =>
|
|
3104
|
+
parse: (data) => {
|
|
3105
|
+
if (!data) return null;
|
|
3106
|
+
return this.schema.parse(data);
|
|
3107
|
+
}
|
|
3109
3108
|
});
|
|
3110
3109
|
}
|
|
3111
3110
|
getCount() {
|
|
@@ -3114,7 +3113,7 @@ var BaseSignalServiceClass = class BaseSignalServiceClass {
|
|
|
3114
3113
|
return { url: `${this.baseRoute}${this.countRoute}` };
|
|
3115
3114
|
}, {
|
|
3116
3115
|
...this.getHttpContext(),
|
|
3117
|
-
parse: (data) =>
|
|
3116
|
+
parse: (data) => z.coerce.number().parse(data)
|
|
3118
3117
|
});
|
|
3119
3118
|
}
|
|
3120
3119
|
getObjectsByPaging(pageIndex, pageSize, sortColumn, direction) {
|
|
@@ -3131,35 +3130,18 @@ var BaseSignalServiceClass = class BaseSignalServiceClass {
|
|
|
3131
3130
|
};
|
|
3132
3131
|
}, {
|
|
3133
3132
|
...this.getHttpContext(),
|
|
3134
|
-
parse: (data) =>
|
|
3133
|
+
parse: (data) => {
|
|
3134
|
+
if (!data) return [];
|
|
3135
|
+
return z.array(this.schema).parse(data);
|
|
3136
|
+
}
|
|
3135
3137
|
});
|
|
3136
3138
|
}
|
|
3137
3139
|
newObject(entity) {
|
|
3138
3140
|
return this.http.post(this.baseRoute, entity, this.getHttpContext());
|
|
3139
3141
|
}
|
|
3140
|
-
create(dto) {
|
|
3141
|
-
return httpResource(() => ({
|
|
3142
|
-
url: this.baseRoute,
|
|
3143
|
-
method: "POST",
|
|
3144
|
-
body: dto
|
|
3145
|
-
}), {
|
|
3146
|
-
...this.getHttpContext(),
|
|
3147
|
-
parse: (data) => this.schema.parse(data)
|
|
3148
|
-
});
|
|
3149
|
-
}
|
|
3150
3142
|
editObject(entity) {
|
|
3151
3143
|
return this.http.put(this.baseRoute + entity.id, entity, this.getHttpContext());
|
|
3152
3144
|
}
|
|
3153
|
-
update(id, dto) {
|
|
3154
|
-
return httpResource(() => ({
|
|
3155
|
-
url: `${this.baseRoute}/${id}`,
|
|
3156
|
-
method: "PUT",
|
|
3157
|
-
body: dto
|
|
3158
|
-
}), {
|
|
3159
|
-
...this.getHttpContext(),
|
|
3160
|
-
parse: (data) => this.schema.parse(data)
|
|
3161
|
-
});
|
|
3162
|
-
}
|
|
3163
3145
|
deleteObject(entity) {
|
|
3164
3146
|
return this.http.delete(this.baseRoute + entity.id, this.getHttpContext()).pipe(tap(() => this.refresh()));
|
|
3165
3147
|
}
|