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.
- package/esm2020/notification/notification-bar/notification-bar.component.mjs +3 -3
- package/esm2020/public_api.mjs +2 -1
- package/esm2020/shared/controls/package-selector/package-selector.component.mjs +168 -0
- package/esm2020/shared/services/index.mjs +3 -1
- package/esm2020/shared/services/inventory.service.mjs +4 -1
- package/esm2020/shared/services/package.service.mjs +47 -0
- package/esm2020/shared/services/refinish-code.service.mjs +35 -0
- package/esm2020/shared/services/waitlist.service.mjs +4 -1
- package/esm2020/shared/services/work-order.service.mjs +35 -1
- package/esm2020/shared/shared.module.mjs +28 -7
- package/esm2020/shared/types/index.mjs +11 -1
- package/esm2020/shared/types/package-item.mjs +3 -0
- package/esm2020/shared/types/package-optional-item.mjs +3 -0
- package/esm2020/shared/types/package-total.mjs +3 -0
- package/esm2020/shared/types/package-variation-option.mjs +3 -0
- package/esm2020/shared/types/package-variation.mjs +6 -0
- package/esm2020/shared/types/package.mjs +10 -0
- package/esm2020/shared/types/refinish-code.mjs +3 -0
- package/esm2020/shared/types/waitlist-gun-package-detail.mjs +7 -0
- package/esm2020/shared/types/waitlist-gun.mjs +1 -1
- package/esm2020/shared/types/work-order-inventory-item.mjs +3 -0
- package/esm2020/shared/types/work-order-package-detail.mjs +7 -0
- package/esm2020/shared/types/work-order.mjs +1 -1
- package/fesm2015/gunsmith-common.mjs +361 -14
- package/fesm2015/gunsmith-common.mjs.map +1 -1
- package/fesm2020/gunsmith-common.mjs +356 -14
- package/fesm2020/gunsmith-common.mjs.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/shared/controls/package-selector/package-selector.component.d.ts +38 -0
- package/shared/services/index.d.ts +2 -0
- package/shared/services/inventory.service.d.ts +1 -0
- package/shared/services/package.service.d.ts +16 -0
- package/shared/services/refinish-code.service.d.ts +16 -0
- package/shared/services/waitlist.service.d.ts +2 -1
- package/shared/services/work-order.service.d.ts +10 -1
- package/shared/shared.module.d.ts +5 -1
- package/shared/types/index.d.ts +10 -0
- package/shared/types/package-item.d.ts +9 -0
- package/shared/types/package-optional-item.d.ts +6 -0
- package/shared/types/package-total.d.ts +5 -0
- package/shared/types/package-variation-option.d.ts +10 -0
- package/shared/types/package-variation.d.ts +8 -0
- package/shared/types/package.d.ts +14 -0
- package/shared/types/refinish-code.d.ts +8 -0
- package/shared/types/waitlist-gun-package-detail.d.ts +10 -0
- package/shared/types/waitlist-gun.d.ts +2 -0
- package/shared/types/work-order-inventory-item.d.ts +7 -0
- package/shared/types/work-order-package-detail.d.ts +10 -0
- 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,
|
|
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
|
|
8
|
-
import
|
|
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 {
|
|
@@ -808,6 +859,9 @@ class WorkOrderService {
|
|
|
808
859
|
createChecklists(workOrderId, refinishItemIds) {
|
|
809
860
|
return this.http.get(`${this.url}/${workOrderId}/refinish-items/` + refinishItemIds.join(',') + '/pdfs', { responseType: "blob" });
|
|
810
861
|
}
|
|
862
|
+
createShopChecklist(workOrderId) {
|
|
863
|
+
return this.http.get(`${this.url}/${workOrderId}/pdf`, { responseType: "blob" });
|
|
864
|
+
}
|
|
811
865
|
// Refinish Items
|
|
812
866
|
readRefinishItems(workOrderId) {
|
|
813
867
|
return this.http.get(`${this.url}/${workOrderId}/refinish-items`);
|
|
@@ -853,6 +907,37 @@ class WorkOrderService {
|
|
|
853
907
|
readReportRefinishItems() {
|
|
854
908
|
return this.http.get(`${this.env.baseUrl}api/report-refinish-items`);
|
|
855
909
|
}
|
|
910
|
+
readPackageDetailTotals(startDate, endDate, statuses) {
|
|
911
|
+
return this.http.get(`${this.url}/package-details/totals`, {
|
|
912
|
+
params: {
|
|
913
|
+
startDate: startDate.toUTCString(),
|
|
914
|
+
endDate: endDate.toUTCString(),
|
|
915
|
+
statuses: statuses.map(status => status.toString())
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
// Inventory Items
|
|
920
|
+
readInventoryItems(workOrderId) {
|
|
921
|
+
return this.http.get(`${this.url}/${workOrderId}/inventory-items`);
|
|
922
|
+
}
|
|
923
|
+
readInventoryItem(workOrderId, inventoryItemId) {
|
|
924
|
+
return this.http.get(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`);
|
|
925
|
+
}
|
|
926
|
+
createInventoryItem(workOrderId, inventoryItem) {
|
|
927
|
+
return this.http.post(`${this.url}/${workOrderId}/inventory-items`, inventoryItem);
|
|
928
|
+
}
|
|
929
|
+
updateInventoryItem(workOrderId, inventoryItemId, inventoryItem) {
|
|
930
|
+
return this.http.put(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`, inventoryItem);
|
|
931
|
+
}
|
|
932
|
+
deleteInventoryItem(workOrderId, inventoryItemId) {
|
|
933
|
+
return this.http.delete(`${this.url}/${workOrderId}/inventory-items/${inventoryItemId}`);
|
|
934
|
+
}
|
|
935
|
+
readInventoryItemCollection(workOrderId, itemIds) {
|
|
936
|
+
return this.http.get(`${this.url}/${workOrderId}/inventory-items/collection/${itemIds.join(',')}`);
|
|
937
|
+
}
|
|
938
|
+
createInventoryItems(workOrderId, inventoryItems) {
|
|
939
|
+
return this.http.post(`${this.url}/${workOrderId}/inventory-items/collection`, inventoryItems);
|
|
940
|
+
}
|
|
856
941
|
}
|
|
857
942
|
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 });
|
|
858
943
|
WorkOrderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WorkOrderService, providedIn: 'root' });
|
|
@@ -1012,6 +1097,9 @@ class WaitlistService {
|
|
|
1012
1097
|
deleteProject(waitlistId, projectId) {
|
|
1013
1098
|
return this.http.delete(`${this.url}/${waitlistId}/projects/${projectId}`);
|
|
1014
1099
|
}
|
|
1100
|
+
readPackageDetailTotals() {
|
|
1101
|
+
return this.http.get(`${this.url}/package-details/totals`);
|
|
1102
|
+
}
|
|
1015
1103
|
}
|
|
1016
1104
|
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 });
|
|
1017
1105
|
WaitlistService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: WaitlistService, providedIn: 'root' });
|
|
@@ -1534,6 +1622,9 @@ class InventoryService {
|
|
|
1534
1622
|
updateInventoryItem(id, item) {
|
|
1535
1623
|
return this.http.put(`${this.url}/${id}`, item);
|
|
1536
1624
|
}
|
|
1625
|
+
createInventoryItem(item) {
|
|
1626
|
+
return this.http.post(this.url, item);
|
|
1627
|
+
}
|
|
1537
1628
|
}
|
|
1538
1629
|
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 });
|
|
1539
1630
|
InventoryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: InventoryService, providedIn: 'root' });
|
|
@@ -1586,6 +1677,84 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
1586
1677
|
}] }];
|
|
1587
1678
|
} });
|
|
1588
1679
|
|
|
1680
|
+
class PackageService {
|
|
1681
|
+
constructor(http, env) {
|
|
1682
|
+
this.http = http;
|
|
1683
|
+
this.env = env;
|
|
1684
|
+
this.url = this.env.baseUrl + 'api/packages';
|
|
1685
|
+
}
|
|
1686
|
+
readPackages(includeInactive = false, sku = null, name = null) {
|
|
1687
|
+
const params = {
|
|
1688
|
+
includeInactive
|
|
1689
|
+
};
|
|
1690
|
+
if (sku) {
|
|
1691
|
+
params['sku'] = sku;
|
|
1692
|
+
}
|
|
1693
|
+
if (name) {
|
|
1694
|
+
params['name'] = name;
|
|
1695
|
+
}
|
|
1696
|
+
return this.http.get(this.url, { params: params });
|
|
1697
|
+
}
|
|
1698
|
+
readPackage(id) {
|
|
1699
|
+
return this.http.get(`${this.url}/${id}`);
|
|
1700
|
+
}
|
|
1701
|
+
readPackagesByFirearm(firearmId) {
|
|
1702
|
+
return this.http.get(`${this.env.baseUrl}api/firearms/${firearmId}/packages`);
|
|
1703
|
+
}
|
|
1704
|
+
savePackage(packagez) {
|
|
1705
|
+
if (packagez.id) {
|
|
1706
|
+
return this.http.put(`${this.url}/${packagez.id}`, packagez);
|
|
1707
|
+
}
|
|
1708
|
+
return this.http.post(this.url, packagez);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
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 });
|
|
1712
|
+
PackageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, providedIn: 'root' });
|
|
1713
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageService, decorators: [{
|
|
1714
|
+
type: Injectable,
|
|
1715
|
+
args: [{
|
|
1716
|
+
providedIn: 'root'
|
|
1717
|
+
}]
|
|
1718
|
+
}], ctorParameters: function () {
|
|
1719
|
+
return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
1720
|
+
type: Inject,
|
|
1721
|
+
args: ['env']
|
|
1722
|
+
}] }];
|
|
1723
|
+
} });
|
|
1724
|
+
|
|
1725
|
+
class RefinishCodeService {
|
|
1726
|
+
constructor(http, env) {
|
|
1727
|
+
this.http = http;
|
|
1728
|
+
this.env = env;
|
|
1729
|
+
this.url = this.env.baseUrl + 'api/refinish-codes';
|
|
1730
|
+
}
|
|
1731
|
+
readRefinishCodes() {
|
|
1732
|
+
return this.http.get(this.url);
|
|
1733
|
+
}
|
|
1734
|
+
createRefinishCodes(refinishCodes) {
|
|
1735
|
+
return this.http.post(this.url, refinishCodes);
|
|
1736
|
+
}
|
|
1737
|
+
updateRefinishCodes(ids, refinishCodes) {
|
|
1738
|
+
return this.http.put(`${this.url}/` + ids.join(','), refinishCodes);
|
|
1739
|
+
}
|
|
1740
|
+
deleteRefinishCodes(ids) {
|
|
1741
|
+
return this.http.delete(this.url + '/' + ids.join(','));
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
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 });
|
|
1745
|
+
RefinishCodeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, providedIn: 'root' });
|
|
1746
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: RefinishCodeService, decorators: [{
|
|
1747
|
+
type: Injectable,
|
|
1748
|
+
args: [{
|
|
1749
|
+
providedIn: 'root'
|
|
1750
|
+
}]
|
|
1751
|
+
}], ctorParameters: function () {
|
|
1752
|
+
return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
1753
|
+
type: Inject,
|
|
1754
|
+
args: ['env']
|
|
1755
|
+
}] }];
|
|
1756
|
+
} });
|
|
1757
|
+
|
|
1589
1758
|
class PhonePipe {
|
|
1590
1759
|
transform(value, args) {
|
|
1591
1760
|
if (value && value.length >= 10) {
|
|
@@ -1676,14 +1845,14 @@ class DisableControlDirective {
|
|
|
1676
1845
|
this.ngControl.control[action]();
|
|
1677
1846
|
}
|
|
1678
1847
|
}
|
|
1679
|
-
DisableControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, deps: [{ token:
|
|
1848
|
+
DisableControlDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, deps: [{ token: i2.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1680
1849
|
DisableControlDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: DisableControlDirective, selector: "[disableControl]", inputs: { disableControl: "disableControl" }, ngImport: i0 });
|
|
1681
1850
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DisableControlDirective, decorators: [{
|
|
1682
1851
|
type: Directive,
|
|
1683
1852
|
args: [{
|
|
1684
1853
|
selector: '[disableControl]'
|
|
1685
1854
|
}]
|
|
1686
|
-
}], ctorParameters: function () { return [{ type:
|
|
1855
|
+
}], ctorParameters: function () { return [{ type: i2.NgControl }]; }, propDecorators: { disableControl: [{
|
|
1687
1856
|
type: Input
|
|
1688
1857
|
}] } });
|
|
1689
1858
|
|
|
@@ -1732,6 +1901,167 @@ function refinishDetailsValidator() {
|
|
|
1732
1901
|
};
|
|
1733
1902
|
}
|
|
1734
1903
|
|
|
1904
|
+
class PackageSelectorComponent {
|
|
1905
|
+
constructor(packageService, fb, inj) {
|
|
1906
|
+
this.packageService = packageService;
|
|
1907
|
+
this.fb = fb;
|
|
1908
|
+
this.inj = inj;
|
|
1909
|
+
this.packages = [];
|
|
1910
|
+
this.packageVariations = [];
|
|
1911
|
+
this.packageOptionalItems = [];
|
|
1912
|
+
this.onChangeSubs = [];
|
|
1913
|
+
this.onTouched = () => { };
|
|
1914
|
+
this.touched = false;
|
|
1915
|
+
this.disabled = false;
|
|
1916
|
+
this.createForm();
|
|
1917
|
+
}
|
|
1918
|
+
ngOnChanges(changes) {
|
|
1919
|
+
if (changes.firearmId.currentValue) {
|
|
1920
|
+
this.getPackages();
|
|
1921
|
+
this.packageForm.reset();
|
|
1922
|
+
}
|
|
1923
|
+
else {
|
|
1924
|
+
this.packages = [];
|
|
1925
|
+
this.packageForm.reset();
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
ngAfterViewInit() {
|
|
1929
|
+
const outerControl = this.inj.get(NgControl).control;
|
|
1930
|
+
const prevMarkAsTouched = outerControl.markAsTouched;
|
|
1931
|
+
outerControl.markAsTouched = (...args) => {
|
|
1932
|
+
this.packageForm.markAllAsTouched();
|
|
1933
|
+
prevMarkAsTouched.bind(outerControl)(...args);
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
ngOnDestroy() {
|
|
1937
|
+
for (let sub of this.onChangeSubs) {
|
|
1938
|
+
sub.unsubscribe();
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
getPackages() {
|
|
1942
|
+
this.packageService.readPackagesByFirearm(this.firearmId)
|
|
1943
|
+
.subscribe(packages => {
|
|
1944
|
+
this.packages = packages;
|
|
1945
|
+
if (this.packageForm.controls.package.value) {
|
|
1946
|
+
let packagez = this.packages.find(p => p.id === this.packageForm.controls.package.value.id);
|
|
1947
|
+
this.setPackageOptions(packagez);
|
|
1948
|
+
}
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
createForm() {
|
|
1952
|
+
this.packageForm = this.fb.group({
|
|
1953
|
+
package: null,
|
|
1954
|
+
optionalItems: this.fb.control([]),
|
|
1955
|
+
variations: this.fb.array([])
|
|
1956
|
+
});
|
|
1957
|
+
this.packageForm.controls.package.valueChanges
|
|
1958
|
+
.subscribe(value => {
|
|
1959
|
+
this.packageForm.controls.optionalItems.reset();
|
|
1960
|
+
this.packageOptionalItems = [];
|
|
1961
|
+
this.variations.clear({ emitEvent: false });
|
|
1962
|
+
this.packageVariations = [];
|
|
1963
|
+
if (value === null || value === void 0 ? void 0 : value.id) {
|
|
1964
|
+
this.setPackageOptions(value);
|
|
1965
|
+
}
|
|
1966
|
+
else {
|
|
1967
|
+
if (this.packageDetail) {
|
|
1968
|
+
this.packageDetail.variations = null;
|
|
1969
|
+
this.packageDetail.optionalItems = null;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
get variations() { return this.packageForm.controls.variations; }
|
|
1975
|
+
setPackageOptions(packagez) {
|
|
1976
|
+
var _a, _b;
|
|
1977
|
+
this.packageOptionalItems = packagez.optionalItems;
|
|
1978
|
+
this.packageVariations = packagez.variations;
|
|
1979
|
+
this.variations.clear({ emitEvent: false });
|
|
1980
|
+
for (let v of this.packageVariations) {
|
|
1981
|
+
let selectedVariation = (_b = (_a = this.packageDetail) === null || _a === void 0 ? void 0 : _a.variations) === null || _b === void 0 ? void 0 : _b.find(pv => pv.packageVariationId === v.id);
|
|
1982
|
+
this.variations.push(this.fb.control(selectedVariation, Validators.required), { emitEvent: false });
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
setValue(packageDetail) {
|
|
1986
|
+
this.packageForm.reset(packageDetail);
|
|
1987
|
+
}
|
|
1988
|
+
validate(control) {
|
|
1989
|
+
if (this.packageForm.valid) {
|
|
1990
|
+
return null;
|
|
1991
|
+
}
|
|
1992
|
+
let errors = {};
|
|
1993
|
+
for (let v of this.variations.controls) {
|
|
1994
|
+
if (v.invalid) {
|
|
1995
|
+
return v.errors;
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
return errors;
|
|
1999
|
+
}
|
|
2000
|
+
addControlErrors(allErrors, controlName) {
|
|
2001
|
+
const errors = Object.assign({}, allErrors);
|
|
2002
|
+
const controlErrors = this.packageForm.controls[controlName].errors;
|
|
2003
|
+
if (controlErrors) {
|
|
2004
|
+
errors[controlName] = controlErrors;
|
|
2005
|
+
}
|
|
2006
|
+
return errors;
|
|
2007
|
+
}
|
|
2008
|
+
writeValue(packageDetail) {
|
|
2009
|
+
if (packageDetail) {
|
|
2010
|
+
this.packageDetail = Object.assign({}, packageDetail);
|
|
2011
|
+
this.setValue(packageDetail);
|
|
2012
|
+
}
|
|
2013
|
+
else {
|
|
2014
|
+
this.packageForm.reset();
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
registerOnChange(onChange) {
|
|
2018
|
+
const sub = this.packageForm.valueChanges.subscribe(onChange);
|
|
2019
|
+
this.onChangeSubs.push(sub);
|
|
2020
|
+
}
|
|
2021
|
+
registerOnTouched(onTouched) {
|
|
2022
|
+
this.onTouched = onTouched;
|
|
2023
|
+
}
|
|
2024
|
+
setDisabledState(isDisabled) {
|
|
2025
|
+
this.disabled = isDisabled;
|
|
2026
|
+
if (isDisabled) {
|
|
2027
|
+
this.packageForm.disable();
|
|
2028
|
+
}
|
|
2029
|
+
else {
|
|
2030
|
+
this.packageForm.enable();
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
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 });
|
|
2035
|
+
PackageSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: PackageSelectorComponent, selector: "cgw-package-selector", inputs: { firearmId: "firearmId" }, providers: [
|
|
2036
|
+
{
|
|
2037
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2038
|
+
multi: true,
|
|
2039
|
+
useExisting: PackageSelectorComponent
|
|
2040
|
+
},
|
|
2041
|
+
{
|
|
2042
|
+
provide: NG_VALIDATORS,
|
|
2043
|
+
multi: true,
|
|
2044
|
+
useExisting: PackageSelectorComponent
|
|
2045
|
+
}
|
|
2046
|
+
], 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"] }] });
|
|
2047
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PackageSelectorComponent, decorators: [{
|
|
2048
|
+
type: Component,
|
|
2049
|
+
args: [{ selector: 'cgw-package-selector', providers: [
|
|
2050
|
+
{
|
|
2051
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2052
|
+
multi: true,
|
|
2053
|
+
useExisting: PackageSelectorComponent
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
provide: NG_VALIDATORS,
|
|
2057
|
+
multi: true,
|
|
2058
|
+
useExisting: PackageSelectorComponent
|
|
2059
|
+
}
|
|
2060
|
+
], 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: [""] }]
|
|
2061
|
+
}], ctorParameters: function () { return [{ type: PackageService }, { type: i2.FormBuilder }, { type: i0.Injector }]; }, propDecorators: { firearmId: [{
|
|
2062
|
+
type: Input
|
|
2063
|
+
}] } });
|
|
2064
|
+
|
|
1735
2065
|
class SharedModule {
|
|
1736
2066
|
}
|
|
1737
2067
|
SharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
@@ -1740,13 +2070,23 @@ SharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
|
1740
2070
|
EnumPipe,
|
|
1741
2071
|
DisableControlDirective,
|
|
1742
2072
|
NewLinePipe,
|
|
1743
|
-
FrameMaterialPipe
|
|
2073
|
+
FrameMaterialPipe,
|
|
2074
|
+
PackageSelectorComponent], imports: [CommonModule,
|
|
2075
|
+
DropDownsModule,
|
|
2076
|
+
FormsModule,
|
|
2077
|
+
ReactiveFormsModule], exports: [PhonePipe,
|
|
1744
2078
|
FileNamePipe,
|
|
1745
2079
|
EnumPipe,
|
|
1746
2080
|
NewLinePipe,
|
|
1747
2081
|
DisableControlDirective,
|
|
1748
|
-
FrameMaterialPipe
|
|
1749
|
-
|
|
2082
|
+
FrameMaterialPipe,
|
|
2083
|
+
PackageSelectorComponent] });
|
|
2084
|
+
SharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, imports: [[
|
|
2085
|
+
CommonModule,
|
|
2086
|
+
DropDownsModule,
|
|
2087
|
+
FormsModule,
|
|
2088
|
+
ReactiveFormsModule
|
|
2089
|
+
]] });
|
|
1750
2090
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: SharedModule, decorators: [{
|
|
1751
2091
|
type: NgModule,
|
|
1752
2092
|
args: [{
|
|
@@ -1756,16 +2096,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
1756
2096
|
EnumPipe,
|
|
1757
2097
|
DisableControlDirective,
|
|
1758
2098
|
NewLinePipe,
|
|
1759
|
-
FrameMaterialPipe
|
|
2099
|
+
FrameMaterialPipe,
|
|
2100
|
+
PackageSelectorComponent
|
|
2101
|
+
],
|
|
2102
|
+
imports: [
|
|
2103
|
+
CommonModule,
|
|
2104
|
+
DropDownsModule,
|
|
2105
|
+
FormsModule,
|
|
2106
|
+
ReactiveFormsModule
|
|
1760
2107
|
],
|
|
1761
|
-
imports: [],
|
|
1762
2108
|
exports: [
|
|
1763
2109
|
PhonePipe,
|
|
1764
2110
|
FileNamePipe,
|
|
1765
2111
|
EnumPipe,
|
|
1766
2112
|
NewLinePipe,
|
|
1767
2113
|
DisableControlDirective,
|
|
1768
|
-
FrameMaterialPipe
|
|
2114
|
+
FrameMaterialPipe,
|
|
2115
|
+
PackageSelectorComponent
|
|
1769
2116
|
]
|
|
1770
2117
|
}]
|
|
1771
2118
|
}] });
|
|
@@ -1828,10 +2175,10 @@ class NotificationBarComponent {
|
|
|
1828
2175
|
}
|
|
1829
2176
|
}
|
|
1830
2177
|
NotificationBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, deps: [{ token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1831
|
-
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:
|
|
2178
|
+
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] });
|
|
1832
2179
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NotificationBarComponent, decorators: [{
|
|
1833
2180
|
type: Component,
|
|
1834
|
-
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:
|
|
2181
|
+
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"] }]
|
|
1835
2182
|
}], ctorParameters: function () { return [{ type: NotificationService }]; } });
|
|
1836
2183
|
|
|
1837
2184
|
class NotificationModule {
|
|
@@ -1870,5 +2217,5 @@ var NotificationType;
|
|
|
1870
2217
|
* Generated bundle index. Do not edit.
|
|
1871
2218
|
*/
|
|
1872
2219
|
|
|
1873
|
-
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 };
|
|
2220
|
+
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 };
|
|
1874
2221
|
//# sourceMappingURL=gunsmith-common.mjs.map
|