tickera-angular-components 0.0.1-dev.195 → 0.0.1-dev.196
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.
|
@@ -3224,22 +3224,17 @@ class PriceZoneService {
|
|
|
3224
3224
|
constructor(apiService) {
|
|
3225
3225
|
this.apiService = apiService;
|
|
3226
3226
|
}
|
|
3227
|
-
fetchPriceZones(
|
|
3228
|
-
const queryParams =
|
|
3229
|
-
if (
|
|
3230
|
-
queryParams.append('
|
|
3231
|
-
|
|
3232
|
-
queryParams.append('page', page.toString());
|
|
3233
|
-
if (search)
|
|
3234
|
-
queryParams.append('search', search);
|
|
3235
|
-
if (limit)
|
|
3236
|
-
queryParams.append('limit', limit.toString());
|
|
3227
|
+
fetchPriceZones(params = {}) {
|
|
3228
|
+
const queryParams = transformUrlParams(params);
|
|
3229
|
+
if (params.show_ids?.length) {
|
|
3230
|
+
params.show_ids.forEach((showId) => queryParams.append('show_ids', showId.toString()));
|
|
3231
|
+
}
|
|
3237
3232
|
const queryString = queryParams.toString();
|
|
3238
3233
|
const apiRoute = `${PRICE_ZONES_API_ROUTES.FIND_ALL}${queryString ? '?' + queryString : ''}`;
|
|
3239
3234
|
return this.apiService.get(apiRoute);
|
|
3240
3235
|
}
|
|
3241
|
-
loadPriceZones(
|
|
3242
|
-
this.fetchPriceZones(
|
|
3236
|
+
loadPriceZones(params = {}) {
|
|
3237
|
+
this.fetchPriceZones(params).subscribe({
|
|
3243
3238
|
next: ({ data }) => {
|
|
3244
3239
|
this.priceZonesSubject.next(data?.price_zones ?? []);
|
|
3245
3240
|
},
|
|
@@ -9279,6 +9274,7 @@ class PriceZoneSelectComponent {
|
|
|
9279
9274
|
showError = true;
|
|
9280
9275
|
customClass = '';
|
|
9281
9276
|
control = null;
|
|
9277
|
+
showIds = [];
|
|
9282
9278
|
priceZoneChange = new EventEmitter();
|
|
9283
9279
|
priceZones = signal([], ...(ngDevMode ? [{ debugName: "priceZones" }] : []));
|
|
9284
9280
|
loading = signal(false, ...(ngDevMode ? [{ debugName: "loading" }] : []));
|
|
@@ -9294,7 +9290,10 @@ class PriceZoneSelectComponent {
|
|
|
9294
9290
|
}
|
|
9295
9291
|
ngOnInit() {
|
|
9296
9292
|
if (isPlatformBrowser(this.platformId)) {
|
|
9297
|
-
this.priceZoneService.loadPriceZones({
|
|
9293
|
+
this.priceZoneService.loadPriceZones({
|
|
9294
|
+
search: this.searchTerm,
|
|
9295
|
+
show_ids: this.showIds,
|
|
9296
|
+
});
|
|
9298
9297
|
this.priceZoneService.priceZones$
|
|
9299
9298
|
.pipe(takeUntil(this.destroy$))
|
|
9300
9299
|
.subscribe((priceZones) => {
|
|
@@ -9308,7 +9307,20 @@ class PriceZoneSelectComponent {
|
|
|
9308
9307
|
.pipe(debounceTime(400), distinctUntilChanged(), takeUntil(this.destroy$))
|
|
9309
9308
|
.subscribe((search) => {
|
|
9310
9309
|
this.searchTerm = search;
|
|
9311
|
-
this.priceZoneService.loadPriceZones({
|
|
9310
|
+
this.priceZoneService.loadPriceZones({
|
|
9311
|
+
search: this.searchTerm,
|
|
9312
|
+
show_ids: this.showIds,
|
|
9313
|
+
});
|
|
9314
|
+
});
|
|
9315
|
+
}
|
|
9316
|
+
}
|
|
9317
|
+
ngOnChanges(changes) {
|
|
9318
|
+
if (changes['showIds'] &&
|
|
9319
|
+
!changes['showIds'].firstChange &&
|
|
9320
|
+
isPlatformBrowser(this.platformId)) {
|
|
9321
|
+
this.priceZoneService.loadPriceZones({
|
|
9322
|
+
search: this.searchTerm,
|
|
9323
|
+
show_ids: this.showIds,
|
|
9312
9324
|
});
|
|
9313
9325
|
}
|
|
9314
9326
|
}
|
|
@@ -9351,7 +9363,7 @@ class PriceZoneSelectComponent {
|
|
|
9351
9363
|
return false;
|
|
9352
9364
|
}
|
|
9353
9365
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PriceZoneSelectComponent, deps: [{ token: PLATFORM_ID }, { token: PriceZoneService }], target: i0.ɵɵFactoryTarget.Component });
|
|
9354
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: PriceZoneSelectComponent, isStandalone: true, selector: "price-zone-select", inputs: { label: "label", placeholder: "placeholder", name: "name", required: "required", readonly: "readonly", showError: "showError", customClass: "customClass", control: "control" }, outputs: { priceZoneChange: "priceZoneChange" }, providers: [
|
|
9366
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.25", type: PriceZoneSelectComponent, isStandalone: true, selector: "price-zone-select", inputs: { label: "label", placeholder: "placeholder", name: "name", required: "required", readonly: "readonly", showError: "showError", customClass: "customClass", control: "control", showIds: "showIds" }, outputs: { priceZoneChange: "priceZoneChange" }, providers: [
|
|
9355
9367
|
{
|
|
9356
9368
|
provide: NG_VALUE_ACCESSOR,
|
|
9357
9369
|
useExisting: forwardRef(() => PriceZoneSelectComponent),
|
|
@@ -9362,7 +9374,7 @@ class PriceZoneSelectComponent {
|
|
|
9362
9374
|
useExisting: forwardRef(() => PriceZoneSelectComponent),
|
|
9363
9375
|
multi: true,
|
|
9364
9376
|
},
|
|
9365
|
-
], ngImport: i0, template: "<form-select\n [label]=\"label\"\n [placeholder]=\"placeholder\"\n [name]=\"name || 'price_zone_id'\"\n [class]=\"customClass\"\n [options]=\"priceZones()\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [formControl]=\"formControl\"\n (change)=\"onPriceZoneSelected($event)\"\n></form-select>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FormSelectComponent, selector: "form-select", inputs: ["label", "name", "id", "placeholder", "required", "disabled", "readonly", "options", "fieldGroupClass", "showDefaultOption", "defaultOptionLabel"] }] });
|
|
9377
|
+
], usesOnChanges: true, ngImport: i0, template: "<form-select\n [label]=\"label\"\n [placeholder]=\"placeholder\"\n [name]=\"name || 'price_zone_id'\"\n [class]=\"customClass\"\n [options]=\"priceZones()\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [formControl]=\"formControl\"\n (change)=\"onPriceZoneSelected($event)\"\n></form-select>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FormSelectComponent, selector: "form-select", inputs: ["label", "name", "id", "placeholder", "required", "disabled", "readonly", "options", "fieldGroupClass", "showDefaultOption", "defaultOptionLabel"] }] });
|
|
9366
9378
|
}
|
|
9367
9379
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImport: i0, type: PriceZoneSelectComponent, decorators: [{
|
|
9368
9380
|
type: Component,
|
|
@@ -9397,6 +9409,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.25", ngImpo
|
|
|
9397
9409
|
type: Input
|
|
9398
9410
|
}], control: [{
|
|
9399
9411
|
type: Input
|
|
9412
|
+
}], showIds: [{
|
|
9413
|
+
type: Input
|
|
9400
9414
|
}], priceZoneChange: [{
|
|
9401
9415
|
type: Output
|
|
9402
9416
|
}] } });
|