gunsmith-common 2.1.31 → 2.2.2

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.
Files changed (50) hide show
  1. package/esm2020/notification/notification-bar/notification-bar.component.mjs +3 -3
  2. package/esm2020/public_api.mjs +2 -1
  3. package/esm2020/shared/controls/package-selector/package-selector.component.mjs +168 -0
  4. package/esm2020/shared/services/index.mjs +3 -1
  5. package/esm2020/shared/services/inventory.service.mjs +4 -1
  6. package/esm2020/shared/services/package.service.mjs +47 -0
  7. package/esm2020/shared/services/refinish-code.service.mjs +35 -0
  8. package/esm2020/shared/services/waitlist.service.mjs +4 -1
  9. package/esm2020/shared/services/work-order.service.mjs +35 -1
  10. package/esm2020/shared/shared.module.mjs +28 -7
  11. package/esm2020/shared/types/index.mjs +11 -1
  12. package/esm2020/shared/types/package-item.mjs +3 -0
  13. package/esm2020/shared/types/package-optional-item.mjs +3 -0
  14. package/esm2020/shared/types/package-total.mjs +3 -0
  15. package/esm2020/shared/types/package-variation-option.mjs +3 -0
  16. package/esm2020/shared/types/package-variation.mjs +6 -0
  17. package/esm2020/shared/types/package.mjs +10 -0
  18. package/esm2020/shared/types/refinish-code.mjs +3 -0
  19. package/esm2020/shared/types/waitlist-gun-package-detail.mjs +7 -0
  20. package/esm2020/shared/types/waitlist-gun.mjs +1 -1
  21. package/esm2020/shared/types/work-order-inventory-item.mjs +3 -0
  22. package/esm2020/shared/types/work-order-package-detail.mjs +7 -0
  23. package/esm2020/shared/types/work-order.mjs +1 -1
  24. package/fesm2015/gunsmith-common.mjs +361 -14
  25. package/fesm2015/gunsmith-common.mjs.map +1 -1
  26. package/fesm2020/gunsmith-common.mjs +356 -14
  27. package/fesm2020/gunsmith-common.mjs.map +1 -1
  28. package/package.json +1 -1
  29. package/public_api.d.ts +1 -0
  30. package/shared/controls/package-selector/package-selector.component.d.ts +38 -0
  31. package/shared/services/index.d.ts +2 -0
  32. package/shared/services/inventory.service.d.ts +1 -0
  33. package/shared/services/package.service.d.ts +16 -0
  34. package/shared/services/refinish-code.service.d.ts +16 -0
  35. package/shared/services/waitlist.service.d.ts +2 -1
  36. package/shared/services/work-order.service.d.ts +10 -1
  37. package/shared/shared.module.d.ts +5 -1
  38. package/shared/types/index.d.ts +10 -0
  39. package/shared/types/package-item.d.ts +9 -0
  40. package/shared/types/package-optional-item.d.ts +6 -0
  41. package/shared/types/package-total.d.ts +5 -0
  42. package/shared/types/package-variation-option.d.ts +10 -0
  43. package/shared/types/package-variation.d.ts +8 -0
  44. package/shared/types/package.d.ts +14 -0
  45. package/shared/types/refinish-code.d.ts +8 -0
  46. package/shared/types/waitlist-gun-package-detail.d.ts +10 -0
  47. package/shared/types/waitlist-gun.d.ts +2 -0
  48. package/shared/types/work-order-inventory-item.d.ts +7 -0
  49. package/shared/types/work-order-package-detail.d.ts +10 -0
  50. package/shared/types/work-order.d.ts +2 -0
@@ -1,11 +1,14 @@
1
1
  import { DateTime } from 'luxon';
2
2
  import * as i0 from '@angular/core';
3
- import { Injectable, Inject, Pipe, Directive, Input, NgModule, Component } from '@angular/core';
3
+ import { Injectable, Inject, Pipe, Directive, Input, Component, NgModule } from '@angular/core';
4
4
  import * as i1 from '@angular/common/http';
5
5
  import { of, Subject } from 'rxjs';
6
6
  import { switchMap } from 'rxjs/operators';
7
- import * as i1$1 from '@angular/forms';
8
- import * as i2 from '@angular/common';
7
+ import * as i2 from '@angular/forms';
8
+ import { NgControl, Validators, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
+ import * as i3 from '@progress/kendo-angular-dropdowns';
10
+ import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
11
+ import * as i2$1 from '@angular/common';
9
12
  import { CommonModule } from '@angular/common';
10
13
  import { trigger, transition, style, animate } from '@angular/animations';
11
14
 
@@ -406,6 +409,54 @@ var ShieldRMSOptions;
406
409
  ShieldRMSOptions[ShieldRMSOptions["RemoveBUIS"] = 1] = "RemoveBUIS";
407
410
  })(ShieldRMSOptions || (ShieldRMSOptions = {}));
408
411
 
412
+ class PackageItem {
413
+ }
414
+
415
+ class Package {
416
+ constructor() {
417
+ this.active = true;
418
+ this.firearms = [];
419
+ this.items = [];
420
+ this.optionalItems = [];
421
+ this.variations = [];
422
+ }
423
+ }
424
+
425
+ class PackageOptionalItem {
426
+ }
427
+
428
+ class PackageVariation {
429
+ constructor() {
430
+ this.options = [];
431
+ }
432
+ }
433
+
434
+ class PackageVariationOption {
435
+ }
436
+
437
+ class WaitlistGunPackageDetail {
438
+ constructor() {
439
+ this.optionalItems = [];
440
+ this.variations = [];
441
+ }
442
+ }
443
+
444
+ class WorkOrderPackageDetail {
445
+ constructor() {
446
+ this.optionalItems = [];
447
+ this.variations = [];
448
+ }
449
+ }
450
+
451
+ class PackageTotal {
452
+ }
453
+
454
+ class WorkOrderInventoryItem {
455
+ }
456
+
457
+ class RefinishCode {
458
+ }
459
+
409
460
  function adjustHoliday(finishDate, holidays) {
410
461
  while (holidays.map(h => new Date(h.holiday)).findIndex(h => DateTime.fromJSDate(h) === DateTime.fromJSDate(finishDate)) !== -1) {
411
462
  do {
@@ -794,6 +845,9 @@ class WorkOrderService {
794
845
  createChecklists(workOrderId, refinishItemIds) {
795
846
  return this.http.get(`${this.url}/${workOrderId}/refinish-items/` + refinishItemIds.join(',') + '/pdfs', { responseType: "blob" });
796
847
  }
848
+ createShopChecklist(workOrderId) {
849
+ return this.http.get(`${this.url}/${workOrderId}/pdf`, { responseType: "blob" });
850
+ }
797
851
  // Refinish Items
798
852
  readRefinishItems(workOrderId) {
799
853
  return this.http.get(`${this.url}/${workOrderId}/refinish-items`);
@@ -839,6 +893,37 @@ class WorkOrderService {
839
893
  readReportRefinishItems() {
840
894
  return this.http.get(`${this.env.baseUrl}api/report-refinish-items`);
841
895
  }
896
+ readPackageDetailTotals(startDate, endDate, statuses) {
897
+ return this.http.get(`${this.url}/package-details/totals`, {
898
+ params: {
899
+ startDate: startDate.toUTCString(),
900
+ endDate: endDate.toUTCString(),
901
+ statuses: statuses.map(status => status.toString())
902
+ }
903
+ });
904
+ }
905
+ // Inventory Items
906
+ readInventoryItems(workOrderId) {
907
+ return this.http.get(`${this.url}/${workOrderId}/inventory-items`);
908
+ }
909
+ readInventoryItem(workOrderId, inventoryItemId) {
910
+ return this.http.get(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`);
911
+ }
912
+ createInventoryItem(workOrderId, inventoryItem) {
913
+ return this.http.post(`${this.url}/${workOrderId}/inventory-items`, inventoryItem);
914
+ }
915
+ updateInventoryItem(workOrderId, inventoryItemId, inventoryItem) {
916
+ return this.http.put(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`, inventoryItem);
917
+ }
918
+ deleteInventoryItem(workOrderId, inventoryItemId) {
919
+ return this.http.delete(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`);
920
+ }
921
+ readInventoryItemCollection(workOrderId, itemIds) {
922
+ return this.http.get(`${this.url}/${workOrderId}/inventory-items/collection/${itemIds.join(',')}`);
923
+ }
924
+ createInventoryItems(workOrderId, inventoryItems) {
925
+ return this.http.post(`${this.url}/${workOrderId}/inventory-items/collection`, inventoryItems);
926
+ }
842
927
  }
843
928
  WorkOrderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
844
929
  WorkOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, providedIn: 'root' });
@@ -992,6 +1077,9 @@ class WaitlistService {
992
1077
  deleteProject(waitlistId, projectId) {
993
1078
  return this.http.delete(`${this.url}/${waitlistId}/projects/${projectId}`);
994
1079
  }
1080
+ readPackageDetailTotals() {
1081
+ return this.http.get(`${this.url}/package-details/totals`);
1082
+ }
995
1083
  }
996
1084
  WaitlistService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
997
1085
  WaitlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, providedIn: 'root' });
@@ -1488,6 +1576,9 @@ class InventoryService {
1488
1576
  updateInventoryItem(id, item) {
1489
1577
  return this.http.put(`${this.url}/${id}`, item);
1490
1578
  }
1579
+ createInventoryItem(item) {
1580
+ return this.http.post(this.url, item);
1581
+ }
1491
1582
  }
1492
1583
  InventoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1493
1584
  InventoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, providedIn: 'root' });
@@ -1536,6 +1627,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1536
1627
  args: ['env']
1537
1628
  }] }]; } });
1538
1629
 
1630
+ class PackageService {
1631
+ constructor(http, env) {
1632
+ this.http = http;
1633
+ this.env = env;
1634
+ this.url = this.env.baseUrl + 'api/packages';
1635
+ }
1636
+ readPackages(includeInactive = false, sku = null, name = null) {
1637
+ const params = {
1638
+ includeInactive
1639
+ };
1640
+ if (sku) {
1641
+ params['sku'] = sku;
1642
+ }
1643
+ if (name) {
1644
+ params['name'] = name;
1645
+ }
1646
+ return this.http.get(this.url, { params: params });
1647
+ }
1648
+ readPackage(id) {
1649
+ return this.http.get(`${this.url}/${id}`);
1650
+ }
1651
+ readPackagesByFirearm(firearmId) {
1652
+ return this.http.get(`${this.env.baseUrl}api/firearms/${firearmId}/packages`);
1653
+ }
1654
+ savePackage(packagez) {
1655
+ if (packagez.id) {
1656
+ return this.http.put(`${this.url}/${packagez.id}`, packagez);
1657
+ }
1658
+ return this.http.post(this.url, packagez);
1659
+ }
1660
+ }
1661
+ PackageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1662
+ PackageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, providedIn: 'root' });
1663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, decorators: [{
1664
+ type: Injectable,
1665
+ args: [{
1666
+ providedIn: 'root'
1667
+ }]
1668
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1669
+ type: Inject,
1670
+ args: ['env']
1671
+ }] }]; } });
1672
+
1673
+ class RefinishCodeService {
1674
+ constructor(http, env) {
1675
+ this.http = http;
1676
+ this.env = env;
1677
+ this.url = this.env.baseUrl + 'api/refinish-codes';
1678
+ }
1679
+ readRefinishCodes() {
1680
+ return this.http.get(this.url);
1681
+ }
1682
+ createRefinishCodes(refinishCodes) {
1683
+ return this.http.post(this.url, refinishCodes);
1684
+ }
1685
+ updateRefinishCodes(ids, refinishCodes) {
1686
+ return this.http.put(`${this.url}/` + ids.join(','), refinishCodes);
1687
+ }
1688
+ deleteRefinishCodes(ids) {
1689
+ return this.http.delete(this.url + '/' + ids.join(','));
1690
+ }
1691
+ }
1692
+ RefinishCodeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, deps: [{ token: i1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
1693
+ RefinishCodeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, providedIn: 'root' });
1694
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, decorators: [{
1695
+ type: Injectable,
1696
+ args: [{
1697
+ providedIn: 'root'
1698
+ }]
1699
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
1700
+ type: Inject,
1701
+ args: ['env']
1702
+ }] }]; } });
1703
+
1539
1704
  class PhonePipe {
1540
1705
  transform(value, args) {
1541
1706
  if (value && value.length >= 10) {
@@ -1626,14 +1791,14 @@ class DisableControlDirective {
1626
1791
  this.ngControl.control[action]();
1627
1792
  }
1628
1793
  }
1629
- DisableControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, deps: [{ token: i1$1.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
1794
+ DisableControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, deps: [{ token: i2.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
1630
1795
  DisableControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: DisableControlDirective, selector: "[disableControl]", inputs: { disableControl: "disableControl" }, ngImport: i0 });
1631
1796
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, decorators: [{
1632
1797
  type: Directive,
1633
1798
  args: [{
1634
1799
  selector: '[disableControl]'
1635
1800
  }]
1636
- }], ctorParameters: function () { return [{ type: i1$1.NgControl }]; }, propDecorators: { disableControl: [{
1801
+ }], ctorParameters: function () { return [{ type: i2.NgControl }]; }, propDecorators: { disableControl: [{
1637
1802
  type: Input
1638
1803
  }] } });
1639
1804
 
@@ -1682,6 +1847,166 @@ function refinishDetailsValidator() {
1682
1847
  };
1683
1848
  }
1684
1849
 
1850
+ class PackageSelectorComponent {
1851
+ constructor(packageService, fb, inj) {
1852
+ this.packageService = packageService;
1853
+ this.fb = fb;
1854
+ this.inj = inj;
1855
+ this.packages = [];
1856
+ this.packageVariations = [];
1857
+ this.packageOptionalItems = [];
1858
+ this.onChangeSubs = [];
1859
+ this.onTouched = () => { };
1860
+ this.touched = false;
1861
+ this.disabled = false;
1862
+ this.createForm();
1863
+ }
1864
+ ngOnChanges(changes) {
1865
+ if (changes.firearmId.currentValue) {
1866
+ this.getPackages();
1867
+ this.packageForm.reset();
1868
+ }
1869
+ else {
1870
+ this.packages = [];
1871
+ this.packageForm.reset();
1872
+ }
1873
+ }
1874
+ ngAfterViewInit() {
1875
+ const outerControl = this.inj.get(NgControl).control;
1876
+ const prevMarkAsTouched = outerControl.markAsTouched;
1877
+ outerControl.markAsTouched = (...args) => {
1878
+ this.packageForm.markAllAsTouched();
1879
+ prevMarkAsTouched.bind(outerControl)(...args);
1880
+ };
1881
+ }
1882
+ ngOnDestroy() {
1883
+ for (let sub of this.onChangeSubs) {
1884
+ sub.unsubscribe();
1885
+ }
1886
+ }
1887
+ getPackages() {
1888
+ this.packageService.readPackagesByFirearm(this.firearmId)
1889
+ .subscribe(packages => {
1890
+ this.packages = packages;
1891
+ if (this.packageForm.controls.package.value) {
1892
+ let packagez = this.packages.find(p => p.id === this.packageForm.controls.package.value.id);
1893
+ this.setPackageOptions(packagez);
1894
+ }
1895
+ });
1896
+ }
1897
+ createForm() {
1898
+ this.packageForm = this.fb.group({
1899
+ package: null,
1900
+ optionalItems: this.fb.control([]),
1901
+ variations: this.fb.array([])
1902
+ });
1903
+ this.packageForm.controls.package.valueChanges
1904
+ .subscribe(value => {
1905
+ this.packageForm.controls.optionalItems.reset();
1906
+ this.packageOptionalItems = [];
1907
+ this.variations.clear({ emitEvent: false });
1908
+ this.packageVariations = [];
1909
+ if (value?.id) {
1910
+ this.setPackageOptions(value);
1911
+ }
1912
+ else {
1913
+ if (this.packageDetail) {
1914
+ this.packageDetail.variations = null;
1915
+ this.packageDetail.optionalItems = null;
1916
+ }
1917
+ }
1918
+ });
1919
+ }
1920
+ get variations() { return this.packageForm.controls.variations; }
1921
+ setPackageOptions(packagez) {
1922
+ this.packageOptionalItems = packagez.optionalItems;
1923
+ this.packageVariations = packagez.variations;
1924
+ this.variations.clear({ emitEvent: false });
1925
+ for (let v of this.packageVariations) {
1926
+ let selectedVariation = this.packageDetail?.variations?.find(pv => pv.packageVariationId === v.id);
1927
+ this.variations.push(this.fb.control(selectedVariation, Validators.required), { emitEvent: false });
1928
+ }
1929
+ }
1930
+ setValue(packageDetail) {
1931
+ this.packageForm.reset(packageDetail);
1932
+ }
1933
+ validate(control) {
1934
+ if (this.packageForm.valid) {
1935
+ return null;
1936
+ }
1937
+ let errors = {};
1938
+ for (let v of this.variations.controls) {
1939
+ if (v.invalid) {
1940
+ return v.errors;
1941
+ }
1942
+ }
1943
+ return errors;
1944
+ }
1945
+ addControlErrors(allErrors, controlName) {
1946
+ const errors = { ...allErrors };
1947
+ const controlErrors = this.packageForm.controls[controlName].errors;
1948
+ if (controlErrors) {
1949
+ errors[controlName] = controlErrors;
1950
+ }
1951
+ return errors;
1952
+ }
1953
+ writeValue(packageDetail) {
1954
+ if (packageDetail) {
1955
+ this.packageDetail = Object.assign({}, packageDetail);
1956
+ this.setValue(packageDetail);
1957
+ }
1958
+ else {
1959
+ this.packageForm.reset();
1960
+ }
1961
+ }
1962
+ registerOnChange(onChange) {
1963
+ const sub = this.packageForm.valueChanges.subscribe(onChange);
1964
+ this.onChangeSubs.push(sub);
1965
+ }
1966
+ registerOnTouched(onTouched) {
1967
+ this.onTouched = onTouched;
1968
+ }
1969
+ setDisabledState(isDisabled) {
1970
+ this.disabled = isDisabled;
1971
+ if (isDisabled) {
1972
+ this.packageForm.disable();
1973
+ }
1974
+ else {
1975
+ this.packageForm.enable();
1976
+ }
1977
+ }
1978
+ }
1979
+ PackageSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageSelectorComponent, deps: [{ token: PackageService }, { token: i2.FormBuilder }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
1980
+ PackageSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PackageSelectorComponent, selector: "cgw-package-selector", inputs: { firearmId: "firearmId" }, providers: [
1981
+ {
1982
+ provide: NG_VALUE_ACCESSOR,
1983
+ multi: true,
1984
+ useExisting: PackageSelectorComponent
1985
+ },
1986
+ {
1987
+ provide: NG_VALIDATORS,
1988
+ multi: true,
1989
+ useExisting: PackageSelectorComponent
1990
+ }
1991
+ ], usesOnChanges: true, ngImport: i0, template: "<div [formGroup]=\"packageForm\">\r\n <div class=\"row mb-2\">\r\n <div class=\"col\">\r\n <label for=\"waitlist-gun-package\">Package - <span class=\"fst-italic fs-7\">Select a model to list available packages</span></label>\r\n <kendo-dropdownlist [data]=\"packages\"\r\n [defaultItem]=\"{name: 'No Package', id: null}\"\r\n id=\"waitlist-gun-package\"\r\n formControlName=\"package\"\r\n textField=\"name\"\r\n valueField=\"id\"\r\n size=\"small\"></kendo-dropdownlist>\r\n </div>\r\n </div>\r\n <div formArrayName=\"variations\" *ngFor=\"let variationControl of variations.controls; let i = index\">\r\n <div class=\"row mb-2\">\r\n <div class=\"col\">\r\n <label [for]=\"'waitlist-gun-package-variation-' + i\">{{packageVariations[i]?.name}}</label>\r\n <kendo-dropdownlist [data]=\"packageVariations[i]?.options\"\r\n [id]=\"'waitlist-gun-package-variation-' + i\"\r\n textField=\"optionName\"\r\n [formControl]=\"variationControl\"\r\n valueField=\"id\"\r\n size=\"small\"></kendo-dropdownlist>\r\n </div>\r\n </div>\r\n <div *ngIf=\"variationControl.invalid && (variationControl.dirty || variationControl.touched)\" class=\"error-container text-danger\">\r\n <div *ngIf=\"variationControl.errors.required\">\r\n {{packageVariations[i]?.name}} is required.\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mb-2\" *ngIf=\"packageOptionalItems?.length\">\r\n <div class=\"col\">\r\n <label for=\"waitlist-gun-package-addons\">Add-ons (Additional charges will apply)</label>\r\n <kendo-multiselect id=\"waitlist-gun-package-addons\"\r\n [data]=\"packageOptionalItems\"\r\n formControlName=\"optionalItems\"\r\n textField=\"name\"\r\n valueField=\"inventoryItemId\"\r\n size=\"small\"></kendo-multiselect>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""], components: [{ type: i3.DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["iconClass", "loading", "data", "value", "textField", "valueField", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { type: i3.MultiSelectComponent, selector: "kendo-multiselect", inputs: ["focusableId", "autoClose", "loading", "data", "value", "valueField", "textField", "tabindex", "tabIndex", "size", "rounded", "fillMode", "placeholder", "disabled", "itemDisabled", "checkboxes", "readonly", "filterable", "virtual", "popupSettings", "listHeight", "valuePrimitive", "clearButton", "tagMapper", "allowCustom", "valueNormalizer"], outputs: ["filterChange", "valueChange", "open", "opened", "close", "closed", "focus", "blur", "removeTag"], exportAs: ["kendoMultiSelect"] }], directives: [{ type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageSelectorComponent, decorators: [{
1993
+ type: Component,
1994
+ args: [{ selector: 'cgw-package-selector', providers: [
1995
+ {
1996
+ provide: NG_VALUE_ACCESSOR,
1997
+ multi: true,
1998
+ useExisting: PackageSelectorComponent
1999
+ },
2000
+ {
2001
+ provide: NG_VALIDATORS,
2002
+ multi: true,
2003
+ useExisting: PackageSelectorComponent
2004
+ }
2005
+ ], template: "<div [formGroup]=\"packageForm\">\r\n <div class=\"row mb-2\">\r\n <div class=\"col\">\r\n <label for=\"waitlist-gun-package\">Package - <span class=\"fst-italic fs-7\">Select a model to list available packages</span></label>\r\n <kendo-dropdownlist [data]=\"packages\"\r\n [defaultItem]=\"{name: 'No Package', id: null}\"\r\n id=\"waitlist-gun-package\"\r\n formControlName=\"package\"\r\n textField=\"name\"\r\n valueField=\"id\"\r\n size=\"small\"></kendo-dropdownlist>\r\n </div>\r\n </div>\r\n <div formArrayName=\"variations\" *ngFor=\"let variationControl of variations.controls; let i = index\">\r\n <div class=\"row mb-2\">\r\n <div class=\"col\">\r\n <label [for]=\"'waitlist-gun-package-variation-' + i\">{{packageVariations[i]?.name}}</label>\r\n <kendo-dropdownlist [data]=\"packageVariations[i]?.options\"\r\n [id]=\"'waitlist-gun-package-variation-' + i\"\r\n textField=\"optionName\"\r\n [formControl]=\"variationControl\"\r\n valueField=\"id\"\r\n size=\"small\"></kendo-dropdownlist>\r\n </div>\r\n </div>\r\n <div *ngIf=\"variationControl.invalid && (variationControl.dirty || variationControl.touched)\" class=\"error-container text-danger\">\r\n <div *ngIf=\"variationControl.errors.required\">\r\n {{packageVariations[i]?.name}} is required.\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mb-2\" *ngIf=\"packageOptionalItems?.length\">\r\n <div class=\"col\">\r\n <label for=\"waitlist-gun-package-addons\">Add-ons (Additional charges will apply)</label>\r\n <kendo-multiselect id=\"waitlist-gun-package-addons\"\r\n [data]=\"packageOptionalItems\"\r\n formControlName=\"optionalItems\"\r\n textField=\"name\"\r\n valueField=\"inventoryItemId\"\r\n size=\"small\"></kendo-multiselect>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [""] }]
2006
+ }], ctorParameters: function () { return [{ type: PackageService }, { type: i2.FormBuilder }, { type: i0.Injector }]; }, propDecorators: { firearmId: [{
2007
+ type: Input
2008
+ }] } });
2009
+
1685
2010
  class SharedModule {
1686
2011
  }
1687
2012
  SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
@@ -1690,13 +2015,23 @@ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
1690
2015
  EnumPipe,
1691
2016
  DisableControlDirective,
1692
2017
  NewLinePipe,
1693
- FrameMaterialPipe], exports: [PhonePipe,
2018
+ FrameMaterialPipe,
2019
+ PackageSelectorComponent], imports: [CommonModule,
2020
+ DropDownsModule,
2021
+ FormsModule,
2022
+ ReactiveFormsModule], exports: [PhonePipe,
1694
2023
  FileNamePipe,
1695
2024
  EnumPipe,
1696
2025
  NewLinePipe,
1697
2026
  DisableControlDirective,
1698
- FrameMaterialPipe] });
1699
- SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[]] });
2027
+ FrameMaterialPipe,
2028
+ PackageSelectorComponent] });
2029
+ SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[
2030
+ CommonModule,
2031
+ DropDownsModule,
2032
+ FormsModule,
2033
+ ReactiveFormsModule
2034
+ ]] });
1700
2035
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, decorators: [{
1701
2036
  type: NgModule,
1702
2037
  args: [{
@@ -1706,16 +2041,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
1706
2041
  EnumPipe,
1707
2042
  DisableControlDirective,
1708
2043
  NewLinePipe,
1709
- FrameMaterialPipe
2044
+ FrameMaterialPipe,
2045
+ PackageSelectorComponent
2046
+ ],
2047
+ imports: [
2048
+ CommonModule,
2049
+ DropDownsModule,
2050
+ FormsModule,
2051
+ ReactiveFormsModule
1710
2052
  ],
1711
- imports: [],
1712
2053
  exports: [
1713
2054
  PhonePipe,
1714
2055
  FileNamePipe,
1715
2056
  EnumPipe,
1716
2057
  NewLinePipe,
1717
2058
  DisableControlDirective,
1718
- FrameMaterialPipe
2059
+ FrameMaterialPipe,
2060
+ PackageSelectorComponent
1719
2061
  ]
1720
2062
  }]
1721
2063
  }] });
@@ -1778,10 +2120,10 @@ class NotificationBarComponent {
1778
2120
  }
1779
2121
  }
1780
2122
  NotificationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
1781
- NotificationBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NotificationBarComponent, selector: "app-notification-bar", ngImport: i0, template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\r\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\r\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\r\n </div>\r\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\r\n</div>\r\n", styles: [".notification-bar{position:fixed;top:0;left:0;right:0;z-index:10001;pointer-events:none}.notification-bar .notification-pill{max-width:300px;margin:10px auto;border-radius:20px;color:#2a2b4b;background:#F2F2F2;padding:8px;text-align:center;box-shadow:inset 0 2px 4px #ffffff80,inset 0 -2px 4px #000000e6,0 2px 4px #00000080}.notification-bar .error{color:#711e16!important;background:#f8d8d4!important}\n"], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [fadeOutAnimation] });
2123
+ NotificationBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: NotificationBarComponent, selector: "app-notification-bar", ngImport: i0, template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\r\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\r\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\r\n </div>\r\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\r\n</div>\r\n", styles: [".notification-bar{position:fixed;top:0;left:0;right:0;z-index:10001;pointer-events:none}.notification-bar .notification-pill{max-width:300px;margin:10px auto;border-radius:4px;color:#000;background:rgba(16,16,16,.4);padding:8px;text-align:center}.notification-bar .error{color:#711e16!important;background:rgba(248,216,212,.6)!important}\n"], directives: [{ type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], animations: [fadeOutAnimation] });
1782
2124
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, decorators: [{
1783
2125
  type: Component,
1784
- args: [{ selector: 'app-notification-bar', animations: [fadeOutAnimation], template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\r\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\r\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\r\n </div>\r\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\r\n</div>\r\n", styles: [".notification-bar{position:fixed;top:0;left:0;right:0;z-index:10001;pointer-events:none}.notification-bar .notification-pill{max-width:300px;margin:10px auto;border-radius:20px;color:#2a2b4b;background:#F2F2F2;padding:8px;text-align:center;box-shadow:inset 0 2px 4px #ffffff80,inset 0 -2px 4px #000000e6,0 2px 4px #00000080}.notification-bar .error{color:#711e16!important;background:#f8d8d4!important}\n"] }]
2126
+ args: [{ selector: 'app-notification-bar', animations: [fadeOutAnimation], template: "<div class=\"notification-bar\" *ngIf=\"messages.length\">\r\n <div *ngFor=\"let message of viewMessages\" class=\"notification-pill\" [class.error]=\"message.type == 1\" [@fadeOutAnimation]=\"shouldFade()\">\r\n <i class=\"fa\" [ngClass]=\"getIconClass(message)\"></i> <span class=\"ms-1\">{{message.message}}</span>\r\n </div>\r\n <div *ngIf=\"messages.length > 3\" class=\"notification-pill\">{{messages.length - 2}} more...</div>\r\n</div>\r\n", styles: [".notification-bar{position:fixed;top:0;left:0;right:0;z-index:10001;pointer-events:none}.notification-bar .notification-pill{max-width:300px;margin:10px auto;border-radius:4px;color:#000;background:rgba(16,16,16,.4);padding:8px;text-align:center}.notification-bar .error{color:#711e16!important;background:rgba(248,216,212,.6)!important}\n"] }]
1785
2127
  }], ctorParameters: function () { return [{ type: NotificationService }]; } });
1786
2128
 
1787
2129
  class NotificationModule {
@@ -1820,5 +2162,5 @@ var NotificationType;
1820
2162
  * Generated bundle index. Do not edit.
1821
2163
  */
1822
2164
 
1823
- export { BundleItem, ChangeOrderStatus, Coating, CoatingService, CoatingValue, Configuration, ConfigurationService, CosmeticMilling, CosmeticMillingService, Customer, CustomerService, Dealer, DealerContact, DealerCoupon, DealerService, DisableControlDirective, EnumPipe, FileNamePipe, FileUploadService, FilterOptions, Firearm, FirearmSeries, FirearmSeriesOptic, FirearmSeriesService, FirearmService, FrameMaterial, FrameMaterialPipe, GunCaliber, GunPart, GunPartOption, GunPartService, InventoryItem, InventoryService, JFile, Material, MaterialService, MillingDetail, MillingItem, MillingType, MillingTypeService, MountType, NewLinePipe, NotificationBarComponent, NotificationModule, NotificationService, NotificationType, Optic, OpticService, OpticStatus, PhonePipe, Product, ProductService, ProjectType, PurchaseOrder, PurchaseOrderRefinishItem, PurchaseOrderService, PurchaseOrderStatus, RearSightPosition, RefinishDetail, ReportMillingItem, ReportRefinishItem, SharedModule, ShieldRMSOptions, SightType, State, StateService, StatusHistoryService, Total, TotalItem, TotalsService, UserService, Vendor, VendorContact, VendorService, WaitlistAction, WaitlistCustomerService, WaitlistGun, WaitlistHistory, WaitlistItem, WaitlistProjectService, WaitlistService, WaitlistStatus, WorkChangeOrder, WorkHoliday, WorkHolidayService, WorkOrder, WorkOrderAction, WorkOrderHistory, WorkOrderRefinishItem, WorkOrderService, WorkOrderStatus, WorkOrderType, calculateFinishDate, coatingDescriptionValidator, coatingValueValidator, convertEnumToObjectArray, getCoatingValues, getCoatings, hasCoatingDescription, hasCoatingValues, refinishDetailsValidator, touchControls };
2165
+ export { BundleItem, ChangeOrderStatus, Coating, CoatingService, CoatingValue, Configuration, ConfigurationService, CosmeticMilling, CosmeticMillingService, Customer, CustomerService, Dealer, DealerContact, DealerCoupon, DealerService, DisableControlDirective, EnumPipe, FileNamePipe, FileUploadService, FilterOptions, Firearm, FirearmSeries, FirearmSeriesOptic, FirearmSeriesService, FirearmService, FrameMaterial, FrameMaterialPipe, GunCaliber, GunPart, GunPartOption, GunPartService, InventoryItem, InventoryService, JFile, Material, MaterialService, MillingDetail, MillingItem, MillingType, MillingTypeService, MountType, NewLinePipe, NotificationBarComponent, NotificationModule, NotificationService, NotificationType, Optic, OpticService, OpticStatus, Package, PackageItem, PackageOptionalItem, PackageSelectorComponent, PackageService, PackageTotal, PackageVariation, PackageVariationOption, PhonePipe, Product, ProductService, ProjectType, PurchaseOrder, PurchaseOrderRefinishItem, PurchaseOrderService, PurchaseOrderStatus, RearSightPosition, RefinishCode, RefinishCodeService, RefinishDetail, ReportMillingItem, ReportRefinishItem, SharedModule, ShieldRMSOptions, SightType, State, StateService, StatusHistoryService, Total, TotalItem, TotalsService, UserService, Vendor, VendorContact, VendorService, WaitlistAction, WaitlistCustomerService, WaitlistGun, WaitlistGunPackageDetail, WaitlistHistory, WaitlistItem, WaitlistProjectService, WaitlistService, WaitlistStatus, WorkChangeOrder, WorkHoliday, WorkHolidayService, WorkOrder, WorkOrderAction, WorkOrderHistory, WorkOrderInventoryItem, WorkOrderPackageDetail, WorkOrderRefinishItem, WorkOrderService, WorkOrderStatus, WorkOrderType, calculateFinishDate, coatingDescriptionValidator, coatingValueValidator, convertEnumToObjectArray, getCoatingValues, getCoatings, hasCoatingDescription, hasCoatingValues, refinishDetailsValidator, touchControls };
1824
2166
  //# sourceMappingURL=gunsmith-common.mjs.map