@colijnit/sharedcomponents 1.0.38 → 1.0.40

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 (42) hide show
  1. package/README.md +24 -24
  2. package/bundles/colijnit-sharedcomponents.umd.js +738 -680
  3. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
  4. package/colijnit-sharedcomponents.d.ts +43 -41
  5. package/colijnit-sharedcomponents.metadata.json +1 -1
  6. package/esm2015/colijnit-sharedcomponents.js +44 -42
  7. package/esm2015/lib/components/send-method-dialog/components/printer-selection/printer-selection.component.js +9 -11
  8. package/esm2015/lib/components/send-method-dialog/components/send-method-printer/send-method-printer.component.js +4 -2
  9. package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +22 -39
  10. package/esm2015/lib/components/stock/components/order-stock-tab/order-stock-tab.component.js +1 -1
  11. package/esm2015/lib/components/stock/components/order-tab/order-tab.component.js +1 -1
  12. package/esm2015/lib/components/stock/components/stock-history/stock-history.component.js +1 -18
  13. package/esm2015/lib/components/stock/components/stock-location/stock-location.component.js +20 -3
  14. package/esm2015/lib/components/stock/stock-information/stock-information.component.js +3 -2
  15. package/esm2015/lib/components/stock/stock-tabs/stock-tabs.component.js +9 -13
  16. package/esm2015/lib/components/stock/stock.component.js +17 -2
  17. package/esm2015/lib/components/stock/stock.module.js +6 -2
  18. package/esm2015/lib/components/stock-statusbar/stock-statusbar.component.js +23 -0
  19. package/esm2015/lib/components/stock-statusbar/stock-statusbar.module.js +19 -0
  20. package/esm2015/lib/enum/icon.enum.js +1 -1
  21. package/esm2015/lib/model/icon-svg.js +1 -1
  22. package/esm2015/lib/service/shared-connector.service.js +17 -1
  23. package/esm2015/lib/service/stock.service.js +6 -1
  24. package/fesm2015/colijnit-sharedcomponents.js +667 -606
  25. package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
  26. package/lib/components/send-method-dialog/components/printer-selection/printer-selection.component.d.ts +1 -1
  27. package/lib/components/send-method-dialog/components/send-method-printer/send-method-printer.component.d.ts +2 -0
  28. package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +4 -7
  29. package/lib/components/stock/components/stock-history/stock-history.component.d.ts +0 -2
  30. package/lib/components/stock/components/stock-location/stock-location.component.d.ts +3 -0
  31. package/lib/components/stock/stock-information/stock-information.component.d.ts +1 -2
  32. package/lib/components/stock/stock-tabs/stock-tabs.component.d.ts +1 -2
  33. package/lib/components/stock/stock.component.d.ts +8 -2
  34. package/lib/components/stock-statusbar/stock-statusbar.component.d.ts +4 -0
  35. package/lib/components/stock-statusbar/stock-statusbar.module.d.ts +2 -0
  36. package/lib/components/stock-statusbar/style/_layout.scss +25 -0
  37. package/lib/components/stock-statusbar/style/_material-definition.scss +0 -0
  38. package/lib/components/stock-statusbar/style/_theme.scss +0 -0
  39. package/lib/components/stock-statusbar/style/material.scss +4 -0
  40. package/lib/service/shared-connector.service.d.ts +1 -0
  41. package/lib/service/stock.service.d.ts +1 -0
  42. package/package.json +1 -1
@@ -23,7 +23,7 @@ import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/factory/bus
23
23
  import { SendMethod as SendMethod$1 } from '@colijnit/mainapi/build/model/send-method.bo';
24
24
  import { PrintStockStickers } from '@colijnit/sharedapi/build/model/print-stock-stickers';
25
25
  import { ArticleStock as ArticleStock$1 } from '@colijnit/articleapi/build/model/article-stock';
26
- import { InputCheckboxModule, IconModule, CoDialogModule, ButtonModule, InputComboBoxModule, CoGridModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule, InputNumberPickerModule, CoDialogWizardModule, InputTextareaModule, ClickoutsideModule, InputDatePickerModule } from '@colijnit/corecomponents_v12';
26
+ import { InputCheckboxModule, IconModule, CoDialogModule, ButtonModule, ClickoutsideModule, InputComboBoxModule, CoGridModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule, InputNumberPickerModule, CoDialogWizardModule, InputTextareaModule, InputDatePickerModule } from '@colijnit/corecomponents_v12';
27
27
  import * as i1 from '@angular/platform-browser';
28
28
  import { DomSanitizer } from '@angular/platform-browser';
29
29
  import { ArticleStockManagement } from '@colijnit/articleapi/build/model/article-stock-management';
@@ -710,6 +710,22 @@ class SharedConnectorService {
710
710
  });
711
711
  });
712
712
  }
713
+ getArtStockStatus(goodId, branchNo, requestedAmount, warehouseId) {
714
+ return __awaiter(this, void 0, void 0, function* () {
715
+ return new Promise((resolve, reject) => {
716
+ return this.articleConnector.getArtStockStatus(goodId, branchNo, requestedAmount, warehouseId).then((result) => {
717
+ if (result.validationResult && result.validationResult.success) {
718
+ if (result.resultObject) {
719
+ resolve(result.resultObject);
720
+ }
721
+ }
722
+ else {
723
+ reject(result.validationMessagesAsString);
724
+ }
725
+ });
726
+ });
727
+ });
728
+ }
713
729
  getStockManagementWarehouses() {
714
730
  return __awaiter(this, void 0, void 0, function* () {
715
731
  return new Promise((resolve, reject) => {
@@ -924,6 +940,11 @@ class StockService {
924
940
  return yield this._sharedService.getStockStatus();
925
941
  });
926
942
  }
943
+ getArtStockStatus(goodId, branchNo, requestedAmount, warehouseId) {
944
+ return __awaiter(this, void 0, void 0, function* () {
945
+ return yield this._sharedService.getArtStockStatus(goodId, branchNo, requestedAmount, warehouseId);
946
+ });
947
+ }
927
948
  // public async getStockStickerTemplates(data: StockStickersPrintLayouts): Promise<StockStickersPrintLayouts[]> {
928
949
  // return await this._sharedService.getStockStickerTemplates(data);
929
950
  // }
@@ -998,6 +1019,10 @@ class StockComponent {
998
1019
  ngOnDestroy() {
999
1020
  this._subscriptions.forEach(subscription => subscription.unsubscribe());
1000
1021
  }
1022
+ ngOnInit() {
1023
+ this.getArtStockStatus();
1024
+ this.getStockManagementWarehouses();
1025
+ }
1001
1026
  handleStockTransferClick(event) {
1002
1027
  this.stockTransferArticleDetails = event;
1003
1028
  this.showStockTransfer = !this.showStockTransfer;
@@ -1022,6 +1047,16 @@ class StockComponent {
1022
1047
  this.stockInformation.forEach((articleStock) => this.allTechnicalStock += articleStock.technicalStock);
1023
1048
  });
1024
1049
  }
1050
+ getArtStockStatus() {
1051
+ return __awaiter(this, void 0, void 0, function* () {
1052
+ this.articleStockState = yield this.stockService.getArtStockStatus(this.articleExtended.goodId);
1053
+ });
1054
+ }
1055
+ getStockManagementWarehouses() {
1056
+ this.stockService.getStockManagementWarehouses().then((warehouses) => {
1057
+ this.warehouses = warehouses;
1058
+ });
1059
+ }
1025
1060
  _handleSettingsLoaded(loaded) {
1026
1061
  return __awaiter(this, void 0, void 0, function* () {
1027
1062
  if (loaded) {
@@ -1048,7 +1083,7 @@ StockComponent.decorators = [
1048
1083
  template: `
1049
1084
  <div class="stock-info-container">
1050
1085
  <co-stock-information [article]="articleExtended"
1051
- [articleStock]=""
1086
+ [articleStockState]="articleStockState"
1052
1087
  [allAvailableStockInformation]="allAvailableStock"
1053
1088
  [allTechnicalStockInformation]="allTechnicalStock"
1054
1089
  >
@@ -1058,6 +1093,7 @@ StockComponent.decorators = [
1058
1093
  [article]="articleExtended"
1059
1094
  (transferIconClicked)="handleStockTransferClick($event)"
1060
1095
  (sendMethodDialogClicked)="handleSendMethodClick($event)"
1096
+ [warehouses]="warehouses"
1061
1097
  ></co-stock-tabs>
1062
1098
 
1063
1099
  <co-dialog *ngIf="showStockTransfer">
@@ -1124,6 +1160,7 @@ StockInformationComponent.decorators = [
1124
1160
  <div class="stock-status">
1125
1161
  <label [textContent]="'STOCK_STATUS'"></label>
1126
1162
  <span [textContent]="article.stockStatus"></span>
1163
+ <co-stock-statusbar [value]="articleStockState"></co-stock-statusbar>
1127
1164
  </div>
1128
1165
  <div class="stock-status">
1129
1166
  <label [textContent]="'AMOUNT_IN_STOCK'"></label>
@@ -1145,7 +1182,7 @@ StockInformationComponent.decorators = [
1145
1182
  StockInformationComponent.ctorParameters = () => [];
1146
1183
  StockInformationComponent.propDecorators = {
1147
1184
  article: [{ type: Input }],
1148
- articleStock: [{ type: Input }],
1185
+ articleStockState: [{ type: Input }],
1149
1186
  allAvailableStockInformation: [{ type: Input }],
1150
1187
  allTechnicalStockInformation: [{ type: Input }]
1151
1188
  };
@@ -1933,14 +1970,13 @@ const sendMethodsWithIcon = [
1933
1970
  new SendMethod(SendMethodType.WebService, "Webservice", Icon.PrintRegular)
1934
1971
  ];
1935
1972
  class SendMethodDialogComponent {
1936
- constructor(iconCacheService, _optionsService, _dictionary, _changeDetector, _sharedService, _sendMethodService) {
1973
+ constructor(iconCacheService, _changeDetector, _sharedService, _sendMethodService) {
1937
1974
  this.iconCacheService = iconCacheService;
1938
- this._optionsService = _optionsService;
1939
- this._dictionary = _dictionary;
1940
1975
  this._changeDetector = _changeDetector;
1941
1976
  this._sharedService = _sharedService;
1942
1977
  this._sendMethodService = _sendMethodService;
1943
1978
  this.icons = Icon;
1979
+ this.printerList = [];
1944
1980
  this.emailLayouts = [];
1945
1981
  this.printLayouts = [];
1946
1982
  this.emailAddresses = [];
@@ -1964,7 +2000,7 @@ class SendMethodDialogComponent {
1964
2000
  this.showEmailTemplate = true;
1965
2001
  this.showWebservice = true;
1966
2002
  this._subscriptions = [];
1967
- this._subscriptions.push(this._optionsService.optionsLoaded.subscribe(loaded => this._handleSettingsLoaded(loaded)), this._sendMethodService.reportingDocumentPrintBaseRequestChanged.subscribe((value) => this.reportingDocumentPrintRequestChange.next(value)), this._sendMethodService.reportingDocumentEmailBaseRequestChanged.subscribe((value) => this.reportingDocumentEmailRequestChange.next(value)), this._sendMethodService.reportingDocumentPdfBaseRequestChanged.subscribe((value) => this.reportingDocumentPdfRequestChange.next(value)));
2003
+ this._subscriptions.push(this._sendMethodService.reportingDocumentPrintBaseRequestChanged.subscribe((value) => this.reportingDocumentPrintRequestChange.next(value)), this._sendMethodService.reportingDocumentEmailBaseRequestChanged.subscribe((value) => this.reportingDocumentEmailRequestChange.next(value)), this._sendMethodService.reportingDocumentPdfBaseRequestChanged.subscribe((value) => this.reportingDocumentPdfRequestChange.next(value)));
1968
2004
  }
1969
2005
  showClass() {
1970
2006
  return true;
@@ -1979,7 +2015,7 @@ class SendMethodDialogComponent {
1979
2015
  if (this.reportingDocumentPdfRequest) {
1980
2016
  this._sendMethodService.reportingDocumentPdfBaseRequest = this.reportingDocumentPdfRequest;
1981
2017
  }
1982
- this._selectDefaultSendMethod();
2018
+ this._initDefaultSendMethod();
1983
2019
  this._prepareVisibleMethods();
1984
2020
  }
1985
2021
  ngOnDestroy() {
@@ -2013,20 +2049,27 @@ class SendMethodDialogComponent {
2013
2049
  this.navigationItems.nativeElement.scrollLeft = this.webServiceItems.nativeElement.offsetLeft - this.navigationItems.nativeElement.offsetLeft;
2014
2050
  }
2015
2051
  }
2016
- _selectDefaultSendMethod() {
2052
+ _initDefaultSendMethod() {
2017
2053
  if (this.defaultSendMethod) {
2018
- const sendMethod = this.sendMethods.find(sm => sm.code === this.defaultSendMethod);
2019
- if (sendMethod) {
2020
- setTimeout(() => {
2021
- this.handleSendMethodClick(sendMethod);
2022
- this.startUp = false;
2023
- });
2024
- }
2054
+ this._selectDefaultSendMethod();
2025
2055
  }
2026
2056
  else {
2057
+ if (this.visibleMethods && this.visibleMethods.length === 1) {
2058
+ this.defaultSendMethod = this.visibleMethods[0];
2059
+ this._selectDefaultSendMethod();
2060
+ }
2027
2061
  this.startUp = false;
2028
2062
  }
2029
2063
  }
2064
+ _selectDefaultSendMethod() {
2065
+ const sendMethod = this.sendMethods.find(sm => sm.code === this.defaultSendMethod);
2066
+ if (sendMethod) {
2067
+ setTimeout(() => {
2068
+ this.handleSendMethodClick(sendMethod);
2069
+ this.startUp = false;
2070
+ });
2071
+ }
2072
+ }
2030
2073
  _prepareVisibleMethods() {
2031
2074
  if (this.visibleMethods && this.visibleMethods.length > 0) {
2032
2075
  this.sendMethods = this.sendMethods.filter(sm => this.visibleMethods.find(vm => vm === sm.code));
@@ -2039,26 +2082,6 @@ class SendMethodDialogComponent {
2039
2082
  this.showSms = this.sendMethods.find(sm => sm.code === SendMethodType.Sms) !== undefined;
2040
2083
  this.showWebservice = this.sendMethods.find(sm => sm.code === SendMethodType.WebService) !== undefined;
2041
2084
  }
2042
- _handleSettingsLoaded(loaded) {
2043
- return __awaiter(this, void 0, void 0, function* () {
2044
- if (loaded) {
2045
- yield this._initConnection().then();
2046
- this.upAndLoaded = true;
2047
- }
2048
- });
2049
- }
2050
- _initConnection() {
2051
- return __awaiter(this, void 0, void 0, function* () {
2052
- // await this._connector.connect(this._optionsService.options);
2053
- if (this._optionsService.options.url) {
2054
- this._dictionary.rootUrl = this._optionsService.options.url.replace('/ajaxservice', '');
2055
- }
2056
- yield this._dictionary.setDictionary(this._optionsService.options.languageCode);
2057
- setTimeout(() => {
2058
- this._changeDetector.detectChanges();
2059
- });
2060
- });
2061
- }
2062
2085
  }
2063
2086
  SendMethodDialogComponent.decorators = [
2064
2087
  { type: Component, args: [{
@@ -2084,6 +2107,7 @@ SendMethodDialogComponent.decorators = [
2084
2107
  </div>
2085
2108
  <div #printItems class="send-method-navigation-content co-small-scrollbar" *ngIf="showPrint">
2086
2109
  <co-send-method-printer
2110
+ [printerList]="printerList"
2087
2111
  [layouts]="printLayouts"
2088
2112
  ></co-send-method-printer>
2089
2113
  </div>
@@ -2126,8 +2150,6 @@ SendMethodDialogComponent.decorators = [
2126
2150
  ];
2127
2151
  SendMethodDialogComponent.ctorParameters = () => [
2128
2152
  { type: IconCacheService },
2129
- { type: OptionsService },
2130
- { type: DictionaryService },
2131
2153
  { type: ChangeDetectorRef },
2132
2154
  { type: SharedService },
2133
2155
  { type: SendMethodService }
@@ -2141,6 +2163,7 @@ SendMethodDialogComponent.propDecorators = {
2141
2163
  emailTemplateItems: [{ type: ViewChild, args: ['emailTemplateItems', { read: ElementRef },] }],
2142
2164
  smsItems: [{ type: ViewChild, args: ['smsItems', { read: ElementRef },] }],
2143
2165
  webServiceItems: [{ type: ViewChild, args: ['webServiceItems', { read: ElementRef },] }],
2166
+ printerList: [{ type: Input }],
2144
2167
  reportingDocumentPrintRequest: [{ type: Input }],
2145
2168
  reportingDocumentEmailRequest: [{ type: Input }],
2146
2169
  reportingDocumentPdfRequest: [{ type: Input }],
@@ -2316,6 +2339,7 @@ SendMethodEmailModule.decorators = [
2316
2339
  class SendMethodPrinterComponent {
2317
2340
  constructor(sendMethodService) {
2318
2341
  this.sendMethodService = sendMethodService;
2342
+ this.printerList = [];
2319
2343
  this.layouts = [];
2320
2344
  }
2321
2345
  showClass() {
@@ -2334,7 +2358,7 @@ SendMethodPrinterComponent.decorators = [
2334
2358
  { type: Component, args: [{
2335
2359
  selector: 'co-send-method-printer',
2336
2360
  template: `
2337
- <co-printer-selection></co-printer-selection>
2361
+ <co-printer-selection [printers]="printerList"></co-printer-selection>
2338
2362
  <co-layout-selection
2339
2363
  [(request)]="sendMethodService.reportingDocumentPrintBaseRequest"
2340
2364
  [layouts]="layouts"
@@ -2357,6 +2381,7 @@ SendMethodPrinterComponent.ctorParameters = () => [
2357
2381
  { type: SendMethodService }
2358
2382
  ];
2359
2383
  SendMethodPrinterComponent.propDecorators = {
2384
+ printerList: [{ type: Input }],
2360
2385
  layouts: [{ type: Input }],
2361
2386
  showClass: [{ type: HostBinding, args: ['class.co-send-method-printer',] }]
2362
2387
  };
@@ -2374,16 +2399,13 @@ class PrinterSelectionComponent {
2374
2399
  return true;
2375
2400
  }
2376
2401
  ngOnInit() {
2377
- this._service.getAllPrinters().then((printers) => {
2378
- this.printers = printers;
2379
- if (!this.sendMethodService.reportingDocumentPrintBaseRequest.printerName) {
2380
- const defaultPrinter = this.printers.find(p => p.isDefault);
2381
- if (defaultPrinter) {
2382
- this.sendMethodService.reportingDocumentPrintBaseRequest.printerName = defaultPrinter.name;
2383
- this.sendMethodService.reportingDocumentPrintBaseRequestChanged.next(this.sendMethodService.reportingDocumentPrintBaseRequest);
2384
- }
2402
+ if (!this.sendMethodService.reportingDocumentPrintBaseRequest.printerName && this.printers && this.printers.length > 0) {
2403
+ const defaultPrinter = this.printers.find(p => p.isDefault);
2404
+ if (defaultPrinter) {
2405
+ this.sendMethodService.reportingDocumentPrintBaseRequest.printerName = defaultPrinter.name;
2406
+ this.sendMethodService.reportingDocumentPrintBaseRequestChanged.next(this.sendMethodService.reportingDocumentPrintBaseRequest);
2385
2407
  }
2386
- });
2408
+ }
2387
2409
  }
2388
2410
  handlePrinterClicked(printer) {
2389
2411
  this.sendMethodService.reportingDocumentPrintBaseRequest.printerName = printer.name;
@@ -2428,6 +2450,7 @@ PrinterSelectionComponent.ctorParameters = () => [
2428
2450
  { type: SharedService }
2429
2451
  ];
2430
2452
  PrinterSelectionComponent.propDecorators = {
2453
+ printers: [{ type: Input }],
2431
2454
  showClass: [{ type: HostBinding, args: ['class.co-printer-selection',] }]
2432
2455
  };
2433
2456
 
@@ -2666,13 +2689,13 @@ class StockTabsComponent {
2666
2689
  this.sendMethodDialogClicked = new EventEmitter();
2667
2690
  this.tabs = [
2668
2691
  { title: 'Overzicht', active: true },
2669
- { title: 'Voorraaddetails', active: false, clickHandler: this.getStockManagementWarehouses.bind(this) },
2692
+ { title: 'Voorraaddetails', active: false },
2670
2693
  { title: 'In order', active: false, clickHandler: this.getInOrderData.bind(this) },
2671
2694
  { title: 'In bestelling', active: false, clickHandler: this.getOrderData.bind(this) },
2672
2695
  { title: 'Historie', active: false },
2673
2696
  ];
2674
2697
  this.historyTabs = [
2675
- { title: 'Voorraad', active: false, clickHandler: this.getStockHistory.bind(this) },
2698
+ { title: 'Voorraad', active: true, clickHandler: this.getStockHistory.bind(this) },
2676
2699
  { title: 'Order voorraad', active: false, clickHandler: this.getOrderSupplyStockHistory.bind(this) },
2677
2700
  { title: 'Order commissie', active: false, clickHandler: this.getOrderCommissionStockHistory.bind(this) },
2678
2701
  { title: 'Bestelling', active: false, clickHandler: this.getOrderStockHistory.bind(this) },
@@ -2689,7 +2712,7 @@ class StockTabsComponent {
2689
2712
  if (!this.stockHistory) {
2690
2713
  const stockHistoryInformation = new GetStockHistoryRequest();
2691
2714
  stockHistoryInformation.type = "V";
2692
- stockHistoryInformation.goodId = this.article;
2715
+ stockHistoryInformation.goodId = this.article.goodId;
2693
2716
  this.stockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2694
2717
  }
2695
2718
  });
@@ -2699,7 +2722,7 @@ class StockTabsComponent {
2699
2722
  if (!this.orderSupplyStockHistory) {
2700
2723
  const stockHistoryInformation = new GetStockHistoryRequest();
2701
2724
  stockHistoryInformation.type = "O";
2702
- stockHistoryInformation.goodId = this.article;
2725
+ stockHistoryInformation.goodId = this.article.goodId;
2703
2726
  this.orderSupplyStockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2704
2727
  }
2705
2728
  });
@@ -2709,7 +2732,7 @@ class StockTabsComponent {
2709
2732
  if (!this.orderCommissionStockHistory) {
2710
2733
  const stockHistoryInformation = new GetStockHistoryRequest();
2711
2734
  stockHistoryInformation.type = "C";
2712
- stockHistoryInformation.goodId = this.article;
2735
+ stockHistoryInformation.goodId = this.article.goodId;
2713
2736
  this.orderCommissionStockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2714
2737
  }
2715
2738
  });
@@ -2719,7 +2742,7 @@ class StockTabsComponent {
2719
2742
  if (!this.orderStockHistory) {
2720
2743
  const stockHistoryInformation = new GetStockHistoryRequest();
2721
2744
  stockHistoryInformation.type = "B";
2722
- stockHistoryInformation.goodId = this.article;
2745
+ stockHistoryInformation.goodId = this.article.goodId;
2723
2746
  this.orderStockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2724
2747
  }
2725
2748
  });
@@ -2729,7 +2752,7 @@ class StockTabsComponent {
2729
2752
  if (!this.orderAllocationStockHistory) {
2730
2753
  const stockHistoryInformation = new GetStockHistoryRequest();
2731
2754
  stockHistoryInformation.type = "T";
2732
- stockHistoryInformation.goodId = this.article;
2755
+ stockHistoryInformation.goodId = this.article.goodId;
2733
2756
  this.orderAllocationStockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2734
2757
  }
2735
2758
  });
@@ -2744,11 +2767,6 @@ class StockTabsComponent {
2744
2767
  }
2745
2768
  });
2746
2769
  }
2747
- getStockManagementWarehouses() {
2748
- this._stockService.getStockManagementWarehouses().then((warehouses) => {
2749
- this.warehouses = warehouses;
2750
- });
2751
- }
2752
2770
  getOrderData() {
2753
2771
  return __awaiter(this, void 0, void 0, function* () {
2754
2772
  if (!this.orderInformation) {
@@ -2821,6 +2839,7 @@ StockTabsComponent.ctorParameters = () => [
2821
2839
  StockTabsComponent.propDecorators = {
2822
2840
  stockInformation: [{ type: Input }],
2823
2841
  article: [{ type: Input }],
2842
+ warehouses: [{ type: Input }],
2824
2843
  transferIconClicked: [{ type: Output }],
2825
2844
  sendMethodDialogClicked: [{ type: Output }]
2826
2845
  };
@@ -2907,7 +2926,6 @@ class StockLocationComponent {
2907
2926
  this.icons = Icon;
2908
2927
  this.transferIconClicked = new EventEmitter();
2909
2928
  this.sendMethodDialogClicked = new EventEmitter();
2910
- this.selectedWarehouse = 0;
2911
2929
  this.dataWareHouseFields = { text: "warehouseDescription", value: "warehouseNo" };
2912
2930
  this.dataLocationFields = { text: "locationNo", value: "locationNo" };
2913
2931
  this.articleDetailsInformation = new ArticleStockManagement();
@@ -2936,6 +2954,9 @@ class StockLocationComponent {
2936
2954
  this.stockLocations = locations;
2937
2955
  });
2938
2956
  }
2957
+ locationChanged(event) {
2958
+ this.selectedLocation = event;
2959
+ }
2939
2960
  amountInStockChanged(data) {
2940
2961
  this.selectedArticleDetailsData.amountInStock = data;
2941
2962
  }
@@ -2945,6 +2966,19 @@ class StockLocationComponent {
2945
2966
  handleStockTransferClick(event) {
2946
2967
  this.transferIconClicked.emit(event);
2947
2968
  }
2969
+ onOkClickSendLocations() {
2970
+ return __awaiter(this, void 0, void 0, function* () {
2971
+ this.selectedArticleDetailsData.selected = true;
2972
+ this.selectedArticleDetailsData.goodId = this.article.goodId;
2973
+ this.selectedArticleDetailsData.entryDate = new Date();
2974
+ this.selectedArticleDetailsData.warehouseNo = this.selectedWarehouse;
2975
+ this.selectedArticleDetailsData.locationNo = this.selectedLocation;
2976
+ yield this._stockService.updateArticleDetails(this.selectedArticleDetailsData);
2977
+ yield this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
2978
+ this.articleDetails = details;
2979
+ });
2980
+ });
2981
+ }
2948
2982
  }
2949
2983
  StockLocationComponent.decorators = [
2950
2984
  { type: Component, args: [{
@@ -2967,11 +3001,11 @@ StockLocationComponent.decorators = [
2967
3001
  class="simple-grid"
2968
3002
  [rowsPerPage]="20"
2969
3003
  [showAdd]="true"
2970
- [showDelete]="true"
2971
3004
  [inlineEdit]="true"
2972
3005
  (dblClickRow)="lockSelectedRow($event)"
2973
3006
  [rightToolbar]="true"
2974
3007
  [showToolbar]="true"
3008
+ (keydown.enter)="onOkClickSendLocations()"
2975
3009
  >
2976
3010
  <co-simple-grid-column [headerText]="'LOCATION'" [field]="'locationNo'">
2977
3011
  <ng-template #editTemplate let-row="row">
@@ -2981,6 +3015,7 @@ StockLocationComponent.decorators = [
2981
3015
  [placeholder]="'LOCATION'"
2982
3016
  (click)="onLocationDropdownClick()"
2983
3017
  [required]="true"
3018
+ (modelChange)="locationChanged($event)"
2984
3019
  ></co-drop-down-list>
2985
3020
  </ng-template>
2986
3021
  </co-simple-grid-column>
@@ -3069,20 +3104,6 @@ class StockHistoryComponent {
3069
3104
  this._stockService = _stockService;
3070
3105
  this.icons = Icon;
3071
3106
  }
3072
- openSendMethodDialog(data) {
3073
- if (!(this._stockService.printLayoutParams instanceof PrintPriceStickers)) {
3074
- this._stockService.printLayoutParams.goodId = data.goodId;
3075
- this._stockService.printLayoutParams.warehouse = data.warehouseNo;
3076
- }
3077
- }
3078
- getStockHistory() {
3079
- return __awaiter(this, void 0, void 0, function* () {
3080
- const stockHistoryInformation = new GetStockHistoryRequest();
3081
- stockHistoryInformation.type = "B";
3082
- stockHistoryInformation.goodId = this.articleGoodId;
3083
- this.stockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
3084
- });
3085
- }
3086
3107
  }
3087
3108
  StockHistoryComponent.decorators = [
3088
3109
  { type: Component, args: [{
@@ -3356,698 +3377,738 @@ AllocationStockHistoryComponent.propDecorators = {
3356
3377
  allocationStockHistory: [{ type: Input }]
3357
3378
  };
3358
3379
 
3359
- class StockModule {
3360
- }
3361
- StockModule.decorators = [
3362
- { type: NgModule, args: [{
3363
- imports: [
3364
- InputComboBoxModule,
3365
- CoGridModule,
3366
- ButtonModule,
3367
- CommonModule,
3368
- InputRadioButtonModule,
3369
- DropDownModule,
3370
- SimpleGridModule,
3371
- ImageModule,
3372
- InputTextModule,
3373
- SendMethodDialogModule,
3374
- IconModule,
3375
- InputNumberPickerModule,
3376
- CoDialogWizardModule,
3377
- InputTextareaModule,
3378
- TabBarModule,
3379
- CoDialogModule
3380
- ],
3381
- declarations: [
3382
- StockComponent,
3383
- StockInformationComponent,
3384
- StockInformationGridComponent,
3385
- StockTransferComponent,
3386
- StockChangeAmountComponent,
3387
- StockTabComponent,
3388
- OrderTabComponent,
3389
- StockTabsComponent,
3390
- StockHistoryTabsComponent,
3391
- OrderStockTabComponent,
3392
- StockLocationComponent,
3393
- StockHistoryComponent,
3394
- OrderSupplyStockHistoryComponent,
3395
- OrderCommissionStockHistoryComponent,
3396
- OrderStockHistoryComponent,
3397
- AllocationStockHistoryComponent
3398
- ],
3399
- exports: [
3400
- StockComponent
3401
- ],
3402
- providers: [
3403
- StockService
3404
- ]
3405
- },] }
3406
- ];
3407
-
3408
- var KeyboardCode;
3409
- (function (KeyboardCode) {
3410
- KeyboardCode["Backspace"] = "Backspace";
3411
- KeyboardCode["Digit0"] = "Digit0";
3412
- KeyboardCode["Digit1"] = "Digit1";
3413
- KeyboardCode["Digit2"] = "Digit2";
3414
- KeyboardCode["Digit3"] = "Digit3";
3415
- KeyboardCode["Digit4"] = "Digit4";
3416
- KeyboardCode["Digit5"] = "Digit5";
3417
- KeyboardCode["Digit6"] = "Digit6";
3418
- KeyboardCode["Digit7"] = "Digit7";
3419
- KeyboardCode["Digit8"] = "Digit8";
3420
- KeyboardCode["Digit9"] = "Digit9";
3421
- KeyboardCode["Enter"] = "Enter";
3422
- KeyboardCode["Escape"] = "Escape";
3423
- KeyboardCode["Minus"] = "Minus";
3424
- KeyboardCode["Numpad0"] = "Numpad0";
3425
- KeyboardCode["Numpad1"] = "Numpad1";
3426
- KeyboardCode["Numpad2"] = "Numpad2";
3427
- KeyboardCode["Numpad3"] = "Numpad3";
3428
- KeyboardCode["Numpad4"] = "Numpad4";
3429
- KeyboardCode["Numpad5"] = "Numpad5";
3430
- KeyboardCode["Numpad6"] = "Numpad6";
3431
- KeyboardCode["Numpad7"] = "Numpad7";
3432
- KeyboardCode["Numpad8"] = "Numpad8";
3433
- KeyboardCode["Numpad9"] = "Numpad9";
3434
- KeyboardCode["NumpadDecimal"] = "NumpadDecimal";
3435
- KeyboardCode["NumpadEnter"] = "NumpadEnter";
3436
- KeyboardCode["NumpadSubtract"] = "NumpadSubtract";
3437
- KeyboardCode["Period"] = "Period";
3438
- })(KeyboardCode || (KeyboardCode = {}));
3380
+ var GaugeColor;
3381
+ (function (GaugeColor) {
3382
+ GaugeColor["Lowest"] = "#E0E0E0";
3383
+ GaugeColor["Low"] = "#fff7b8";
3384
+ GaugeColor["MediumLow"] = "#ffe367";
3385
+ GaugeColor["MediumHigh"] = "#ffc15b";
3386
+ GaugeColor["High"] = "#F88952";
3387
+ GaugeColor["Highest"] = "#5FDCB3";
3388
+ })(GaugeColor || (GaugeColor = {}));
3439
3389
 
3440
- class KeyPadComponent {
3441
- constructor(iconCacheService) {
3442
- this.iconCacheService = iconCacheService;
3443
- this.icons = Icon;
3444
- this.showValue = true;
3445
- this.emitModelChangeOnEnter = true;
3446
- this.modelChange = new EventEmitter();
3447
- this.internalModelChange = new EventEmitter();
3448
- this.enterClick = new EventEmitter();
3449
- this._validKeyMap = new Map([
3450
- [KeyboardCode.Digit0, "0"],
3451
- [KeyboardCode.Digit1, "1"],
3452
- [KeyboardCode.Digit2, "2"],
3453
- [KeyboardCode.Digit3, "3"],
3454
- [KeyboardCode.Digit4, "4"],
3455
- [KeyboardCode.Digit5, "5"],
3456
- [KeyboardCode.Digit6, "6"],
3457
- [KeyboardCode.Digit7, "7"],
3458
- [KeyboardCode.Digit8, "8"],
3459
- [KeyboardCode.Digit9, "9"],
3460
- [KeyboardCode.Numpad0, "0"],
3461
- [KeyboardCode.Numpad1, "1"],
3462
- [KeyboardCode.Numpad2, "2"],
3463
- [KeyboardCode.Numpad3, "3"],
3464
- [KeyboardCode.Numpad4, "4"],
3465
- [KeyboardCode.Numpad5, "5"],
3466
- [KeyboardCode.Numpad6, "6"],
3467
- [KeyboardCode.Numpad7, "7"],
3468
- [KeyboardCode.Numpad8, "8"],
3469
- [KeyboardCode.Numpad9, "9"],
3470
- [KeyboardCode.NumpadDecimal, "."],
3471
- [KeyboardCode.Period, "."]
3472
- ]);
3473
- this.isNegative = false;
3474
- this._model = 0;
3475
- this._internalModel = "0";
3476
- this._maxCharacters = 11;
3390
+ class CoCircularGaugeComponent {
3391
+ constructor() {
3392
+ this._color = GaugeColor.Low;
3393
+ this.majorTicks = {
3394
+ height: 0,
3395
+ };
3396
+ this.minorTicks = {
3397
+ height: 0
3398
+ };
3399
+ this.labelStyle = {
3400
+ position: 'Inside', useRangeColor: true,
3401
+ font: { size: '0px', fontFamily: 'inherit' }
3402
+ };
3403
+ this.lineStyle = {
3404
+ width: 0
3405
+ };
3406
+ this.ranges = [
3407
+ {
3408
+ start: 1, end: 100,
3409
+ radius: '13px',
3410
+ startWidth: 3, endWidth: 3,
3411
+ color: '#E0E0E0',
3412
+ roundedCornerRadius: 0
3413
+ },
3414
+ ];
3477
3415
  }
3478
- set model(value) {
3479
- this._model = value;
3480
- this._internalModel = this._model + "";
3416
+ set value(value) {
3417
+ this._value = value;
3418
+ this._setColor();
3481
3419
  }
3482
- get model() {
3483
- return this._model;
3420
+ get value() {
3421
+ return this._value;
3422
+ }
3423
+ get color() {
3424
+ return this._color;
3484
3425
  }
3485
3426
  showClass() {
3486
3427
  return true;
3487
3428
  }
3488
- handleKeyDown(event) {
3489
- this._keyDown(event);
3490
- }
3491
- set internalModel(value) {
3492
- this._internalModel = value;
3493
- this.isNegative = parseFloat(this._internalModel) < 0;
3494
- this.internalModelChange.emit(this._internalModel);
3495
- }
3496
- get internalModel() {
3497
- return this._internalModel;
3498
- }
3499
- handleMinusClick(event) {
3500
- const model = parseFloat(this.internalModel);
3501
- if (model !== 0) {
3502
- if (model < 0) {
3503
- this.internalModel = Math.abs(model) + "";
3504
- }
3505
- else {
3506
- this.internalModel = -model + "";
3507
- }
3508
- }
3509
- this._emitModelChange();
3510
- }
3511
- handleClearClick(event) {
3512
- this.internalModel = "0";
3513
- this._emitModelChange();
3429
+ getAxes() {
3430
+ return [{
3431
+ minimum: 0,
3432
+ maximum: 100,
3433
+ radius: '15px',
3434
+ startAngle: 1,
3435
+ endAngle: 360,
3436
+ majorTicks: this.majorTicks,
3437
+ minorTicks: this.minorTicks,
3438
+ labelStyle: this.labelStyle,
3439
+ lineStyle: this.lineStyle,
3440
+ ranges: this.ranges,
3441
+ pointers: this.getPointers(),
3442
+ annotations: this.getAnnotations(),
3443
+ }];
3514
3444
  }
3515
- handleBsClick(event) {
3516
- let wish = this.internalModel;
3517
- wish = wish.slice(0, wish.length - 1) || "0";
3518
- if (!isNaN(parseFloat(wish))) {
3519
- this.internalModel = parseFloat(wish) + "";
3445
+ getPointers() {
3446
+ if (this.value) {
3447
+ return [{
3448
+ roundedCornerRadius: 0,
3449
+ value: this.value,
3450
+ type: 'RangeBar',
3451
+ radius: '13px',
3452
+ color: this.color,
3453
+ border: {
3454
+ width: 0
3455
+ },
3456
+ animation: {
3457
+ enable: false
3458
+ },
3459
+ pointerWidth: 3
3460
+ }];
3520
3461
  }
3521
- this._emitModelChange();
3522
- }
3523
- handleButtonClick(chr) {
3524
- this._updateModel(chr);
3525
- }
3526
- handleEnterClick(event) {
3527
- this._emitModelChange(true);
3528
- this.enterClick.emit();
3529
3462
  }
3530
- _updateModel(value) {
3531
- if (value === undefined || value === null ||
3532
- (value === '.' && this.internalModel.indexOf('.') > -1) ||
3533
- this.internalModel.length >= this._maxCharacters) {
3534
- return;
3463
+ ;
3464
+ getAnnotations() {
3465
+ if (this.value !== undefined) {
3466
+ const label = this.value ? this.value + "%" : "0%";
3467
+ return [{
3468
+ content: '<div class="annotation" style="width:20px;height:20px;">' +
3469
+ '<div class="annotation-label">' + label + '</div></div>',
3470
+ zIndex: '10',
3471
+ }];
3535
3472
  }
3536
- this.internalModel = this.internalModel !== "0" ? this.internalModel + value : value;
3537
- this._emitModelChange();
3538
3473
  }
3539
- _keyDown(event) {
3540
- if (this._isEnter(event)) {
3541
- this.handleEnterClick(event);
3474
+ _setColor() {
3475
+ if (this.value <= 0) {
3476
+ this._color = GaugeColor.Lowest;
3542
3477
  }
3543
- else if (this._isMinus(event)) {
3544
- this.handleMinusClick(event);
3478
+ else if (this.value >= 1 && this.value < 25) {
3479
+ this._color = GaugeColor.Low;
3545
3480
  }
3546
- else if (this._isEscape(event)) {
3547
- this.handleClearClick(event);
3481
+ else if (this.value >= 25 && this.value < 50) {
3482
+ this._color = GaugeColor.MediumLow;
3548
3483
  }
3549
- else if (this._isBackspace(event)) {
3550
- this.handleBsClick(event);
3484
+ else if (this.value >= 50 && this.value < 75) {
3485
+ this._color = GaugeColor.MediumHigh;
3551
3486
  }
3552
- else {
3553
- this._updateModel(this._validKeyMap.get(event.code));
3487
+ else if (this.value >= 75 && this.value < 100) {
3488
+ this._color = GaugeColor.High;
3554
3489
  }
3555
- }
3556
- _isEnter(event) {
3557
- return event.code === KeyboardCode.Enter || event.code === KeyboardCode.NumpadEnter;
3558
- }
3559
- _isMinus(event) {
3560
- return event.code === KeyboardCode.Minus || event.code === KeyboardCode.NumpadSubtract;
3561
- }
3562
- _isEscape(event) {
3563
- return event.code === KeyboardCode.Escape;
3564
- }
3565
- _isBackspace(event) {
3566
- return event.code === KeyboardCode.Backspace;
3567
- }
3568
- _emitModelChange(enter = false) {
3569
- if ((enter && this.emitModelChangeOnEnter) || (!enter && !this.emitModelChangeOnEnter)) {
3570
- const model = parseFloat(this.internalModel);
3571
- if (!isNaN(model)) {
3572
- if (enter && this.emitModelChangeOnEnter) {
3573
- this.model = model;
3574
- }
3575
- this.modelChange.emit(model);
3576
- }
3490
+ else if (this.value >= 100) {
3491
+ this._color = GaugeColor.Highest;
3577
3492
  }
3578
3493
  }
3579
3494
  }
3580
- KeyPadComponent.decorators = [
3495
+ CoCircularGaugeComponent.decorators = [
3581
3496
  { type: Component, args: [{
3582
- selector: 'co-key-pad',
3497
+ selector: "co-circular-gauge",
3583
3498
  template: `
3584
- <div class="key-pad-wrapper">
3585
- <div class="key-pad-model-wrapper" *ngIf="showValue">
3586
- <div class="key-pad-model" [textContent]="internalModel" [class.negative]="isNegative"></div>
3587
- </div>
3588
- <div class="key-pad-button-wrapper">
3589
- <div class="key-pad-button button-7" [textContent]="'7'" (click)="handleButtonClick('7')"></div>
3590
- <div class="key-pad-button button-8" [textContent]="'8'" (click)="handleButtonClick('8')"></div>
3591
- <div class="key-pad-button button-9" [textContent]="'9'" (click)="handleButtonClick('9')"></div>
3592
- <div class="key-pad-button button-bs" (click)="handleBsClick($event)">
3593
- <co-icon [iconData]="iconCacheService.getIcon(icons.DeleteLeftRegular)"></co-icon>
3594
- </div>
3595
- <div class="key-pad-button button-4" [textContent]="'4'" (click)="handleButtonClick('4')"></div>
3596
- <div class="key-pad-button button-5" [textContent]="'5'" (click)="handleButtonClick('5')"></div>
3597
- <div class="key-pad-button button-6" [textContent]="'6'" (click)="handleButtonClick('6')"></div>
3598
- <div class="key-pad-button button-minus" [textContent]="'-'" (click)="handleMinusClick($event)"></div>
3599
- <div class="key-pad-button button-1" [textContent]="'1'" (click)="handleButtonClick('1')"></div>
3600
- <div class="key-pad-button button-2" [textContent]="'2'" (click)="handleButtonClick('2')"></div>
3601
- <div class="key-pad-button button-3" [textContent]="'3'" (click)="handleButtonClick('3')"></div>
3602
- <div class="key-pad-button button-enter" (click)="handleEnterClick($event)">
3603
- <span [textContent]="'enter'"></span>
3604
- </div>
3605
- <div class="key-pad-button button-0" [textContent]="'0'" (click)="handleButtonClick('0')"></div>
3606
- <div class="key-pad-button button-dot" [textContent]="'.'" (click)="handleButtonClick('.')"></div>
3607
- </div>
3499
+ <div class="circular-gauge-wrapper">
3500
+ <ejs-circulargauge
3501
+ class="circular-gauge"
3502
+ [width]="'100%'"
3503
+ [axes]="getAxes()">
3504
+ </ejs-circulargauge>
3608
3505
  </div>
3609
- `,
3506
+ `,
3610
3507
  encapsulation: ViewEncapsulation.None
3611
3508
  },] }
3612
3509
  ];
3613
- KeyPadComponent.ctorParameters = () => [
3614
- { type: IconCacheService }
3615
- ];
3616
- KeyPadComponent.propDecorators = {
3617
- model: [{ type: Input }],
3618
- showValue: [{ type: Input }],
3619
- emitModelChangeOnEnter: [{ type: Input }],
3620
- modelChange: [{ type: Output }],
3621
- internalModelChange: [{ type: Output }],
3622
- enterClick: [{ type: Output }],
3623
- showClass: [{ type: HostBinding, args: ['class.co-key-pad',] }],
3624
- handleKeyDown: [{ type: HostListener, args: ['window:keydown', ['$event'],] }]
3510
+ CoCircularGaugeComponent.propDecorators = {
3511
+ circulargauge: [{ type: ViewChild, args: ['circulargauge',] }],
3512
+ value: [{ type: Input }],
3513
+ showClass: [{ type: HostBinding, args: ["class.co-circular-gauge",] }]
3625
3514
  };
3626
3515
 
3627
- class KeyPadModule {
3516
+ class CoCircularGaugeModule {
3628
3517
  }
3629
- KeyPadModule.decorators = [
3518
+ CoCircularGaugeModule.decorators = [
3630
3519
  { type: NgModule, args: [{
3631
3520
  imports: [
3632
3521
  CommonModule,
3633
- IconModule
3522
+ CircularGaugeModule
3634
3523
  ],
3635
3524
  declarations: [
3636
- KeyPadComponent
3525
+ CoCircularGaugeComponent
3637
3526
  ],
3638
3527
  exports: [
3639
- KeyPadComponent
3528
+ CoCircularGaugeComponent
3640
3529
  ]
3641
3530
  },] }
3642
3531
  ];
3643
3532
 
3644
- class LayoutSwitcherComponent {
3645
- constructor(iconCacheService) {
3646
- this.iconCacheService = iconCacheService;
3647
- this.icon = Icon;
3648
- this.layoutItems = [];
3649
- this.layoutSwitchEmit = new EventEmitter();
3650
- this.showMaskSidebar = false;
3651
- this._activeIndex = 0;
3533
+ class CoLinearGaugeComponent {
3534
+ constructor() {
3535
+ this.color = GaugeColor.Low;
3536
+ }
3537
+ set value(value) {
3538
+ this._value = value;
3539
+ this._setColor();
3540
+ }
3541
+ get value() {
3542
+ return this._value;
3652
3543
  }
3653
3544
  showClass() {
3654
3545
  return true;
3655
3546
  }
3656
- get activeIndex() {
3657
- return this._activeIndex;
3658
- }
3659
- set activeIndex(index) {
3660
- this._activeIndex = index;
3661
- this.toggleMaskSidebar();
3662
- this.layoutSwitchEmit.emit(this.layoutItems[index]);
3547
+ getStyle() {
3548
+ return `linear-gradient(90deg, ${this.color} 0 ${this.value}%, white ${this.value}% 100%`;
3663
3549
  }
3664
- toggleMaskSidebar() {
3665
- this.showMaskSidebar = !this.showMaskSidebar;
3550
+ _setColor() {
3551
+ if (this.value <= 0) {
3552
+ this.color = GaugeColor.Lowest;
3553
+ }
3554
+ else if (this.value >= 1 && this.value < 25) {
3555
+ this.color = GaugeColor.Low;
3556
+ }
3557
+ else if (this.value >= 25 && this.value < 50) {
3558
+ this.color = GaugeColor.MediumLow;
3559
+ }
3560
+ else if (this.value >= 50 && this.value < 75) {
3561
+ this.color = GaugeColor.MediumHigh;
3562
+ }
3563
+ else if (this.value >= 75 && this.value < 100) {
3564
+ this.color = GaugeColor.High;
3565
+ }
3566
+ else if (this.value >= 100) {
3567
+ this.color = GaugeColor.Highest;
3568
+ }
3666
3569
  }
3667
3570
  }
3668
- LayoutSwitcherComponent.decorators = [
3571
+ CoLinearGaugeComponent.decorators = [
3669
3572
  { type: Component, args: [{
3670
- selector: "co-layout-switcher",
3573
+ selector: "co-linear-gauge",
3671
3574
  template: `
3672
- <div class="mask-wrapper" [class.mask-wrapper-active]='showMaskSidebar' @showHideSidebar>
3673
- <div class="icon-wrapper" (click)="toggleMaskSidebar()">
3674
- <co-icon class="icon-mask" [iconData]="iconCacheService.getIcon(icon.BringForwardRegular)" [@positionIcon]="showMaskSidebar"></co-icon>
3675
-
3676
- <co-icon class='icon-mask-sidebar-handle' [@positionHandle]='showMaskSidebar' [iconData]="showMaskSidebar ? iconCacheService.getIcon(this.icon.AngleLeftSolid) : iconCacheService.getIcon(this.icon.AngleRightSolid)"></co-icon>
3677
- </div>
3678
-
3679
- <div class="mask-content" *ngIf="showMaskSidebar" @showHideSidebar>
3680
- <span *ngFor='let item of this.layoutItems' [class.active]="this.activeIndex === this.layoutItems.indexOf(item)" [textContent]="item" (click)='activeIndex = this.layoutItems.indexOf(item)' ></span>
3681
- </div>
3682
- </div>
3683
-
3684
- `,
3685
- animations: [
3686
- trigger("showHideSidebar", [
3687
- state("void", style({ "width": "0" })),
3688
- state("*", style({ "width": "*" })),
3689
- transition("void <=> *", animate(200))
3690
- ]),
3691
- trigger("positionIcon", [
3692
- state("true", style({ "left": "70px" })),
3693
- state("false", style({ "left": "10px" })),
3694
- transition("true <=> false", animate(200))
3695
- ]),
3696
- trigger("positionHandle", [
3697
- state("true", style({ "left": "15px" })),
3698
- state("false", style({ "left": "75px" })),
3699
- transition("true <=> false", animate(200))
3700
- ])
3701
- ],
3575
+ <div class="linear-gauge"
3576
+ [style.background]="getStyle()"
3577
+ [style.border-color]="color"
3578
+ [textContent]="count ? count : ''"
3579
+ ></div>
3580
+ `,
3702
3581
  encapsulation: ViewEncapsulation.None
3703
3582
  },] }
3704
3583
  ];
3705
- LayoutSwitcherComponent.ctorParameters = () => [
3706
- { type: IconCacheService }
3707
- ];
3708
- LayoutSwitcherComponent.propDecorators = {
3709
- showClass: [{ type: HostBinding, args: ['class.co-layout-switcher',] }],
3710
- layoutItems: [{ type: Input }],
3711
- layoutSwitchEmit: [{ type: Output }]
3584
+ CoLinearGaugeComponent.propDecorators = {
3585
+ value: [{ type: Input }],
3586
+ count: [{ type: Input }],
3587
+ showClass: [{ type: HostBinding, args: ["class.co-linear-gauge",] }]
3712
3588
  };
3713
3589
 
3714
- class LayoutSwitcherModule {
3590
+ class CoLinearGaugeModule {
3715
3591
  }
3716
- LayoutSwitcherModule.decorators = [
3592
+ CoLinearGaugeModule.decorators = [
3717
3593
  { type: NgModule, args: [{
3718
3594
  imports: [
3719
3595
  CommonModule,
3720
- IconModule
3721
3596
  ],
3722
3597
  declarations: [
3723
- LayoutSwitcherComponent,
3598
+ CoLinearGaugeComponent
3724
3599
  ],
3725
3600
  exports: [
3726
- LayoutSwitcherComponent
3601
+ CoLinearGaugeComponent
3727
3602
  ]
3728
3603
  },] }
3729
3604
  ];
3730
3605
 
3731
- var GaugeColor;
3732
- (function (GaugeColor) {
3733
- GaugeColor["Lowest"] = "#E0E0E0";
3734
- GaugeColor["Low"] = "#fff7b8";
3735
- GaugeColor["MediumLow"] = "#ffe367";
3736
- GaugeColor["MediumHigh"] = "#ffc15b";
3737
- GaugeColor["High"] = "#F88952";
3738
- GaugeColor["Highest"] = "#5FDCB3";
3739
- })(GaugeColor || (GaugeColor = {}));
3740
-
3741
- class CoCircularGaugeComponent {
3606
+ class StatusbarComponent {
3742
3607
  constructor() {
3743
- this._color = GaugeColor.Low;
3744
- this.majorTicks = {
3745
- height: 0,
3746
- };
3747
- this.minorTicks = {
3748
- height: 0
3749
- };
3750
- this.labelStyle = {
3751
- position: 'Inside', useRangeColor: true,
3752
- font: { size: '0px', fontFamily: 'inherit' }
3753
- };
3754
- this.lineStyle = {
3755
- width: 0
3756
- };
3757
- this.ranges = [
3758
- {
3759
- start: 1, end: 100,
3760
- radius: '13px',
3761
- startWidth: 3, endWidth: 3,
3762
- color: '#E0E0E0',
3763
- roundedCornerRadius: 0
3764
- },
3765
- ];
3766
- }
3767
- set value(value) {
3768
- this._value = value;
3769
- this._setColor();
3608
+ this.statusbarClick = new EventEmitter();
3609
+ this.showPopup = false;
3610
+ this.popupClass = 'dropdown';
3770
3611
  }
3771
- get value() {
3772
- return this._value;
3612
+ set statusbarData(value) {
3613
+ this._statusbarData = value;
3614
+ this.adjustTooHighPercentages();
3773
3615
  }
3774
- get color() {
3775
- return this._color;
3616
+ get statusbarData() {
3617
+ return this._statusbarData;
3776
3618
  }
3777
3619
  showClass() {
3778
3620
  return true;
3779
3621
  }
3780
- getAxes() {
3781
- return [{
3782
- minimum: 0,
3783
- maximum: 100,
3784
- radius: '15px',
3785
- startAngle: 1,
3786
- endAngle: 360,
3787
- majorTicks: this.majorTicks,
3788
- minorTicks: this.minorTicks,
3789
- labelStyle: this.labelStyle,
3790
- lineStyle: this.lineStyle,
3791
- ranges: this.ranges,
3792
- pointers: this.getPointers(),
3793
- annotations: this.getAnnotations(),
3794
- }];
3795
- }
3796
- getPointers() {
3797
- if (this.value) {
3798
- return [{
3799
- roundedCornerRadius: 0,
3800
- value: this.value,
3801
- type: 'RangeBar',
3802
- radius: '13px',
3803
- color: this.color,
3804
- border: {
3805
- width: 0
3806
- },
3807
- animation: {
3808
- enable: false
3809
- },
3810
- pointerWidth: 3
3811
- }];
3812
- }
3813
- }
3814
- ;
3815
- getAnnotations() {
3816
- if (this.value !== undefined) {
3817
- const label = this.value ? this.value + "%" : "0%";
3818
- return [{
3819
- content: '<div class="annotation" style="width:20px;height:20px;">' +
3820
- '<div class="annotation-label">' + label + '</div></div>',
3821
- zIndex: '10',
3822
- }];
3622
+ onStatusbarClick(event) {
3623
+ this.showPopup = !this.showPopup;
3624
+ if (this.showPopup) {
3625
+ this._mouseY = event.screenY;
3626
+ this._windowHeight = window.innerHeight;
3627
+ this.setPopupClass();
3823
3628
  }
3824
3629
  }
3825
- _setColor() {
3826
- if (this.value <= 0) {
3827
- this._color = GaugeColor.Lowest;
3828
- }
3829
- else if (this.value >= 1 && this.value < 25) {
3830
- this._color = GaugeColor.Low;
3831
- }
3832
- else if (this.value >= 25 && this.value < 50) {
3833
- this._color = GaugeColor.MediumLow;
3834
- }
3835
- else if (this.value >= 50 && this.value < 75) {
3836
- this._color = GaugeColor.MediumHigh;
3837
- }
3838
- else if (this.value >= 75 && this.value < 100) {
3839
- this._color = GaugeColor.High;
3630
+ setPopupClass() {
3631
+ const popupHeight = this.statusbarData.length * 30;
3632
+ let dropdownInScreen = (this._mouseY + popupHeight) <= this._windowHeight;
3633
+ if (dropdownInScreen) {
3634
+ this.popupClass = 'dropdown';
3840
3635
  }
3841
- else if (this.value >= 100) {
3842
- this._color = GaugeColor.Highest;
3636
+ else {
3637
+ this.popupClass = 'dropup';
3843
3638
  }
3844
3639
  }
3640
+ adjustTooHighPercentages() {
3641
+ this._statusbarData.forEach(data => data.percentage > 100 ? data.percentage = 100 : false);
3642
+ }
3845
3643
  }
3846
- CoCircularGaugeComponent.decorators = [
3644
+ StatusbarComponent.decorators = [
3847
3645
  { type: Component, args: [{
3848
- selector: "co-circular-gauge",
3646
+ selector: "co-statusbar",
3849
3647
  template: `
3850
- <div class="circular-gauge-wrapper">
3851
- <ejs-circulargauge
3852
- class="circular-gauge"
3853
- [width]="'100%'"
3854
- [axes]="getAxes()">
3855
- </ejs-circulargauge>
3648
+ <div class="co-statusbar-wrapper"
3649
+ *ngIf="statusbarData"
3650
+ (click)="onStatusbarClick($event)">
3651
+ <div class="statuses">
3652
+ <div *ngFor="let data of statusbarData; let index = index" class="status">
3653
+ <co-linear-gauge [class.focused-status]="focusedStatusIndex !== undefined && focusedStatusIndex === index"
3654
+ [value]="data.percentage" [count]="data.count ? data.count : undefined"></co-linear-gauge>
3655
+ </div>
3656
+ </div>
3657
+ <div class=status-description-popup *ngIf="showPopup" @showHidePopup [ngClass]="popupClass" clickOutside (clickOutside)="showPopup=false">
3658
+ <div class="status-descriptions">
3659
+ <div *ngFor="let data of statusbarData; let index = index" class="status-description">
3660
+ <co-circular-gauge [value]="data.percentage"></co-circular-gauge>
3661
+ <span [textContent]="data.label"></span>
3662
+ </div>
3663
+ </div>
3664
+ </div>
3856
3665
  </div>
3857
3666
  `,
3667
+ animations: [
3668
+ trigger("showHidePopup", [
3669
+ state("void", style({ opacity: 0 })),
3670
+ state("*", style({ opacity: 1 })),
3671
+ transition("void <=> *", animate("250ms ease-in-out")),
3672
+ ])
3673
+ ],
3858
3674
  encapsulation: ViewEncapsulation.None
3859
3675
  },] }
3860
3676
  ];
3861
- CoCircularGaugeComponent.propDecorators = {
3862
- circulargauge: [{ type: ViewChild, args: ['circulargauge',] }],
3863
- value: [{ type: Input }],
3864
- showClass: [{ type: HostBinding, args: ["class.co-circular-gauge",] }]
3677
+ StatusbarComponent.ctorParameters = () => [];
3678
+ StatusbarComponent.propDecorators = {
3679
+ statusbarData: [{ type: Input }],
3680
+ focusedStatusIndex: [{ type: Input }],
3681
+ statusbarClick: [{ type: Output }],
3682
+ showClass: [{ type: HostBinding, args: ["class.co-statusbar",] }]
3865
3683
  };
3866
3684
 
3867
- class CoCircularGaugeModule {
3685
+ class StatusbarModule {
3868
3686
  }
3869
- CoCircularGaugeModule.decorators = [
3687
+ StatusbarModule.decorators = [
3870
3688
  { type: NgModule, args: [{
3871
3689
  imports: [
3872
3690
  CommonModule,
3873
- CircularGaugeModule
3691
+ CoCircularGaugeModule,
3692
+ CoLinearGaugeModule,
3693
+ ClickoutsideModule
3874
3694
  ],
3875
3695
  declarations: [
3876
- CoCircularGaugeComponent
3696
+ StatusbarComponent
3877
3697
  ],
3878
3698
  exports: [
3879
- CoCircularGaugeComponent
3699
+ StatusbarComponent
3880
3700
  ]
3881
3701
  },] }
3882
3702
  ];
3883
3703
 
3884
- class CoLinearGaugeComponent {
3704
+ class StockStatusbarComponent {
3885
3705
  constructor() {
3886
- this.color = GaugeColor.Low;
3887
3706
  }
3888
- set value(value) {
3889
- this._value = value;
3890
- this._setColor();
3707
+ }
3708
+ StockStatusbarComponent.decorators = [
3709
+ { type: Component, args: [{
3710
+ selector: "co-stock-statusbar",
3711
+ template: `
3712
+ <div class="status-bar">
3713
+ <div class="status-bar-block" [ngClass]="{'red': value === 0, 'orange': value === 1, 'green': value === 2}"></div>
3714
+ <div class="status-bar-block" [ngClass]="{'orange': value === 1, 'green': value === 2}"></div>
3715
+ <div class="status-bar-block" [ngClass]="{'green': value === 2}"></div>
3716
+ </div>
3717
+ `,
3718
+ encapsulation: ViewEncapsulation.None
3719
+ },] }
3720
+ ];
3721
+ StockStatusbarComponent.ctorParameters = () => [];
3722
+ StockStatusbarComponent.propDecorators = {
3723
+ value: [{ type: Input }]
3724
+ };
3725
+
3726
+ class StockStatusbarModule {
3727
+ }
3728
+ StockStatusbarModule.decorators = [
3729
+ { type: NgModule, args: [{
3730
+ imports: [
3731
+ CommonModule,
3732
+ ],
3733
+ declarations: [
3734
+ StockStatusbarComponent
3735
+ ],
3736
+ exports: [
3737
+ StockStatusbarComponent
3738
+ ]
3739
+ },] }
3740
+ ];
3741
+
3742
+ class StockModule {
3743
+ }
3744
+ StockModule.decorators = [
3745
+ { type: NgModule, args: [{
3746
+ imports: [
3747
+ InputComboBoxModule,
3748
+ CoGridModule,
3749
+ ButtonModule,
3750
+ CommonModule,
3751
+ InputRadioButtonModule,
3752
+ DropDownModule,
3753
+ SimpleGridModule,
3754
+ ImageModule,
3755
+ InputTextModule,
3756
+ SendMethodDialogModule,
3757
+ IconModule,
3758
+ InputNumberPickerModule,
3759
+ CoDialogWizardModule,
3760
+ InputTextareaModule,
3761
+ TabBarModule,
3762
+ CoDialogModule,
3763
+ StatusbarModule,
3764
+ StockStatusbarModule
3765
+ ],
3766
+ declarations: [
3767
+ StockComponent,
3768
+ StockInformationComponent,
3769
+ StockInformationGridComponent,
3770
+ StockTransferComponent,
3771
+ StockChangeAmountComponent,
3772
+ StockTabComponent,
3773
+ OrderTabComponent,
3774
+ StockTabsComponent,
3775
+ StockHistoryTabsComponent,
3776
+ OrderStockTabComponent,
3777
+ StockLocationComponent,
3778
+ StockHistoryComponent,
3779
+ OrderSupplyStockHistoryComponent,
3780
+ OrderCommissionStockHistoryComponent,
3781
+ OrderStockHistoryComponent,
3782
+ AllocationStockHistoryComponent
3783
+ ],
3784
+ exports: [
3785
+ StockComponent
3786
+ ],
3787
+ providers: [
3788
+ StockService
3789
+ ]
3790
+ },] }
3791
+ ];
3792
+
3793
+ var KeyboardCode;
3794
+ (function (KeyboardCode) {
3795
+ KeyboardCode["Backspace"] = "Backspace";
3796
+ KeyboardCode["Digit0"] = "Digit0";
3797
+ KeyboardCode["Digit1"] = "Digit1";
3798
+ KeyboardCode["Digit2"] = "Digit2";
3799
+ KeyboardCode["Digit3"] = "Digit3";
3800
+ KeyboardCode["Digit4"] = "Digit4";
3801
+ KeyboardCode["Digit5"] = "Digit5";
3802
+ KeyboardCode["Digit6"] = "Digit6";
3803
+ KeyboardCode["Digit7"] = "Digit7";
3804
+ KeyboardCode["Digit8"] = "Digit8";
3805
+ KeyboardCode["Digit9"] = "Digit9";
3806
+ KeyboardCode["Enter"] = "Enter";
3807
+ KeyboardCode["Escape"] = "Escape";
3808
+ KeyboardCode["Minus"] = "Minus";
3809
+ KeyboardCode["Numpad0"] = "Numpad0";
3810
+ KeyboardCode["Numpad1"] = "Numpad1";
3811
+ KeyboardCode["Numpad2"] = "Numpad2";
3812
+ KeyboardCode["Numpad3"] = "Numpad3";
3813
+ KeyboardCode["Numpad4"] = "Numpad4";
3814
+ KeyboardCode["Numpad5"] = "Numpad5";
3815
+ KeyboardCode["Numpad6"] = "Numpad6";
3816
+ KeyboardCode["Numpad7"] = "Numpad7";
3817
+ KeyboardCode["Numpad8"] = "Numpad8";
3818
+ KeyboardCode["Numpad9"] = "Numpad9";
3819
+ KeyboardCode["NumpadDecimal"] = "NumpadDecimal";
3820
+ KeyboardCode["NumpadEnter"] = "NumpadEnter";
3821
+ KeyboardCode["NumpadSubtract"] = "NumpadSubtract";
3822
+ KeyboardCode["Period"] = "Period";
3823
+ })(KeyboardCode || (KeyboardCode = {}));
3824
+
3825
+ class KeyPadComponent {
3826
+ constructor(iconCacheService) {
3827
+ this.iconCacheService = iconCacheService;
3828
+ this.icons = Icon;
3829
+ this.showValue = true;
3830
+ this.emitModelChangeOnEnter = true;
3831
+ this.modelChange = new EventEmitter();
3832
+ this.internalModelChange = new EventEmitter();
3833
+ this.enterClick = new EventEmitter();
3834
+ this._validKeyMap = new Map([
3835
+ [KeyboardCode.Digit0, "0"],
3836
+ [KeyboardCode.Digit1, "1"],
3837
+ [KeyboardCode.Digit2, "2"],
3838
+ [KeyboardCode.Digit3, "3"],
3839
+ [KeyboardCode.Digit4, "4"],
3840
+ [KeyboardCode.Digit5, "5"],
3841
+ [KeyboardCode.Digit6, "6"],
3842
+ [KeyboardCode.Digit7, "7"],
3843
+ [KeyboardCode.Digit8, "8"],
3844
+ [KeyboardCode.Digit9, "9"],
3845
+ [KeyboardCode.Numpad0, "0"],
3846
+ [KeyboardCode.Numpad1, "1"],
3847
+ [KeyboardCode.Numpad2, "2"],
3848
+ [KeyboardCode.Numpad3, "3"],
3849
+ [KeyboardCode.Numpad4, "4"],
3850
+ [KeyboardCode.Numpad5, "5"],
3851
+ [KeyboardCode.Numpad6, "6"],
3852
+ [KeyboardCode.Numpad7, "7"],
3853
+ [KeyboardCode.Numpad8, "8"],
3854
+ [KeyboardCode.Numpad9, "9"],
3855
+ [KeyboardCode.NumpadDecimal, "."],
3856
+ [KeyboardCode.Period, "."]
3857
+ ]);
3858
+ this.isNegative = false;
3859
+ this._model = 0;
3860
+ this._internalModel = "0";
3861
+ this._maxCharacters = 11;
3862
+ }
3863
+ set model(value) {
3864
+ this._model = value;
3865
+ this._internalModel = this._model + "";
3866
+ }
3867
+ get model() {
3868
+ return this._model;
3869
+ }
3870
+ showClass() {
3871
+ return true;
3872
+ }
3873
+ handleKeyDown(event) {
3874
+ this._keyDown(event);
3875
+ }
3876
+ set internalModel(value) {
3877
+ this._internalModel = value;
3878
+ this.isNegative = parseFloat(this._internalModel) < 0;
3879
+ this.internalModelChange.emit(this._internalModel);
3880
+ }
3881
+ get internalModel() {
3882
+ return this._internalModel;
3883
+ }
3884
+ handleMinusClick(event) {
3885
+ const model = parseFloat(this.internalModel);
3886
+ if (model !== 0) {
3887
+ if (model < 0) {
3888
+ this.internalModel = Math.abs(model) + "";
3889
+ }
3890
+ else {
3891
+ this.internalModel = -model + "";
3892
+ }
3893
+ }
3894
+ this._emitModelChange();
3895
+ }
3896
+ handleClearClick(event) {
3897
+ this.internalModel = "0";
3898
+ this._emitModelChange();
3899
+ }
3900
+ handleBsClick(event) {
3901
+ let wish = this.internalModel;
3902
+ wish = wish.slice(0, wish.length - 1) || "0";
3903
+ if (!isNaN(parseFloat(wish))) {
3904
+ this.internalModel = parseFloat(wish) + "";
3905
+ }
3906
+ this._emitModelChange();
3891
3907
  }
3892
- get value() {
3893
- return this._value;
3908
+ handleButtonClick(chr) {
3909
+ this._updateModel(chr);
3894
3910
  }
3895
- showClass() {
3896
- return true;
3911
+ handleEnterClick(event) {
3912
+ this._emitModelChange(true);
3913
+ this.enterClick.emit();
3897
3914
  }
3898
- getStyle() {
3899
- return `linear-gradient(90deg, ${this.color} 0 ${this.value}%, white ${this.value}% 100%`;
3915
+ _updateModel(value) {
3916
+ if (value === undefined || value === null ||
3917
+ (value === '.' && this.internalModel.indexOf('.') > -1) ||
3918
+ this.internalModel.length >= this._maxCharacters) {
3919
+ return;
3920
+ }
3921
+ this.internalModel = this.internalModel !== "0" ? this.internalModel + value : value;
3922
+ this._emitModelChange();
3900
3923
  }
3901
- _setColor() {
3902
- if (this.value <= 0) {
3903
- this.color = GaugeColor.Lowest;
3924
+ _keyDown(event) {
3925
+ if (this._isEnter(event)) {
3926
+ this.handleEnterClick(event);
3904
3927
  }
3905
- else if (this.value >= 1 && this.value < 25) {
3906
- this.color = GaugeColor.Low;
3928
+ else if (this._isMinus(event)) {
3929
+ this.handleMinusClick(event);
3907
3930
  }
3908
- else if (this.value >= 25 && this.value < 50) {
3909
- this.color = GaugeColor.MediumLow;
3931
+ else if (this._isEscape(event)) {
3932
+ this.handleClearClick(event);
3910
3933
  }
3911
- else if (this.value >= 50 && this.value < 75) {
3912
- this.color = GaugeColor.MediumHigh;
3934
+ else if (this._isBackspace(event)) {
3935
+ this.handleBsClick(event);
3913
3936
  }
3914
- else if (this.value >= 75 && this.value < 100) {
3915
- this.color = GaugeColor.High;
3937
+ else {
3938
+ this._updateModel(this._validKeyMap.get(event.code));
3916
3939
  }
3917
- else if (this.value >= 100) {
3918
- this.color = GaugeColor.Highest;
3940
+ }
3941
+ _isEnter(event) {
3942
+ return event.code === KeyboardCode.Enter || event.code === KeyboardCode.NumpadEnter;
3943
+ }
3944
+ _isMinus(event) {
3945
+ return event.code === KeyboardCode.Minus || event.code === KeyboardCode.NumpadSubtract;
3946
+ }
3947
+ _isEscape(event) {
3948
+ return event.code === KeyboardCode.Escape;
3949
+ }
3950
+ _isBackspace(event) {
3951
+ return event.code === KeyboardCode.Backspace;
3952
+ }
3953
+ _emitModelChange(enter = false) {
3954
+ if ((enter && this.emitModelChangeOnEnter) || (!enter && !this.emitModelChangeOnEnter)) {
3955
+ const model = parseFloat(this.internalModel);
3956
+ if (!isNaN(model)) {
3957
+ if (enter && this.emitModelChangeOnEnter) {
3958
+ this.model = model;
3959
+ }
3960
+ this.modelChange.emit(model);
3961
+ }
3919
3962
  }
3920
3963
  }
3921
3964
  }
3922
- CoLinearGaugeComponent.decorators = [
3965
+ KeyPadComponent.decorators = [
3923
3966
  { type: Component, args: [{
3924
- selector: "co-linear-gauge",
3967
+ selector: 'co-key-pad',
3925
3968
  template: `
3926
- <div class="linear-gauge"
3927
- [style.background]="getStyle()"
3928
- [style.border-color]="color"
3929
- [textContent]="count ? count : ''"
3930
- ></div>
3931
- `,
3969
+ <div class="key-pad-wrapper">
3970
+ <div class="key-pad-model-wrapper" *ngIf="showValue">
3971
+ <div class="key-pad-model" [textContent]="internalModel" [class.negative]="isNegative"></div>
3972
+ </div>
3973
+ <div class="key-pad-button-wrapper">
3974
+ <div class="key-pad-button button-7" [textContent]="'7'" (click)="handleButtonClick('7')"></div>
3975
+ <div class="key-pad-button button-8" [textContent]="'8'" (click)="handleButtonClick('8')"></div>
3976
+ <div class="key-pad-button button-9" [textContent]="'9'" (click)="handleButtonClick('9')"></div>
3977
+ <div class="key-pad-button button-bs" (click)="handleBsClick($event)">
3978
+ <co-icon [iconData]="iconCacheService.getIcon(icons.DeleteLeftRegular)"></co-icon>
3979
+ </div>
3980
+ <div class="key-pad-button button-4" [textContent]="'4'" (click)="handleButtonClick('4')"></div>
3981
+ <div class="key-pad-button button-5" [textContent]="'5'" (click)="handleButtonClick('5')"></div>
3982
+ <div class="key-pad-button button-6" [textContent]="'6'" (click)="handleButtonClick('6')"></div>
3983
+ <div class="key-pad-button button-minus" [textContent]="'-'" (click)="handleMinusClick($event)"></div>
3984
+ <div class="key-pad-button button-1" [textContent]="'1'" (click)="handleButtonClick('1')"></div>
3985
+ <div class="key-pad-button button-2" [textContent]="'2'" (click)="handleButtonClick('2')"></div>
3986
+ <div class="key-pad-button button-3" [textContent]="'3'" (click)="handleButtonClick('3')"></div>
3987
+ <div class="key-pad-button button-enter" (click)="handleEnterClick($event)">
3988
+ <span [textContent]="'enter'"></span>
3989
+ </div>
3990
+ <div class="key-pad-button button-0" [textContent]="'0'" (click)="handleButtonClick('0')"></div>
3991
+ <div class="key-pad-button button-dot" [textContent]="'.'" (click)="handleButtonClick('.')"></div>
3992
+ </div>
3993
+ </div>
3994
+ `,
3932
3995
  encapsulation: ViewEncapsulation.None
3933
3996
  },] }
3934
3997
  ];
3935
- CoLinearGaugeComponent.propDecorators = {
3936
- value: [{ type: Input }],
3937
- count: [{ type: Input }],
3938
- showClass: [{ type: HostBinding, args: ["class.co-linear-gauge",] }]
3998
+ KeyPadComponent.ctorParameters = () => [
3999
+ { type: IconCacheService }
4000
+ ];
4001
+ KeyPadComponent.propDecorators = {
4002
+ model: [{ type: Input }],
4003
+ showValue: [{ type: Input }],
4004
+ emitModelChangeOnEnter: [{ type: Input }],
4005
+ modelChange: [{ type: Output }],
4006
+ internalModelChange: [{ type: Output }],
4007
+ enterClick: [{ type: Output }],
4008
+ showClass: [{ type: HostBinding, args: ['class.co-key-pad',] }],
4009
+ handleKeyDown: [{ type: HostListener, args: ['window:keydown', ['$event'],] }]
3939
4010
  };
3940
4011
 
3941
- class CoLinearGaugeModule {
4012
+ class KeyPadModule {
3942
4013
  }
3943
- CoLinearGaugeModule.decorators = [
4014
+ KeyPadModule.decorators = [
3944
4015
  { type: NgModule, args: [{
3945
4016
  imports: [
3946
4017
  CommonModule,
4018
+ IconModule
3947
4019
  ],
3948
4020
  declarations: [
3949
- CoLinearGaugeComponent
4021
+ KeyPadComponent
3950
4022
  ],
3951
4023
  exports: [
3952
- CoLinearGaugeComponent
4024
+ KeyPadComponent
3953
4025
  ]
3954
4026
  },] }
3955
4027
  ];
3956
4028
 
3957
- class StatusbarComponent {
3958
- constructor() {
3959
- this.statusbarClick = new EventEmitter();
3960
- this.showPopup = false;
3961
- this.popupClass = 'dropdown';
3962
- }
3963
- set statusbarData(value) {
3964
- this._statusbarData = value;
3965
- this.adjustTooHighPercentages();
3966
- }
3967
- get statusbarData() {
3968
- return this._statusbarData;
4029
+ class LayoutSwitcherComponent {
4030
+ constructor(iconCacheService) {
4031
+ this.iconCacheService = iconCacheService;
4032
+ this.icon = Icon;
4033
+ this.layoutItems = [];
4034
+ this.layoutSwitchEmit = new EventEmitter();
4035
+ this.showMaskSidebar = false;
4036
+ this._activeIndex = 0;
3969
4037
  }
3970
4038
  showClass() {
3971
4039
  return true;
3972
4040
  }
3973
- onStatusbarClick(event) {
3974
- this.showPopup = !this.showPopup;
3975
- if (this.showPopup) {
3976
- this._mouseY = event.screenY;
3977
- this._windowHeight = window.innerHeight;
3978
- this.setPopupClass();
3979
- }
4041
+ get activeIndex() {
4042
+ return this._activeIndex;
3980
4043
  }
3981
- setPopupClass() {
3982
- const popupHeight = this.statusbarData.length * 30;
3983
- let dropdownInScreen = (this._mouseY + popupHeight) <= this._windowHeight;
3984
- if (dropdownInScreen) {
3985
- this.popupClass = 'dropdown';
3986
- }
3987
- else {
3988
- this.popupClass = 'dropup';
3989
- }
4044
+ set activeIndex(index) {
4045
+ this._activeIndex = index;
4046
+ this.toggleMaskSidebar();
4047
+ this.layoutSwitchEmit.emit(this.layoutItems[index]);
3990
4048
  }
3991
- adjustTooHighPercentages() {
3992
- this._statusbarData.forEach(data => data.percentage > 100 ? data.percentage = 100 : false);
4049
+ toggleMaskSidebar() {
4050
+ this.showMaskSidebar = !this.showMaskSidebar;
3993
4051
  }
3994
4052
  }
3995
- StatusbarComponent.decorators = [
4053
+ LayoutSwitcherComponent.decorators = [
3996
4054
  { type: Component, args: [{
3997
- selector: "co-statusbar",
4055
+ selector: "co-layout-switcher",
3998
4056
  template: `
3999
- <div class="co-statusbar-wrapper"
4000
- *ngIf="statusbarData"
4001
- (click)="onStatusbarClick($event)">
4002
- <div class="statuses">
4003
- <div *ngFor="let data of statusbarData; let index = index" class="status">
4004
- <co-linear-gauge [class.focused-status]="focusedStatusIndex !== undefined && focusedStatusIndex === index"
4005
- [value]="data.percentage" [count]="data.count ? data.count : undefined"></co-linear-gauge>
4006
- </div>
4057
+ <div class="mask-wrapper" [class.mask-wrapper-active]='showMaskSidebar' @showHideSidebar>
4058
+ <div class="icon-wrapper" (click)="toggleMaskSidebar()">
4059
+ <co-icon class="icon-mask" [iconData]="iconCacheService.getIcon(icon.BringForwardRegular)" [@positionIcon]="showMaskSidebar"></co-icon>
4060
+
4061
+ <co-icon class='icon-mask-sidebar-handle' [@positionHandle]='showMaskSidebar' [iconData]="showMaskSidebar ? iconCacheService.getIcon(this.icon.AngleLeftSolid) : iconCacheService.getIcon(this.icon.AngleRightSolid)"></co-icon>
4007
4062
  </div>
4008
- <div class=status-description-popup *ngIf="showPopup" @showHidePopup [ngClass]="popupClass" clickOutside (clickOutside)="showPopup=false">
4009
- <div class="status-descriptions">
4010
- <div *ngFor="let data of statusbarData; let index = index" class="status-description">
4011
- <co-circular-gauge [value]="data.percentage"></co-circular-gauge>
4012
- <span [textContent]="data.label"></span>
4013
- </div>
4014
- </div>
4063
+
4064
+ <div class="mask-content" *ngIf="showMaskSidebar" @showHideSidebar>
4065
+ <span *ngFor='let item of this.layoutItems' [class.active]="this.activeIndex === this.layoutItems.indexOf(item)" [textContent]="item" (click)='activeIndex = this.layoutItems.indexOf(item)' ></span>
4015
4066
  </div>
4016
4067
  </div>
4068
+
4017
4069
  `,
4018
4070
  animations: [
4019
- trigger("showHidePopup", [
4020
- state("void", style({ opacity: 0 })),
4021
- state("*", style({ opacity: 1 })),
4022
- transition("void <=> *", animate("250ms ease-in-out")),
4071
+ trigger("showHideSidebar", [
4072
+ state("void", style({ "width": "0" })),
4073
+ state("*", style({ "width": "*" })),
4074
+ transition("void <=> *", animate(200))
4075
+ ]),
4076
+ trigger("positionIcon", [
4077
+ state("true", style({ "left": "70px" })),
4078
+ state("false", style({ "left": "10px" })),
4079
+ transition("true <=> false", animate(200))
4080
+ ]),
4081
+ trigger("positionHandle", [
4082
+ state("true", style({ "left": "15px" })),
4083
+ state("false", style({ "left": "75px" })),
4084
+ transition("true <=> false", animate(200))
4023
4085
  ])
4024
4086
  ],
4025
4087
  encapsulation: ViewEncapsulation.None
4026
4088
  },] }
4027
4089
  ];
4028
- StatusbarComponent.ctorParameters = () => [];
4029
- StatusbarComponent.propDecorators = {
4030
- statusbarData: [{ type: Input }],
4031
- focusedStatusIndex: [{ type: Input }],
4032
- statusbarClick: [{ type: Output }],
4033
- showClass: [{ type: HostBinding, args: ["class.co-statusbar",] }]
4090
+ LayoutSwitcherComponent.ctorParameters = () => [
4091
+ { type: IconCacheService }
4092
+ ];
4093
+ LayoutSwitcherComponent.propDecorators = {
4094
+ showClass: [{ type: HostBinding, args: ['class.co-layout-switcher',] }],
4095
+ layoutItems: [{ type: Input }],
4096
+ layoutSwitchEmit: [{ type: Output }]
4034
4097
  };
4035
4098
 
4036
- class StatusbarModule {
4099
+ class LayoutSwitcherModule {
4037
4100
  }
4038
- StatusbarModule.decorators = [
4101
+ LayoutSwitcherModule.decorators = [
4039
4102
  { type: NgModule, args: [{
4040
4103
  imports: [
4041
4104
  CommonModule,
4042
- CoCircularGaugeModule,
4043
- CoLinearGaugeModule,
4044
- ClickoutsideModule
4105
+ IconModule
4045
4106
  ],
4046
4107
  declarations: [
4047
- StatusbarComponent
4108
+ LayoutSwitcherComponent,
4048
4109
  ],
4049
4110
  exports: [
4050
- StatusbarComponent
4111
+ LayoutSwitcherComponent
4051
4112
  ]
4052
4113
  },] }
4053
4114
  ];
@@ -5969,5 +6030,5 @@ DatePlanningModule.decorators = [
5969
6030
  * Generated bundle index. Do not edit.
5970
6031
  */
5971
6032
 
5972
- export { CoCircularGaugeComponent, CoCircularGaugeModule, CoLinearGaugeComponent, CoLinearGaugeModule, DatePlanningComponent, DatePlanningModule, DocsignComponent, DocsignModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, SendMethodDialogComponent, SendMethodDialogModule, SharedService, StatusbarComponent, StatusbarModule, StockComponent, StockModule, sendMethodsWithIcon, SignatureComponent as ɵa, SignaturesComponent as ɵb, OrderStockTabComponent as ɵba, StockLocationComponent as ɵbb, StockHistoryComponent as ɵbc, OrderSupplyStockHistoryComponent as ɵbd, OrderCommissionStockHistoryComponent as ɵbe, OrderStockHistoryComponent as ɵbf, AllocationStockHistoryComponent as ɵbg, SendMethod as ɵbh, Icon as ɵbi, CalendarAllYearsComponent as ɵbj, CalendarAllMonthsComponent as ɵbk, CalendarHeaderComponent as ɵbl, CalendarComponent as ɵbm, CalendarViewComponent as ɵbn, LanguageCode as ɵbo, AgendaHeaderComponent as ɵbp, AgendaViewComponent as ɵbq, AgendaMonthViewComponent as ɵbr, AgendaBaseViewComponent as ɵbs, AgendaDayViewComponent as ɵbt, AgendaWeekViewComponent as ɵbu, AgendaWeekSelectViewComponent as ɵbv, AgendaHourViewComponent as ɵbw, AgendaHourCellComponent as ɵbx, AgendaHourViewLabelsComponent as ɵby, AgendaHalfHourCellComponent as ɵbz, StockService as ɵc, AgendaEventsComponent as ɵca, AgendaEventComponent as ɵcb, ViewSelectComponent as ɵcc, AgendaSelectEventComponent as ɵcd, MASTER_PIPES as ɵce, ArrayNumberPipe as ɵcf, UCfirstPipe as ɵcg, SharedConnectorService as ɵd, OptionsService as ɵe, DictionaryService as ɵf, IconCacheService as ɵg, SendMethodService as ɵh, SendMethodEmailModule as ɵi, LayoutSelectionModule as ɵj, LayoutSelectionComponent as ɵk, SendMethodEmailComponent as ɵl, SendMethodPrinterModule as ɵm, PrinterSelectionModule as ɵn, PrinterSelectionComponent as ɵo, SendMethodPrinterComponent as ɵp, TabBarModule as ɵq, TabBarComponent as ɵr, StockInformationComponent as ɵs, StockInformationGridComponent as ɵt, StockTransferComponent as ɵu, StockChangeAmountComponent as ɵv, StockTabComponent as ɵw, OrderTabComponent as ɵx, StockTabsComponent as ɵy, StockHistoryTabsComponent as ɵz };
6033
+ export { CoCircularGaugeComponent, CoCircularGaugeModule, CoLinearGaugeComponent, CoLinearGaugeModule, DatePlanningComponent, DatePlanningModule, DocsignComponent, DocsignModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, SendMethodDialogComponent, SendMethodDialogModule, SharedService, StatusbarComponent, StatusbarModule, StockComponent, StockModule, sendMethodsWithIcon, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockTabsComponent as ɵba, StockHistoryTabsComponent as ɵbb, OrderStockTabComponent as ɵbc, StockLocationComponent as ɵbd, StockHistoryComponent as ɵbe, OrderSupplyStockHistoryComponent as ɵbf, OrderCommissionStockHistoryComponent as ɵbg, OrderStockHistoryComponent as ɵbh, AllocationStockHistoryComponent as ɵbi, SendMethod as ɵbj, Icon as ɵbk, CalendarAllYearsComponent as ɵbl, CalendarAllMonthsComponent as ɵbm, CalendarHeaderComponent as ɵbn, CalendarComponent as ɵbo, CalendarViewComponent as ɵbp, LanguageCode as ɵbq, AgendaHeaderComponent as ɵbr, AgendaViewComponent as ɵbs, AgendaMonthViewComponent as ɵbt, AgendaBaseViewComponent as ɵbu, AgendaDayViewComponent as ɵbv, AgendaWeekViewComponent as ɵbw, AgendaWeekSelectViewComponent as ɵbx, AgendaHourViewComponent as ɵby, AgendaHourCellComponent as ɵbz, StockService as ɵc, AgendaHourViewLabelsComponent as ɵca, AgendaHalfHourCellComponent as ɵcb, AgendaEventsComponent as ɵcc, AgendaEventComponent as ɵcd, ViewSelectComponent as ɵce, AgendaSelectEventComponent as ɵcf, MASTER_PIPES as ɵcg, ArrayNumberPipe as ɵch, UCfirstPipe as ɵci, SharedConnectorService as ɵd, OptionsService as ɵe, DictionaryService as ɵf, IconCacheService as ɵg, SendMethodService as ɵh, SendMethodEmailModule as ɵi, LayoutSelectionModule as ɵj, LayoutSelectionComponent as ɵk, SendMethodEmailComponent as ɵl, SendMethodPrinterModule as ɵm, PrinterSelectionModule as ɵn, PrinterSelectionComponent as ɵo, SendMethodPrinterComponent as ɵp, TabBarModule as ɵq, TabBarComponent as ɵr, StockStatusbarModule as ɵs, StockStatusbarComponent as ɵt, StockInformationComponent as ɵu, StockInformationGridComponent as ɵv, StockTransferComponent as ɵw, StockChangeAmountComponent as ɵx, StockTabComponent as ɵy, OrderTabComponent as ɵz };
5973
6034
  //# sourceMappingURL=colijnit-sharedcomponents.js.map