@colijnit/sharedcomponents 1.0.57 → 1.0.58
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/bundles/colijnit-sharedcomponents.umd.js +3555 -6
- package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
- package/colijnit-sharedcomponents.d.ts +17 -0
- package/colijnit-sharedcomponents.metadata.json +1 -1
- package/esm2015/colijnit-sharedcomponents.js +18 -1
- package/esm2015/lib/businessobject/build-images-and-documentation-result.js +2 -0
- package/esm2015/lib/businessobject/co-document-right.bo.js +3 -0
- package/esm2015/lib/businessobject/drag-drop-container-element.js +2 -0
- package/esm2015/lib/businessobject/drag-drop-container.js +7 -0
- package/esm2015/lib/components/activity-list/activity-list.component.js +130 -0
- package/esm2015/lib/components/activity-list/activity-list.module.js +24 -0
- package/esm2015/lib/components/app-file-dropzone/app-file-dropzone.component.js +47 -0
- package/esm2015/lib/components/app-file-dropzone/app-file-dropzone.module.js +20 -0
- package/esm2015/lib/components/file-upload/file-upload.component.js +189 -0
- package/esm2015/lib/components/file-upload/file-upload.module.js +25 -0
- package/esm2015/lib/components/file-upload-popup/file-upload-popup.component.js +397 -0
- package/esm2015/lib/components/file-upload-popup/file-upload-popup.module.js +30 -0
- package/esm2015/lib/components/files-upload/components/base-file-upload.component.js +469 -0
- package/esm2015/lib/components/files-upload/components/drag-drop-container.component.js +115 -0
- package/esm2015/lib/components/files-upload/files-upload.component.js +131 -0
- package/esm2015/lib/components/files-upload/files-upload.module.js +47 -0
- package/esm2015/lib/components/image-display/image-display.component.js +36 -0
- package/esm2015/lib/components/image-display/image-display.module.js +23 -0
- package/esm2015/lib/components/multi-property-toggler/multiple-property-toggler.component.js +89 -0
- package/esm2015/lib/components/multi-property-toggler/multiple-property-toggler.module.js +21 -0
- package/esm2015/lib/components/tile-renderer/tile-render.component.js +80 -0
- package/esm2015/lib/components/tile-renderer/tile-render.module.js +26 -0
- package/esm2015/lib/decorator/input-boolean.decorator.js +34 -0
- package/esm2015/lib/enum/document-email-report.enum.js +18 -0
- package/esm2015/lib/enum/domain-multiple-name.enum.js +13 -0
- package/esm2015/lib/enum/file-type.js +14 -0
- package/esm2015/lib/enum/files-upload-config-objects.js +3 -0
- package/esm2015/lib/enum/icon.enum.js +7 -1
- package/esm2015/lib/enum/internal-param.enum.js +38 -0
- package/esm2015/lib/enum/read-write-access-config-names.enum.js +2 -0
- package/esm2015/lib/enum/table-name.enum.js +86 -0
- package/esm2015/lib/enum/tag-category.enum.js +22 -0
- package/esm2015/lib/enum/tags-component-config-names.js +2 -0
- package/esm2015/lib/enum/tile-size-type.js +7 -0
- package/esm2015/lib/event/co-drag-event.js +2 -0
- package/esm2015/lib/event/co-drop-event.js +2 -0
- package/esm2015/lib/interface/key-value-pair.js +2 -0
- package/esm2015/lib/interface/operation-callback-simple-function.js +4 -0
- package/esm2015/lib/model/icon-svg.js +7 -1
- package/esm2015/lib/model/tag-tree-item.bo.js +16 -0
- package/esm2015/lib/model/tree-object.js +15 -0
- package/esm2015/lib/pipe/file-type-image.pipe.js +51 -0
- package/esm2015/lib/pipe/master-pipes.js +4 -2
- package/esm2015/lib/service/drag-drop.service.js +365 -0
- package/esm2015/lib/service/shared-connector.service.js +10 -1
- package/esm2015/lib/service/shared.service.js +2 -2
- package/esm2015/lib/utils/array-utils.js +202 -0
- package/esm2015/lib/utils/check-precision-and-scale-result.js +2 -0
- package/esm2015/lib/utils/check-within-stepped-bounds-result.js +2 -0
- package/esm2015/lib/utils/co-document-shared-field-logic.js +50 -0
- package/esm2015/lib/utils/enum-utils.js +128 -0
- package/esm2015/lib/utils/is-nill.function.js +5 -0
- package/esm2015/lib/utils/number-utils.js +390 -0
- package/esm2015/lib/utils/object-utils.js +278 -0
- package/esm2015/lib/utils/ref-code-utils.js +49 -0
- package/esm2015/lib/utils/string-utils.js +30 -1
- package/esm2015/public-api.js +5 -1
- package/fesm2015/colijnit-sharedcomponents.js +3528 -6
- package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
- package/lib/businessobject/build-images-and-documentation-result.d.ts +5 -0
- package/lib/businessobject/co-document-right.bo.d.ts +6 -0
- package/lib/businessobject/drag-drop-container-element.d.ts +6 -0
- package/lib/businessobject/drag-drop-container.d.ts +6 -0
- package/lib/components/access/read-write-access.scss +25 -0
- package/lib/components/access/style/_layout.scss +23 -0
- package/lib/components/access/style/_material-definition.scss +12 -0
- package/lib/components/access/style/_theme.scss +4 -0
- package/lib/components/access/style/material.scss +4 -0
- package/lib/components/activity-list/activity-list.component.d.ts +33 -0
- package/lib/components/activity-list/activity-list.module.d.ts +2 -0
- package/lib/components/activity-list/style/_layout.scss +68 -0
- package/lib/components/activity-list/style/_material-definition.scss +0 -0
- package/lib/components/activity-list/style/_theme.scss +4 -0
- package/lib/components/activity-list/style/material.scss +4 -0
- package/lib/components/app-file-dropzone/app-file-dropzone.component.d.ts +14 -0
- package/lib/components/app-file-dropzone/app-file-dropzone.module.d.ts +2 -0
- package/lib/components/app-file-dropzone/style/_layout.scss +61 -0
- package/lib/components/app-file-dropzone/style/_material-definition.scss +0 -0
- package/lib/components/app-file-dropzone/style/_theme.scss +4 -0
- package/lib/components/app-file-dropzone/style/material.scss +4 -0
- package/lib/components/file-upload/file-upload.component.d.ts +42 -0
- package/lib/components/file-upload/file-upload.module.d.ts +2 -0
- package/lib/components/file-upload/style/_layout.scss +59 -0
- package/lib/components/file-upload/style/_material-definition.scss +2 -0
- package/lib/components/file-upload/style/_theme.scss +4 -0
- package/lib/components/file-upload/style/material.scss +4 -0
- package/lib/components/file-upload-popup/file-upload-popup.component.d.ts +75 -0
- package/lib/components/file-upload-popup/file-upload-popup.module.d.ts +2 -0
- package/lib/components/file-upload-popup/style/_layout.scss +48 -0
- package/lib/components/file-upload-popup/style/_material-definition.scss +2 -0
- package/lib/components/file-upload-popup/style/_theme.scss +5 -0
- package/lib/components/file-upload-popup/style/material.scss +4 -0
- package/lib/components/files-upload/components/base-file-upload.component.d.ts +98 -0
- package/lib/components/files-upload/components/drag-drop-container.component.d.ts +34 -0
- package/lib/components/files-upload/files-upload.component.d.ts +32 -0
- package/lib/components/files-upload/files-upload.module.d.ts +2 -0
- package/lib/components/files-upload/style/_layout.scss +49 -0
- package/lib/components/files-upload/style/_material-definition.scss +0 -0
- package/lib/components/files-upload/style/_theme.scss +5 -0
- package/lib/components/files-upload/style/material.scss +4 -0
- package/lib/components/image-display/image-display.component.d.ts +14 -0
- package/lib/components/image-display/image-display.module.d.ts +2 -0
- package/lib/components/image-display/style/_layout.scss +56 -0
- package/lib/components/image-display/style/_material-definition.scss +4 -0
- package/lib/components/image-display/style/_theme.scss +6 -0
- package/lib/components/image-display/style/material.scss +3 -0
- package/lib/components/multi-property-toggler/multiple-property-toggler.component.d.ts +27 -0
- package/lib/components/multi-property-toggler/multiple-property-toggler.module.d.ts +2 -0
- package/lib/components/multi-property-toggler/style/_layout.scss +24 -0
- package/lib/components/multi-property-toggler/style/_material-definition.scss +0 -0
- package/lib/components/multi-property-toggler/style/_theme.scss +4 -0
- package/lib/components/multi-property-toggler/style/material.scss +4 -0
- package/lib/components/tile-renderer/style/_layout.scss +90 -0
- package/lib/components/tile-renderer/style/_material-definition.scss +0 -0
- package/lib/components/tile-renderer/style/_theme.scss +4 -0
- package/lib/components/tile-renderer/style/material.scss +4 -0
- package/lib/components/tile-renderer/tile-render.component.d.ts +31 -0
- package/lib/components/tile-renderer/tile-render.module.d.ts +2 -0
- package/lib/decorator/input-boolean.decorator.d.ts +8 -0
- package/lib/enum/document-email-report.enum.d.ts +15 -0
- package/lib/enum/domain-multiple-name.enum.d.ts +10 -0
- package/lib/enum/file-type.d.ts +7 -0
- package/lib/enum/files-upload-config-objects.d.ts +22 -0
- package/lib/enum/icon.enum.d.ts +6 -0
- package/lib/enum/internal-param.enum.d.ts +34 -0
- package/lib/enum/read-write-access-config-names.enum.d.ts +4 -0
- package/lib/enum/table-name.enum.d.ts +84 -0
- package/lib/enum/tag-category.enum.d.ts +19 -0
- package/lib/enum/tags-component-config-names.d.ts +4 -0
- package/lib/enum/tile-size-type.d.ts +4 -0
- package/lib/event/co-drag-event.d.ts +5 -0
- package/lib/event/co-drop-event.d.ts +8 -0
- package/lib/interface/key-value-pair.d.ts +4 -0
- package/lib/interface/operation-callback-simple-function.d.ts +4 -0
- package/lib/model/tag-tree-item.bo.d.ts +18 -0
- package/lib/model/tree-object.d.ts +8 -0
- package/lib/pipe/file-type-image.pipe.d.ts +12 -0
- package/lib/service/drag-drop.service.d.ts +86 -0
- package/lib/service/shared-connector.service.d.ts +2 -0
- package/lib/style/_variables.scss +1 -1
- package/lib/utils/array-utils.d.ts +63 -0
- package/lib/utils/check-precision-and-scale-result.d.ts +4 -0
- package/lib/utils/check-within-stepped-bounds-result.d.ts +8 -0
- package/lib/utils/co-document-shared-field-logic.d.ts +7 -0
- package/lib/utils/enum-utils.d.ts +31 -0
- package/lib/utils/is-nill.function.d.ts +1 -0
- package/lib/utils/number-utils.d.ts +125 -0
- package/lib/utils/object-utils.d.ts +40 -0
- package/lib/utils/ref-code-utils.d.ts +10 -0
- package/lib/utils/string-utils.d.ts +16 -0
- package/package.json +1 -1
- package/public-api.d.ts +4 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
1
|
+
import { __awaiter, __decorate } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { EventEmitter, Component, ViewEncapsulation, ViewChild, ElementRef, Input, Output, HostBinding, NgModule, Injectable, ChangeDetectorRef, ViewChildren, HostListener, Pipe, Renderer2, Inject, LOCALE_ID, NgZone, Directive } from '@angular/core';
|
|
3
|
+
import { EventEmitter, Component, ViewEncapsulation, ViewChild, ElementRef, Input, Output, HostBinding, NgModule, Injectable, ChangeDetectorRef, ViewChildren, HostListener, Pipe, Renderer2, Inject, LOCALE_ID, NgZone, Directive, ViewContainerRef, ComponentFactoryResolver, forwardRef, ContentChild } from '@angular/core';
|
|
4
4
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
5
5
|
import { PDFDocument } from 'pdf-lib';
|
|
6
6
|
import * as PDFJS from 'pdfjs-dist/legacy/build/pdf';
|
|
@@ -23,11 +23,12 @@ import { Printer } from '@colijnit/mainapi/build/model/printer.bo';
|
|
|
23
23
|
import { SendMethod as SendMethod$1 } from '@colijnit/mainapi/build/model/send-method.bo';
|
|
24
24
|
import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/service/business-object-factory';
|
|
25
25
|
import { TagTreeItem } from '@colijnit/mainapi/build/model/tag-tree-item.bo';
|
|
26
|
+
import { ObjectConfiguration } from '@colijnit/ioneconnector/build/model/object-configuration';
|
|
26
27
|
import { PrintStockStickers } from '@colijnit/sharedapi/build/model/print-stock-stickers';
|
|
27
28
|
import { ArticleExtended } from '@colijnit/articleapi/build/model/article-extended.bo';
|
|
28
29
|
import { ArticleStock as ArticleStock$1 } from '@colijnit/articleapi/build/model/article-stock';
|
|
29
30
|
import { ArticleExtendedRequest } from '@colijnit/articleapi/build/model/article-extended-request';
|
|
30
|
-
import { IconModule, InputCheckboxModule, CoDialogModule, ButtonModule, ListOfValuesModule, OverlayService, ClickoutsideModule, OverlayModule, InputRadioButtonModule, SimpleGridModule, ImageModule, InputTextModule, InputNumberPickerModule, CoDialogWizardModule, InputTextareaModule, PopupModule, ResponsiveTextModule, InputDatePickerModule, InputSearchModule } from '@colijnit/corecomponents_v12';
|
|
31
|
+
import { IconModule, InputCheckboxModule, CoDialogModule, ButtonModule, ListOfValuesModule, OverlayService, ClickoutsideModule, OverlayModule, InputRadioButtonModule, SimpleGridModule, ImageModule, InputTextModule, InputNumberPickerModule, CoDialogWizardModule, InputTextareaModule, PopupModule, ResponsiveTextModule, InputDatePickerModule, InputSearchModule, PromptService, FormComponent, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, CoOrientation, CoreComponentsTranslationModule, TemplateWrapperModule, FormModule, ScreenConfigurationModule } from '@colijnit/corecomponents_v12';
|
|
31
32
|
import * as i1 from '@angular/platform-browser';
|
|
32
33
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
33
34
|
import { ArticleStockManagement } from '@colijnit/articleapi/build/model/article-stock-management';
|
|
@@ -40,7 +41,21 @@ import { SendMethodType } from '@colijnit/mainapi/build/enum/send-method-type.en
|
|
|
40
41
|
import { GetStockHistoryRequest } from '@colijnit/articleapi/build/model/get-stock-history-request';
|
|
41
42
|
import { Chart, DoughnutController, ArcElement } from 'chart.js';
|
|
42
43
|
import * as moment from 'moment';
|
|
44
|
+
import { FileTypeInternal } from '@colijnit/sharedapi/build/enum/refcode/file-type-internal.enum';
|
|
43
45
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
46
|
+
import { FileType as FileType$1 } from '@colijnit/mainapi/build/enum/file-type.enum';
|
|
47
|
+
import { ObjectRightType } from '@colijnit/sharedapi/build/enum/object-right-type.enum';
|
|
48
|
+
import { FileUtils } from '@colijnit/mainapi/build/utils/file-utils';
|
|
49
|
+
import { CoDocument } from '@colijnit/mainapi/build/model/co-document';
|
|
50
|
+
import { CoDocumentType } from '@colijnit/mainapi/build/enum/co-document-type.enum';
|
|
51
|
+
import { DocumentPublication } from '@colijnit/articleapi/build/enum/refcode/document-publication.enum';
|
|
52
|
+
import { CoDocumentRight } from '@colijnit/mainapi/build/model/co-document-right';
|
|
53
|
+
import { ArrayUtils as ArrayUtils$1 } from '@colijnit/sharedapi/build/utils/array-utils';
|
|
54
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
55
|
+
import { CoDomainValue } from '@colijnit/mainapi/build/model/co-domain-value.bo';
|
|
56
|
+
import { RelationKind } from '@colijnit/articleapi/build/enum/relation-kind.enum';
|
|
57
|
+
import { ActivityType } from '@colijnit/mainapi/build/enum/activity-type';
|
|
58
|
+
import { TimeUtils } from '@colijnit/mainapi/build/utils/time-utils';
|
|
44
59
|
|
|
45
60
|
class DocsignComponent {
|
|
46
61
|
constructor() {
|
|
@@ -478,6 +493,35 @@ class StringUtils {
|
|
|
478
493
|
static IsStringWithLength(str) {
|
|
479
494
|
return str && StringUtils.IsString(str) && str.length > 0;
|
|
480
495
|
}
|
|
496
|
+
/**
|
|
497
|
+
* Example usage:
|
|
498
|
+
* str = 'File is to large to upload. Maximum file size is {0} Mb'
|
|
499
|
+
* format = [FileUtils.MaxUploadSizeInMb]
|
|
500
|
+
* output = File is to large to upload. Maximum file size is 3 Mb
|
|
501
|
+
*
|
|
502
|
+
* str = '{0} is way better than {1}'
|
|
503
|
+
* format = ['Angular2','Angular1']
|
|
504
|
+
* output = Angular2 is way better than Angular1
|
|
505
|
+
*
|
|
506
|
+
* @param str The string that contains {0} and {1} etc, for replacement by given format data
|
|
507
|
+
* @param format The format replacement data
|
|
508
|
+
* @returns {string}
|
|
509
|
+
*/
|
|
510
|
+
static Format(str, format) {
|
|
511
|
+
const args = Array.prototype.slice.call(format);
|
|
512
|
+
return str.replace(/{(\d+)}/g, function (match, number) {
|
|
513
|
+
return typeof args[number] !== "undefined" ? (args[number] !== null ? args[number] : "") : "";
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
// Returns a new string string with N amount of characters removed from the end of it.
|
|
517
|
+
static RemoveLastChars(str, amount) {
|
|
518
|
+
if (str) {
|
|
519
|
+
return str.slice(0, -1 * amount);
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
522
|
+
return str;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
481
525
|
// Returns given string, escaped for use as string literal in regular expressions.
|
|
482
526
|
static _escapeRegExp(str) {
|
|
483
527
|
return str; // .replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^$\|]/g, "\\$&");
|
|
@@ -622,6 +666,14 @@ class SharedConnectorService {
|
|
|
622
666
|
this.mainConnector = new MainApi(this._optionsService.options);
|
|
623
667
|
});
|
|
624
668
|
}
|
|
669
|
+
getConfiguration(module, params) {
|
|
670
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
671
|
+
const response = yield this.mainConnector.getObjectConfigurations(module, params);
|
|
672
|
+
if (response && response.success) {
|
|
673
|
+
return this._boFactory.makeBOArrayFromRawBackendDataArray(ObjectConfiguration, response.resultObjects);
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
}
|
|
625
677
|
getAllPrinters() {
|
|
626
678
|
return __awaiter(this, void 0, void 0, function* () {
|
|
627
679
|
return new Promise((resolve, reject) => {
|
|
@@ -1391,9 +1443,12 @@ const IconSvg = {
|
|
|
1391
1443
|
"bring_forward_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path fill=\"#183153\" d=\"M224 464H448C456.8 464 464 456.8 464 448V224C464 215.2 456.8 208 448 208H384V160H448C483.3 160 512 188.7 512 224V448C512 483.3 483.3 512 448 512H224C188.7 512 160 483.3 160 448V384H208V448C208 456.8 215.2 464 224 464zM64 352C28.65 352 0 323.3 0 288V64C0 28.65 28.65 0 64 0H288C323.3 0 352 28.65 352 64V288C352 323.3 323.3 352 288 352H64z\"/></svg>",
|
|
1392
1444
|
"check_duotone": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><defs><style>.fa-secondary{opacity:.4}</style></defs><path class=\"fa-primary\" d=\"M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z\"/></svg>",
|
|
1393
1445
|
"check_round": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M25,10A15,15,0,1,0,40,25,15,15,0,0,0,25,10ZM23,34l-6.24-9.09,2.81-3.59L23,26.45,27.66,16h5.58Z\" fill=\"#484f60\"/></svg>",
|
|
1446
|
+
"clock_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M464 256A208 208 0 1 1 48 256a208 208 0 1 1 416 0zM0 256a256 256 0 1 0 512 0A256 256 0 1 0 0 256zM232 120V256c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2V120c0-13.3-10.7-24-24-24s-24 10.7-24 24z\"/></svg>",
|
|
1447
|
+
"comment_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M123.6 391.3c12.9-9.4 29.6-11.8 44.6-6.4c26.5 9.6 56.2 15.1 87.8 15.1c124.7 0 208-80.5 208-160s-83.3-160-208-160S48 160.5 48 240c0 32 12.4 62.8 35.7 89.2c8.6 9.7 12.8 22.5 11.8 35.5c-1.4 18.1-5.7 34.7-11.3 49.4c17-7.9 31.1-16.7 39.4-22.7zM21.2 431.9c1.8-2.7 3.5-5.4 5.1-8.1c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208s-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6c-15.1 6.6-32.3 12.6-50.1 16.1c-.8 .2-1.6 .3-2.4 .5c-4.4 .8-8.7 1.5-13.2 1.9c-.2 0-.5 .1-.7 .1c-5.1 .5-10.2 .8-15.3 .8c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c4.1-4.2 7.8-8.7 11.3-13.5c1.7-2.3 3.3-4.6 4.8-6.9c.1-.2 .2-.3 .3-.5z\"/></svg>",
|
|
1394
1448
|
"cross_skinny": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 30 30\"><g ><polygon points=\"25.35 5.52 24.65 4.81 15 14.46 5.35 4.81 4.65 5.52 14.29 15.17 4.65 24.81 5.35 25.52 15 15.87 24.65 25.52 25.35 24.81 15.71 15.17 25.35 5.52\" fill=\"#484f60\"/></g></svg>",
|
|
1395
1449
|
"delete_left_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path d=\"M432.1 208.1L385.9 256L432.1 303C442.3 312.4 442.3 327.6 432.1 336.1C423.6 346.3 408.4 346.3 399 336.1L352 289.9L304.1 336.1C295.6 346.3 280.4 346.3 271 336.1C261.7 327.6 261.7 312.4 271 303L318.1 256L271 208.1C261.7 199.6 261.7 184.4 271 175C280.4 165.7 295.6 165.7 304.1 175L352 222.1L399 175C408.4 165.7 423.6 165.7 432.1 175C442.3 184.4 442.3 199.6 432.1 208.1V208.1zM512 64C547.3 64 576 92.65 576 128V384C576 419.3 547.3 448 512 448H205.3C188.3 448 172 441.3 160 429.3L9.372 278.6C3.371 272.6 0 264.5 0 256C0 247.5 3.372 239.4 9.372 233.4L160 82.75C172 70.74 188.3 64 205.3 64L512 64zM528 128C528 119.2 520.8 112 512 112H205.3C201 112 196.9 113.7 193.9 116.7L54.63 256L193.9 395.3C196.9 398.3 201 400 205.3 400H512C520.8 400 528 392.8 528 384V128z\"/></svg>",
|
|
1396
1450
|
"delivery_truck": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><rect x=\"15.35\" y=\"16.56\" width=\"15.14\" height=\"10.94\" transform=\"translate(-1.83 2.08) rotate(-5)\" fill=\"#484f60\"/><path d=\"M38.5,18.1l-6.9.61L32.41,28l-7.63.67a3.76,3.76,0,0,1,1.43,2.25l7.25-.63A3.83,3.83,0,0,1,41,29.6l1-.1-.52-6Zm.29,5.84-3.91.34a.51.51,0,0,1-.55-.46L34,20.1a.49.49,0,0,1,.45-.54l2.27-.2a.5.5,0,0,1,.48.25l2,3.59A.5.5,0,0,1,38.79,23.94Z\" fill=\"#484f60\"/><path d=\"M19.66,29.09a3.8,3.8,0,0,0-1,2.46l-.74.07-1.82-.94L16,29.41Z\" fill=\"#484f60\"/><path d=\"M34.56,30.62a2.74,2.74,0,1,0,2.49-3A2.73,2.73,0,0,0,34.56,30.62Z\" fill=\"#484f60\"/><path d=\"M19.74,31.91a2.74,2.74,0,1,0,2.49-3A2.74,2.74,0,0,0,19.74,31.91Z\" fill=\"#484f60\"/><rect x=\"7.96\" y=\"17.63\" width=\"5\" height=\"1\" transform=\"translate(-1.54 0.98) rotate(-5)\" fill=\"#484f60\"/><rect x=\"11.02\" y=\"29.71\" width=\"3\" height=\"1\" transform=\"translate(-2.59 1.21) rotate(-5)\" fill=\"#484f60\"/><rect x=\"9.48\" y=\"23.53\" width=\"4\" height=\"1\" transform=\"matrix(1, -0.09, 0.09, 1, -2.05, 1.09)\" fill=\"#484f60\"/></svg>",
|
|
1451
|
+
"dropzone": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 30 30\"><g ><g><rect x=\"2\" y=\"1.67\" width=\"14\" height=\"6\" rx=\"2\" ry=\"2\" fill=\"#484f60\" opacity=\".5\"/><path d=\"M16.52,13.16l-.94-.47-1.61-2.53-1.23-1.62-.65-.85-1.53-1.59-2.06-1.17h-1.15l-.7,.7,.41,.91,2.47,2.2,.56,1.2,1.7,2.71,.82,2.26,.06,.74,.09,2.38-.23-.85-.97-.94-.79-.97-1.76-1.76-1.06-.35-.88,.24-.7,.62,1.32,1.44,1.56,1.97,2.14,3.73,2.2,2,1.82,1.14,2.44,1.06,1.91,1,2,1.03,.23,1.29,6.02-5.99v-.91s-.91-1-1-1.03c-.09-.03-.82-1.65-.82-1.65l-.47-1.91-.35-.97-1.32-1.67-.85-1.12-.5-.82-.88-1.14-.79-.77-1.33-.86-.22,.42,1.39,2.12-.94-.47-.86-1.48-1.33-1.38-1.06-.16-.03,.6,2.1,3.09-.94-.47-1.8-2.9-1.21-.86-1.29,.12,.18,.56,2.85,4.14Z\" fill=\"#484f60\"/><path d=\"M16,1.67h-1c1.1,0,2,.9,2,2v2c0,1.1-.9,2-2,2h1c1.1,0,2-.9,2-2V3.67c0-1.1-.9-2-2-2Z\" fill=\"#484f60\" opacity=\".5\"/><path d=\"M18,1.67h-1c1.1,0,2,.9,2,2v2c0,1.1-.9,2-2,2h1c1.1,0,2-.9,2-2V3.67c0-1.1-.9-2-2-2Z\" fill=\"#484f60\" opacity=\".25\"/><path d=\"M20,1.67h-1c1.1,0,2,.9,2,2v2c0,1.1-.9,2-2,2h1c1.1,0,2-.9,2-2V3.67c0-1.1-.9-2-2-2Z\" fill=\"#484f60\" opacity=\".1\"/></g></g></svg>",
|
|
1397
1452
|
"email": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M31.79,38.45A17.82,17.82,0,0,1,23.86,40,13.09,13.09,0,0,1,10.41,26.42C10.41,17.63,16.83,10,26.53,10c7.63,0,13.06,5.21,13.06,12.46,0,6.33-3.53,10.3-8.19,10.3a3.42,3.42,0,0,1-3.71-3.32h-.08A6.5,6.5,0,0,1,22,32.76c-2.75,0-4.82-2.11-4.82-5.65a9.85,9.85,0,0,1,10.13-10,12.89,12.89,0,0,1,5.13,1l-1.3,8c-.43,2.54-.13,3.71,1.08,3.75,1.85.09,4.18-2.28,4.18-7.28,0-5.65-3.62-10-10.3-10S13.73,17.76,13.73,26c0,7.25,4.57,11.3,11,11.3A14.81,14.81,0,0,0,31,36ZM28,20.65a5.34,5.34,0,0,0-1.33-.18c-2.85,0-5.09,2.81-5.09,6.12,0,1.64.73,2.68,2.16,2.68,1.59,0,3.27-2,3.66-4.53Z\" fill=\"#484f60\"/></svg>",
|
|
1398
1453
|
"envelope_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M64 112c-8.8 0-16 7.2-16 16v22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1V128c0-8.8-7.2-16-16-16H64zM48 212.2V384c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V212.2L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64H448c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z\"/></svg>",
|
|
1399
1454
|
"eye_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path d=\"M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z\"/></svg>",
|
|
@@ -1406,12 +1461,15 @@ const IconSvg = {
|
|
|
1406
1461
|
"lock": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 30 30\"><g ><g><path d=\"M22.65,11.67H7.35c-2.82,0-3.07,2.29-3.07,5.12v8.09c0,2.83,.25,5.12,3.07,5.12h15.29c2.81,0,3.07-2.29,3.07-5.12v-8.09c0-2.83-.25-5.12-3.07-5.12Zm-12.42,15.82l2.6-6.32c-1-.7-1.65-1.85-1.65-3.15,0-2.12,1.71-3.84,3.82-3.84s3.82,1.73,3.82,3.84c0,1.31-.65,2.46-1.65,3.15l2.6,6.32H10.22Z\" fill=\"#484f60\"/><path d=\"M19.51,6.64c0-3.6-2.02-4.07-4.51-4.07h0c-2.49,0-4.51,.47-4.51,4.07v3h-2.7v-3C7.79,1.62,11.02,0,15,0h0c3.98,0,7.21,1.62,7.21,6.64v3h-2.7v-3Z\" fill=\"#484f60\"/></g></g></svg>",
|
|
1407
1462
|
"message_sms_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M448-.0004H64c-35.25 0-64 28.75-64 63.1v287.1c0 35.25 28.75 63.1 64 63.1h96v83.98c0 9.836 11.02 15.55 19.12 9.7L304 415.1H448c35.25 0 64-28.75 64-63.1V63.1C512 28.75 483.3-.0004 448-.0004zM464 352c0 8.75-7.25 16-16 16h-160l-80 60v-60H64c-8.75 0-16-7.25-16-16V64c0-8.75 7.25-16 16-16h384c8.75 0 16 7.25 16 16V352zM124.4 192.6C113.6 189.5 103.2 187.2 104.2 181.5c.7813-4.5 10.28-6.562 21.5-4.906c4.156 .6562 8.75 2.094 13.09 3.594c8.375 2.906 17.47-1.562 20.34-9.906c2.875-8.344-1.562-17.47-9.906-20.34C143.1 147.8 136.5 145.9 130.6 145c-30.69-4.812-53.94 7.719-58 31.09c-5.656 33.03 26.5 42.47 38.63 46c13.72 3.947 25.62 6.432 24.56 12.34C135 239 125.7 241.1 114.3 239.4C107.9 238.4 100.4 235.4 93.38 232.9c-8.375-2.969-16 1.875-18.97 10.19S77.19 261.1 85.5 264.1C92.81 266.8 101.1 269.8 109.4 271C113.7 271.7 117.9 272 121.1 272c24.28 0 41.94-12.03 45.38-32.13C173.1 206.5 141.4 197.5 124.4 192.6zM396.4 192.6C385.6 189.5 375.2 187.2 376.2 181.5c.7813-4.5 10.31-6.562 21.5-4.906c4.156 .6562 8.75 2.094 13.09 3.594c8.406 2.906 17.47-1.562 20.34-9.906c2.875-8.344-1.562-17.47-9.906-20.34c-6.156-2.125-12.69-4.062-18.59-4.969c-30.75-4.812-53.97 7.719-58 31.09c-5.656 33.03 26.5 42.47 38.63 46c13.72 3.947 25.62 6.432 24.56 12.34c-.7813 4.562-10.12 6.656-21.56 4.938c-6.342-.9883-13.9-3.939-20.88-6.438c-8.375-2.969-16 1.875-18.97 10.19s2.781 17.97 11.09 20.97c7.312 2.656 15.62 5.656 23.88 6.906C385.7 271.7 389.9 272 393.1 272c24.28 0 41.94-12.03 45.38-32.13C445.1 206.5 413.4 197.5 396.4 192.6zM309.1 144.8c-6.469-2.062-13.72 .0625-17.88 5.594L256 197.3L220.8 150.4C216.7 144.9 209.4 142.7 202.9 144.8C196.4 147 192 153.1 192 160v96c0 8.844 7.156 16 16 16S224 264.8 224 256V208l19.19 25.59c6.062 8.062 19.56 8.062 25.62 0L288 208V256c0 8.844 7.156 16 16 16S320 264.8 320 256V160C320 153.1 315.6 147 309.1 144.8z\"/></svg>",
|
|
1408
1463
|
"message_sms_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M0 64C0 28.7 28.7 0 64 0H448c35.3 0 64 28.7 64 64V352c0 35.3-28.7 64-64 64H309.3L185.6 508.8c-4.8 3.6-11.3 4.2-16.8 1.5s-8.8-8.2-8.8-14.3V416H64c-35.3 0-64-28.7-64-64V64zm202.9 80.8C196.4 147 192 153.1 192 160v96c0 8.8 7.2 16 16 16s16-7.2 16-16V208l19.2 25.6c3 4 7.8 6.4 12.8 6.4s9.8-2.4 12.8-6.4L288 208v48c0 8.8 7.2 16 16 16s16-7.2 16-16V160c0-6.9-4.4-13-10.9-15.2s-13.7 .1-17.9 5.6L256 197.3l-35.2-46.9c-4.1-5.5-11.3-7.8-17.9-5.6zm173.1 38c0-1.1 .2-1.6 .4-1.9c.3-.4 .9-1.2 2.4-2c3.1-1.8 8-3 12.9-2.9c6.1 .1 12.9 1.4 20.1 3.4c8.5 2.3 17.3-2.8 19.6-11.3s-2.8-17.3-11.3-19.6c-8.2-2.2-17.9-4.3-27.9-4.4c-9.3-.1-20.4 1.9-29.7 7.4c-9.9 5.9-18.6 16.4-18.5 31.6c.1 14.7 8.8 24 17.7 29.4c7.6 4.6 17.1 7.4 24.3 9.6l1.2 .4c8.5 2.6 14.2 4.5 18 6.9c2.7 1.7 2.7 2.4 2.7 3.1l0 .2c0 1.6-.3 2.3-.6 2.7c-.3 .5-.9 1.2-2.1 2c-2.8 1.7-7.5 2.9-12.8 2.8c-7-.2-13.5-2.4-22.6-5.5l0 0 0 0c-1.5-.5-3.2-1.1-4.9-1.6c-8.4-2.8-17.4 1.7-20.2 10.1s1.7 17.4 10.1 20.2c1.2 .4 2.6 .9 4 1.4l0 0 0 0c8.8 3 20.4 7 32.6 7.4c9.8 .3 21.2-1.6 30.7-7.6c10.2-6.4 18-17.3 17.8-32.3c-.2-14.7-8.5-24.2-17.6-29.9c-8-5-17.9-8-25.2-10.2l-.6-.2c-8.6-2.6-14.4-4.4-18.2-6.8c-1.6-1-2.1-1.6-2.2-1.7c0-.1 0-.2 0-.4zm-272 0c0-1.1 .2-1.6 .4-1.9c.3-.4 .9-1.2 2.4-2c3.1-1.8 8-3 12.9-2.9c6.6 .1 16.7 1.6 23.3 3.4c8.5 2.3 17.3-2.8 19.6-11.3s-2.8-17.3-11.3-19.6c-8.8-2.4-21.6-4.3-31.1-4.4c-9.3-.1-20.4 1.9-29.7 7.4C80.6 157.3 72 167.8 72 183c.1 14.7 8.8 24 17.7 29.4c7.6 4.6 17.1 7.4 24.3 9.6l0 0 1.2 .4c8.5 2.6 14.2 4.5 18 6.9c2.7 1.7 2.7 2.4 2.7 3.1l0 .2c0 1.6-.3 2.3-.6 2.7c-.3 .5-.9 1.2-2.1 2c-2.8 1.7-7.5 2.9-12.8 2.8c-7.2-.2-14.2-2.6-23.7-5.8l0 0 0 0c-1.3-.4-2.7-.9-4.1-1.4c-8.4-2.8-17.4 1.7-20.2 10.1s1.7 17.4 10.1 20.2c1.1 .4 2.4 .8 3.6 1.2l0 0 0 0c9 3.1 20.9 7.2 33.2 7.6c9.8 .3 21.2-1.6 30.7-7.6c10.2-6.4 18-17.3 17.8-32.3c-.2-14.7-8.5-24.2-17.6-29.9c-8-5-17.9-8-25.2-10.2l-.6-.2c-8.6-2.6-14.4-4.4-18.3-6.8c-1.6-1-2.1-1.6-2.2-1.7c0-.1 0-.2 0-.4z\"/></svg>",
|
|
1464
|
+
"paperclip_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M375 73c-26-26-68.1-26-94.1 0L89 265C45.3 308.6 45.3 379.4 89 423s114.4 43.6 158.1 0L399 271c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L281 457c-62.4 62.4-163.5 62.4-225.9 0S-7.4 293.4 55 231L247 39C291.7-5.7 364.2-5.7 409 39s44.7 117.2 0 161.9L225.2 384.7c-31.6 31.6-83.6 28.7-111.5-6.2c-23.8-29.8-21.5-72.8 5.5-99.8L271 127c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9L153.2 312.7c-9.7 9.7-10.6 25.1-2 35.8c10 12.5 28.7 13.6 40 2.2L375 167c26-26 26-68.1 0-94.1z\"/></svg>",
|
|
1409
1465
|
"pdf": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M31.42,40.17H13.88c-2.16,0-2.72-.56-2.72-2.72V12.88c0-2.15.56-2.71,2.72-2.71h11.6l8.66,8.88v3.43H32.8V19.6l-7.88-8.09h-11c-1.38,0-1.38,0-1.38,1.37V37.45c0,1.37,0,1.37,1.38,1.37H31.42c1.38,0,1.38,0,1.38-1.37V35h1.34v2.43C34.14,39.61,33.58,40.17,31.42,40.17Z\" fill=\"#484f60\"/><path d=\"M27.83,26.63v4.24h1a3.57,3.57,0,0,0,.78-.06,1.22,1.22,0,0,0,.52-.26,1.44,1.44,0,0,0,.34-.62,4.13,4.13,0,0,0,.13-1.18,3.79,3.79,0,0,0-.13-1.14,1.51,1.51,0,0,0-.37-.62,1.14,1.14,0,0,0-.6-.3,5.93,5.93,0,0,0-1.06-.06Z\" fill=\"#484f60\"/><path d=\"M21.86,26.63v1.82h.71a3.57,3.57,0,0,0,1-.1A.88.88,0,0,0,24,28a.84.84,0,0,0,.14-.5.8.8,0,0,0-.2-.57.88.88,0,0,0-.52-.29,6.36,6.36,0,0,0-.93,0Z\" fill=\"#484f60\"/><path d=\"M19.14,24.27v9h19.7v-9Zm6.12,4.24a1.68,1.68,0,0,1-.54.63,1.9,1.9,0,0,1-.67.3,6.57,6.57,0,0,1-1.34.1h-.85V32H20.57V25.54h2.07a7.75,7.75,0,0,1,1.54.1,1.73,1.73,0,0,1,.93.63,2,2,0,0,1,.37,1.25A2,2,0,0,1,25.26,28.51Zm6.45,1.66A2.91,2.91,0,0,1,31,31.31a2.28,2.28,0,0,1-.91.51A4,4,0,0,1,29,32H26.54V25.54H28.9a4.21,4.21,0,0,1,1.22.13,2.08,2.08,0,0,1,1,.59,2.79,2.79,0,0,1,.61,1,4.76,4.76,0,0,1,.21,1.52A4.19,4.19,0,0,1,31.71,30.17Zm5.7-3.54h-3.1v1.52H37v1.08H34.31V32H33V25.54h4.39Z\" fill=\"#484f60\"/><path d=\"M25.2,10.84v6.44c0,1.78.27,2,2,2h6.23Z\" fill=\"#484f60\"/></svg>",
|
|
1466
|
+
"person_digging_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\"><path d=\"M208 64a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM440.8 288c8.2 .3 15.7 4.7 19.8 11.8l104 176c4.4 7.4 4.5 16.6 .2 24.1s-12.2 12.1-20.8 12.1H288c-7.7 0-15-3.7-19.5-10s-5.7-14.3-3.3-21.6l16-48c3.3-9.8 12.4-16.4 22.8-16.4h35.4l20.3-29.5L22.8 246.2c-12.2-5.1-18-19.1-12.9-31.4s19.1-18 31.4-12.9L61 210.1l19.8-36.2C96.2 145.6 125.8 128 158 128h3.8c52.3 0 98.5 33.8 114.4 83.6l32.3 101.6 79 32.9 32.8-47.7c4.6-6.8 12.4-10.7 20.6-10.4zm-190.4 1l-20-62.8c-9.5-29.9-37.3-50.2-68.6-50.2H158c-14.6 0-28.1 8-35.1 20.8l-17.3 31.8L250.4 289zm188.1 67.6l-66.7 97L364.6 464H501.9L438.5 356.6zM81.4 301.1l128 54.4c8.9 3.8 14.6 12.5 14.6 22.1V488c0 13.3-10.7 24-24 24s-24-10.7-24-24V393.5L87.5 355.9 47 494.7c-3.7 12.7-17 20-29.8 16.3S-2.7 494 1 481.3L49 316.5l7.6-25.9 24.9 10.6z\"/></svg>",
|
|
1410
1467
|
"print": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M38,16.5H12a2,2,0,0,0-2,2v9a2,2,0,0,0,2,2h2v-5H36v5h2a2,2,0,0,0,2-2v-9A2,2,0,0,0,38,16.5ZM37,21a1.5,1.5,0,1,1,1.5-1.5A1.5,1.5,0,0,1,37,21Z\" fill=\"#484f60\"/><path d=\"M35,11.5v5H15v-5H35m1-1H14v7H36v-7Z\" fill=\"#484f60\"/><path d=\"M35,25.5v13H15v-13H35m1-1H14v15H36v-15Z\" fill=\"#484f60\"/><rect x=\"17\" y=\"28.3\" width=\"16\" height=\"0.8\" fill=\"#484f60\"/><rect x=\"17\" y=\"31.5\" width=\"16\" height=\"0.8\" fill=\"#484f60\"/><rect x=\"17\" y=\"34.7\" width=\"16\" height=\"0.8\" fill=\"#484f60\"/></svg>",
|
|
1411
1468
|
"print_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M111.1 48h254.1L400 81.94V160H448V81.94c0-12.73-5.057-24.94-14.06-33.94l-33.94-33.94C391 5.057 378.8 0 366.1 0H111.1C85.49 0 64.01 21.48 64 47.98l.002 82.28c-.002 0 .002 0 0 0L64 160h48.01L111.1 48zM440 192H72C32.3 192 0 224.3 0 264v112c0 13.25 10.75 24 24 24H80V480c0 17.67 14.33 32 32 32h288c17.67 0 32-14.33 32-32v-80h56c13.25 0 24-10.75 24-24v-112C512 224.3 479.7 192 440 192zM384 464H128v-96h256V464zM464 352h-32c0-17.67-14.33-32-32-32h-288c-17.67 0-32 14.33-32 32h-32V264c0-13.23 10.77-24 24-24h368c13.23 0 24 10.77 24 24V352z\"/></svg>",
|
|
1412
1469
|
"print_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M448 192H64C28.65 192 0 220.7 0 256v96c0 17.67 14.33 32 32 32h32v96c0 17.67 14.33 32 32 32h320c17.67 0 32-14.33 32-32v-96h32c17.67 0 32-14.33 32-32V256C512 220.7 483.3 192 448 192zM384 448H128v-96h256V448zM432 296c-13.25 0-24-10.75-24-24c0-13.27 10.75-24 24-24s24 10.73 24 24C456 285.3 445.3 296 432 296zM128 64h229.5L384 90.51V160h64V77.25c0-8.484-3.375-16.62-9.375-22.62l-45.25-45.25C387.4 3.375 379.2 0 370.8 0H96C78.34 0 64 14.33 64 32v128h64V64z\"/></svg>",
|
|
1413
1470
|
"signature_field": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M20.1,25.42a1.1,1.1,0,1,1,1.27,1.45l-3.3,9.07A63.13,63.13,0,0,1,28,28.3l1.26-12-8.26-3-6.77,10A62.4,62.4,0,0,1,17,35.54l3.3-9.07A1.12,1.12,0,0,1,20.1,25.42Z\" fill=\"#484f60\"/><rect x=\"21.62\" y=\"11.43\" width=\"8.79\" height=\"2.34\" transform=\"translate(5.88 -8.14) rotate(20)\" fill=\"#484f60\"/><path d=\"M18.11,37.48c1.44,2.65,4.58,2.94,7.23,2.1,1.41-.44,2.2-1.49,3.44-2.06,2.42-1.1,3.13,1.2,5.36,1.37.42,0,2-.65,1.54-.68-2.55-.19-2.93-3.13-5.51-2.65a4.9,4.9,0,0,0-1.64.71c-.77.49-1.31,1.62-2.07,2l-4.61.56A3.38,3.38,0,0,1,20,37c-.22-.41-2,.28-1.85.5Z\" fill=\"#484f60\"/></svg>",
|
|
1414
1471
|
"tag_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M197.5 32c17 0 33.3 6.7 45.3 18.7l176 176c25 25 25 65.5 0 90.5L285.3 450.7c-25 25-65.5 25-90.5 0l-176-176C6.7 262.7 0 246.5 0 229.5V80C0 53.5 21.5 32 48 32H197.5zM48 229.5c0 4.2 1.7 8.3 4.7 11.3l176 176c6.2 6.2 16.4 6.2 22.6 0L384.8 283.3c6.2-6.2 6.2-16.4 0-22.6l-176-176c-3-3-7.1-4.7-11.3-4.7H48V229.5zM112 112a32 32 0 1 1 0 64 32 32 0 1 1 0-64z\"/></svg>",
|
|
1472
|
+
"trashbin": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M144 400C144 408.8 136.8 416 128 416C119.2 416 112 408.8 112 400V176C112 167.2 119.2 160 128 160C136.8 160 144 167.2 144 176V400zM240 400C240 408.8 232.8 416 224 416C215.2 416 208 408.8 208 400V176C208 167.2 215.2 160 224 160C232.8 160 240 167.2 240 176V400zM336 400C336 408.8 328.8 416 320 416C311.2 416 304 408.8 304 400V176C304 167.2 311.2 160 320 160C328.8 160 336 167.2 336 176V400zM310.1 22.56L336.9 64H432C440.8 64 448 71.16 448 80C448 88.84 440.8 96 432 96H416V432C416 476.2 380.2 512 336 512H112C67.82 512 32 476.2 32 432V96H16C7.164 96 0 88.84 0 80C0 71.16 7.164 64 16 64H111.1L137 22.56C145.8 8.526 161.2 0 177.7 0H270.3C286.8 0 302.2 8.526 310.1 22.56V22.56zM148.9 64H299.1L283.8 39.52C280.9 34.84 275.8 32 270.3 32H177.7C172.2 32 167.1 34.84 164.2 39.52L148.9 64zM64 432C64 458.5 85.49 480 112 480H336C362.5 480 384 458.5 384 432V96H64V432z\" fill=\"#484f60\"></path></svg>",
|
|
1415
1473
|
"xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 30 30\"><g ><g><path d=\"M21.42,30.17H3.87c-2.16,0-2.72-.56-2.72-2.72V2.88C1.16,.73,1.72,.17,3.87,.17H15.48l8.66,8.88v3.43h-1.34v-2.88L14.92,1.51H3.87q-1.37,0-1.37,1.37V27.45q0,1.37,1.37,1.37H21.42q1.37,0,1.37-1.37v-2.43h1.34v2.43c0,2.16-.56,2.72-2.72,2.72Z\" fill=\"#484f60\"/><path d=\"M15.2,.84V7.28c0,1.78,.27,2.05,2.04,2.05h6.22L15.2,.84Z\" fill=\"#484f60\"/><path d=\"M9.14,14.27v8.96H28.84V14.27H9.14Zm5.36,7.4l-1.3-2.02-1.3,2.02h-1.42l2-3.05-1.81-2.8h1.38l1.17,1.88,1.15-1.88h1.37l-1.82,2.84,2,3.01h-1.43Zm7.67,0h-1.1v-4.61l-1.16,4.61h-1.14l-1.16-4.61v4.61h-1.1v-5.85h1.77l1.06,3.99,1.05-3.99h1.77v5.85Zm5.33,0h-4.12v-5.81h1.18v4.82h2.94v.99Z\" fill=\"#484f60\"/></g></g></svg>",
|
|
1416
1474
|
"x_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><path d=\"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z\"/></svg>"
|
|
1417
1475
|
};
|
|
@@ -1475,9 +1533,12 @@ var Icon;
|
|
|
1475
1533
|
Icon["BringForwardRegular"] = "bring_forward_regular";
|
|
1476
1534
|
Icon["CheckDuotone"] = "check_duotone";
|
|
1477
1535
|
Icon["CheckRound"] = "check_round";
|
|
1536
|
+
Icon["ClockRegular"] = "clock_regular";
|
|
1537
|
+
Icon["CommentRegular"] = "comment_regular";
|
|
1478
1538
|
Icon["CrossSkinny"] = "cross_skinny";
|
|
1479
1539
|
Icon["DeleteLeftRegular"] = "delete_left_regular";
|
|
1480
1540
|
Icon["DeliveryTruck"] = "delivery_truck";
|
|
1541
|
+
Icon["Dropzone"] = "dropzone";
|
|
1481
1542
|
Icon["Email"] = "email";
|
|
1482
1543
|
Icon["EnvelopeRegular"] = "envelope_regular";
|
|
1483
1544
|
Icon["EyeRegular"] = "eye_regular";
|
|
@@ -1490,12 +1551,15 @@ var Icon;
|
|
|
1490
1551
|
Icon["Lock"] = "lock";
|
|
1491
1552
|
Icon["MessageSmsRegular"] = "message_sms_regular";
|
|
1492
1553
|
Icon["MessageSmsSolid"] = "message_sms_solid";
|
|
1554
|
+
Icon["PaperclipRegular"] = "paperclip_regular";
|
|
1493
1555
|
Icon["Pdf"] = "pdf";
|
|
1556
|
+
Icon["PersonDiggingRegular"] = "person_digging_regular";
|
|
1494
1557
|
Icon["Print"] = "print";
|
|
1495
1558
|
Icon["PrintRegular"] = "print_regular";
|
|
1496
1559
|
Icon["PrintSolid"] = "print_solid";
|
|
1497
1560
|
Icon["SignatureField"] = "signature_field";
|
|
1498
1561
|
Icon["TagRegular"] = "tag_regular";
|
|
1562
|
+
Icon["Trashbin"] = "trashbin";
|
|
1499
1563
|
Icon["Xml"] = "xml";
|
|
1500
1564
|
Icon["XSolid"] = "x_solid";
|
|
1501
1565
|
})(Icon || (Icon = {}));
|
|
@@ -2100,7 +2164,7 @@ class SharedService {
|
|
|
2100
2164
|
init(options) {
|
|
2101
2165
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2102
2166
|
yield this.options.initialize(options);
|
|
2103
|
-
this.connector.connect();
|
|
2167
|
+
yield this.connector.connect();
|
|
2104
2168
|
});
|
|
2105
2169
|
}
|
|
2106
2170
|
getAllPrinters() {
|
|
@@ -6598,9 +6662,59 @@ UCfirstPipe.decorators = [
|
|
|
6598
6662
|
},] }
|
|
6599
6663
|
];
|
|
6600
6664
|
|
|
6665
|
+
// Transforms a MimeType to the corresponding image data URI of that mime type, for direct use as X in img src=X
|
|
6666
|
+
class FileTypeImagePipe {
|
|
6667
|
+
constructor() {
|
|
6668
|
+
}
|
|
6669
|
+
/**
|
|
6670
|
+
* @param {FileTypeInternal} value
|
|
6671
|
+
* @param {boolean} [smallImage = false] Every mime type image has a smaller and a larger image available.
|
|
6672
|
+
* @returns {string} The data URI of the required mime type image
|
|
6673
|
+
*/
|
|
6674
|
+
transform(value, smallImage = false) {
|
|
6675
|
+
if (!value) {
|
|
6676
|
+
return "";
|
|
6677
|
+
}
|
|
6678
|
+
const smallSuffix = smallImage ? "_small" : "";
|
|
6679
|
+
let imageFileName;
|
|
6680
|
+
switch (value) {
|
|
6681
|
+
case FileTypeInternal.Image:
|
|
6682
|
+
imageFileName = "image" + smallSuffix + ".png";
|
|
6683
|
+
break;
|
|
6684
|
+
case FileTypeInternal.Pdf:
|
|
6685
|
+
imageFileName = "pdf" + smallSuffix + ".png";
|
|
6686
|
+
break;
|
|
6687
|
+
case FileTypeInternal.ExcelSheet:
|
|
6688
|
+
imageFileName = "excel" + smallSuffix + ".png";
|
|
6689
|
+
break;
|
|
6690
|
+
case FileTypeInternal.WordDocument:
|
|
6691
|
+
imageFileName = "word" + smallSuffix + ".png";
|
|
6692
|
+
break;
|
|
6693
|
+
case FileTypeInternal.Executable:
|
|
6694
|
+
imageFileName = "exe" + smallSuffix + ".png";
|
|
6695
|
+
break;
|
|
6696
|
+
case FileTypeInternal.TextFile:
|
|
6697
|
+
imageFileName = "text" + smallSuffix + ".png";
|
|
6698
|
+
break;
|
|
6699
|
+
default:
|
|
6700
|
+
imageFileName = "undefined" + smallSuffix + ".png";
|
|
6701
|
+
break;
|
|
6702
|
+
}
|
|
6703
|
+
return FileTypeImagePipe._PATH_TO_IMAGE_FOLDER + imageFileName;
|
|
6704
|
+
}
|
|
6705
|
+
}
|
|
6706
|
+
FileTypeImagePipe._PATH_TO_IMAGE_FOLDER = "./res/images/filetype/";
|
|
6707
|
+
FileTypeImagePipe.decorators = [
|
|
6708
|
+
{ type: Pipe, args: [{
|
|
6709
|
+
name: "fileTypeImage"
|
|
6710
|
+
},] }
|
|
6711
|
+
];
|
|
6712
|
+
FileTypeImagePipe.ctorParameters = () => [];
|
|
6713
|
+
|
|
6601
6714
|
const MASTER_PIPES = [
|
|
6602
6715
|
ArrayNumberPipe,
|
|
6603
|
-
UCfirstPipe
|
|
6716
|
+
UCfirstPipe,
|
|
6717
|
+
FileTypeImagePipe
|
|
6604
6718
|
];
|
|
6605
6719
|
|
|
6606
6720
|
// <b>Enum</b> Represents the different states of the three way thumb.
|
|
@@ -7021,6 +7135,3414 @@ SimpleTagsModule.decorators = [
|
|
|
7021
7135
|
},] }
|
|
7022
7136
|
];
|
|
7023
7137
|
|
|
7138
|
+
var TableName;
|
|
7139
|
+
(function (TableName) {
|
|
7140
|
+
TableName["Absence"] = "ABSENCE";
|
|
7141
|
+
TableName["AbsenceEvent"] = "ABSENCE_EVENT";
|
|
7142
|
+
TableName["AbsenceFile"] = "ABSENCE_FILE";
|
|
7143
|
+
TableName["AbsenceForm"] = "ABSENCE_FORM";
|
|
7144
|
+
TableName["AccountingPeriod"] = "PERIODES";
|
|
7145
|
+
TableName["Address"] = "ADRESSEN";
|
|
7146
|
+
TableName["Administration"] = "ADMINISTRATIES";
|
|
7147
|
+
TableName["AnamnesisForm"] = "ANAMNESIS_FORM";
|
|
7148
|
+
TableName["ArticleGroup"] = "ARTIKEL_GROEP";
|
|
7149
|
+
TableName["Articles"] = "ARTIKELEN";
|
|
7150
|
+
TableName["Branch"] = "FILIALEN";
|
|
7151
|
+
TableName["BusinessRule"] = "BRE_RULE";
|
|
7152
|
+
TableName["Booking"] = "BOEKINGSREGELS";
|
|
7153
|
+
TableName["Category"] = "CATEGORIE";
|
|
7154
|
+
TableName["Characteristic"] = "KENMERKEN";
|
|
7155
|
+
TableName["CharacteristicTypes"] = "KENMERK_SOORTEN";
|
|
7156
|
+
TableName["CharacteristicLines"] = "KENMERK_REGELS";
|
|
7157
|
+
TableName["Company"] = "BEDRIJVEN";
|
|
7158
|
+
TableName["Concept"] = "CONCEPTEN";
|
|
7159
|
+
TableName["Connections"] = "ASS_VERBINDING";
|
|
7160
|
+
TableName["ContactPerson"] = "CONTACTPERSONEN";
|
|
7161
|
+
TableName["CostCenter"] = "KOSTENPLAATS_DRAGER";
|
|
7162
|
+
TableName["Country"] = "LANDCODE";
|
|
7163
|
+
TableName["CurrencyInfo"] = "VALUTA";
|
|
7164
|
+
TableName["CurrentIndication"] = "CURRENT_INDICATION";
|
|
7165
|
+
TableName["Customer"] = "KLANTEN";
|
|
7166
|
+
TableName["DeclarationMedicalOfficer"] = "DECLARATION_MEDICAL_OFFICER";
|
|
7167
|
+
TableName["DeliveryMethod"] = "LEVERMETHODES";
|
|
7168
|
+
TableName["Department"] = "AFDELING";
|
|
7169
|
+
TableName["DiagnosisForm"] = "DIAGNOSIS_FORM";
|
|
7170
|
+
TableName["Documents"] = "DOCUMENTATIE";
|
|
7171
|
+
TableName["EmployabilityProfile"] = "EMPLOYABILITY_PROFILE";
|
|
7172
|
+
TableName["EmployeeContract"] = "EMPLOYEE_CONTRACT";
|
|
7173
|
+
TableName["EmployeeContractType"] = "EMPLOYEE_CONTRACT_TYPE";
|
|
7174
|
+
TableName["Employee"] = "PERSONEEL";
|
|
7175
|
+
TableName["EndEvaluation"] = "END_EVALUATION";
|
|
7176
|
+
TableName["ExternalSource"] = "EXTERNE_BRONNEN";
|
|
7177
|
+
TableName["FirstYearEvaluation"] = "FIRST_YEAR_EVALUATION";
|
|
7178
|
+
TableName["FmlDocument"] = "FML_DOCUMENT";
|
|
7179
|
+
TableName["Goods"] = "GOEDEREN";
|
|
7180
|
+
TableName["Hardware"] = "ASS_HARDWARE";
|
|
7181
|
+
TableName["Identification"] = "IDENTIFICATION";
|
|
7182
|
+
TableName["JobCategory"] = "JOB_CATEGORY";
|
|
7183
|
+
TableName["JobType"] = "JOB_TYPE";
|
|
7184
|
+
TableName["LedgerAccount"] = "GROOTBOEKEN";
|
|
7185
|
+
TableName["LedgerClassification"] = "VERDICHTINGEN";
|
|
7186
|
+
TableName["LedgerJournal"] = "DAGBOEKEN";
|
|
7187
|
+
TableName["LedgerMainClassification"] = "HOOFDVERDICHTINGEN";
|
|
7188
|
+
TableName["LedgerMutation"] = "GROOTBOEK_MUTATIES";
|
|
7189
|
+
TableName["Location"] = "LOCATIES";
|
|
7190
|
+
TableName["MainArticle"] = "HOOFDARTIKELEN";
|
|
7191
|
+
TableName["MedicalConsultFeedback"] = "MEDICAL_CONSULT_FEEDBACK";
|
|
7192
|
+
TableName["MedicalFile"] = "MEDICAL_FILE";
|
|
7193
|
+
TableName["MedicalForm"] = "MEDICAL_FORM";
|
|
7194
|
+
TableName["MedicalInformationForm"] = "MEDICAL_INFORMATION_FORM";
|
|
7195
|
+
TableName["Note"] = "NOTITIE";
|
|
7196
|
+
TableName["NotificationFullyRecovered"] = "NOTIFICATION_FULLY_RECOVERED";
|
|
7197
|
+
TableName["NotificationLongTermIllness"] = "NOTIFICATION_LONG_TERM_ILLNESS";
|
|
7198
|
+
TableName["PaymentCondition"] = "BETALINGSCONDITIES";
|
|
7199
|
+
TableName["PaymentMethod"] = "BETAALWIJZE";
|
|
7200
|
+
TableName["PlanOfApproach"] = "PLAN_OF_APPROACH";
|
|
7201
|
+
TableName["PriceList"] = "PRIJSLIJSTEN";
|
|
7202
|
+
TableName["ProblemAnalysis"] = "PROBLEM_ANALYSIS";
|
|
7203
|
+
TableName["ProblemAnalysisAdjustment"] = "PROBLEM_ANALYSIS_ADJUSTMENT";
|
|
7204
|
+
TableName["Relations"] = "RELATIES";
|
|
7205
|
+
TableName["RelationAddress"] = "ADRES_RELATIES";
|
|
7206
|
+
TableName["RelationCommunication"] = "COMM_RELATIES";
|
|
7207
|
+
TableName["Remarks"] = "OPMERKINGEN";
|
|
7208
|
+
TableName["Salary"] = "SALARY";
|
|
7209
|
+
TableName["ServiceProvision"] = "ASS_DIENSTVERLENING";
|
|
7210
|
+
TableName["ShortReintegrationReport"] = "SHORT_REINTEGRATION_REPORT";
|
|
7211
|
+
TableName["Software"] = "ASS_SOFTWARE";
|
|
7212
|
+
TableName["Supplier"] = "LEVERANCIERS";
|
|
7213
|
+
TableName["TagValues"] = "TAG_VALUES";
|
|
7214
|
+
TableName["Tasks"] = "TAKEN";
|
|
7215
|
+
TableName["Transactions"] = "TRANSACTIES";
|
|
7216
|
+
TableName["TransactionLines"] = "TRANSACTIE_REGELS";
|
|
7217
|
+
TableName["TurnoverGroup"] = "OMZETGROEPEN";
|
|
7218
|
+
TableName["Unit"] = "EENHEDEN";
|
|
7219
|
+
TableName["User"] = "GEBRUIKERS";
|
|
7220
|
+
TableName["Vat"] = "BTW";
|
|
7221
|
+
TableName["Warehouse"] = "MAGAZIJNEN";
|
|
7222
|
+
})(TableName || (TableName = {}));
|
|
7223
|
+
|
|
7224
|
+
function OperationWithAlwaysSuccessCallback(object) {
|
|
7225
|
+
return Promise.resolve(true);
|
|
7226
|
+
}
|
|
7227
|
+
|
|
7228
|
+
// @returns true iff given value equals null or equals undefined
|
|
7229
|
+
function isNill(value) {
|
|
7230
|
+
return value === null || value === undefined;
|
|
7231
|
+
}
|
|
7232
|
+
|
|
7233
|
+
// Static utility function holder related to objects.
|
|
7234
|
+
class ObjectUtils {
|
|
7235
|
+
/**
|
|
7236
|
+
* Returns whether all given values exist: for all values it holds that they are not null nor undefined. Short-circuit check.
|
|
7237
|
+
* @param {any} values Rest parameters with all objects to check existence for.
|
|
7238
|
+
* @returns {boolean} True if ALL given values are not null nor undefined, otherwise false (if at least one value was null or undefined)
|
|
7239
|
+
*/
|
|
7240
|
+
static AllExist(...values) {
|
|
7241
|
+
let allExist = true;
|
|
7242
|
+
for (let i = 0, len = values.length; i < len; i++) {
|
|
7243
|
+
if (isNill(values[i])) {
|
|
7244
|
+
allExist = false;
|
|
7245
|
+
break;
|
|
7246
|
+
}
|
|
7247
|
+
}
|
|
7248
|
+
return allExist;
|
|
7249
|
+
}
|
|
7250
|
+
/**
|
|
7251
|
+
* Copies all properties from object 'from' to object 'to'. Overwrites properties on object 'to' if property already exists.
|
|
7252
|
+
* Does not copy functions, only properties.
|
|
7253
|
+
* @param {Object} from The source object from which to copy all properties of to the 'to' object.
|
|
7254
|
+
* @param {Object} to The object to which the properties of the 'from' object will be copied.
|
|
7255
|
+
* @param {boolean} [allowUndefined = true] wether the 'to' object may be assigned null or undefined values to any of its properties.
|
|
7256
|
+
*/
|
|
7257
|
+
static CopyPropertiesFrom(from, to, allowUndefined = true) {
|
|
7258
|
+
if (!to) {
|
|
7259
|
+
to = {};
|
|
7260
|
+
}
|
|
7261
|
+
if (!from) {
|
|
7262
|
+
return to;
|
|
7263
|
+
}
|
|
7264
|
+
ObjectUtils.ForOwnProperty(from, (value, key) => {
|
|
7265
|
+
if (allowUndefined || notNill(value)) {
|
|
7266
|
+
to[key] = value;
|
|
7267
|
+
}
|
|
7268
|
+
});
|
|
7269
|
+
return to;
|
|
7270
|
+
}
|
|
7271
|
+
static DeepEquals(actual, expected) {
|
|
7272
|
+
if (actual === expected) {
|
|
7273
|
+
return true;
|
|
7274
|
+
}
|
|
7275
|
+
else if (actual instanceof Date && expected instanceof Date) {
|
|
7276
|
+
return actual.getTime() === expected.getTime();
|
|
7277
|
+
}
|
|
7278
|
+
else if (!actual || !expected || typeof actual !== "object" && typeof expected !== "object") {
|
|
7279
|
+
return actual === expected;
|
|
7280
|
+
}
|
|
7281
|
+
else {
|
|
7282
|
+
return this._objEquiv(actual, expected);
|
|
7283
|
+
}
|
|
7284
|
+
}
|
|
7285
|
+
// Performs given callback function for each own property of given plain object. Also works on string enums.
|
|
7286
|
+
static ForOwnProperty(plainObject, callback) {
|
|
7287
|
+
if (ObjectUtils.IsPlainObject(plainObject)) {
|
|
7288
|
+
for (const key in plainObject) {
|
|
7289
|
+
if (plainObject.hasOwnProperty(key) && typeof plainObject[key] !== "function") {
|
|
7290
|
+
const response = callback(plainObject[key], key);
|
|
7291
|
+
if (response === false) {
|
|
7292
|
+
break;
|
|
7293
|
+
}
|
|
7294
|
+
}
|
|
7295
|
+
}
|
|
7296
|
+
}
|
|
7297
|
+
}
|
|
7298
|
+
// Returns the class name of given argument. The argument can be an object or a class.
|
|
7299
|
+
static GetClassName(objectOrClass) {
|
|
7300
|
+
if (!objectOrClass) {
|
|
7301
|
+
return undefined;
|
|
7302
|
+
// arg was a class (or a function..)
|
|
7303
|
+
}
|
|
7304
|
+
else if (objectOrClass.constructor === Function) {
|
|
7305
|
+
return objectOrClass.name; // .. which has its readable name stores like this
|
|
7306
|
+
// else arg was an object
|
|
7307
|
+
}
|
|
7308
|
+
else {
|
|
7309
|
+
const constructorString = objectOrClass.constructor.toString();
|
|
7310
|
+
return constructorString.match(/\w+/g)[1];
|
|
7311
|
+
}
|
|
7312
|
+
}
|
|
7313
|
+
// Returns a shallow clone of the given original object. The clone is a SIMPLE OBJECT with the same properties as the original.
|
|
7314
|
+
static GetShallowClone(originalObject, objectClass) {
|
|
7315
|
+
let clonedObject = undefined;
|
|
7316
|
+
if (objectClass) {
|
|
7317
|
+
clonedObject = new objectClass();
|
|
7318
|
+
}
|
|
7319
|
+
else {
|
|
7320
|
+
clonedObject = {};
|
|
7321
|
+
}
|
|
7322
|
+
ObjectUtils.ForOwnProperty(originalObject, (value, key) => {
|
|
7323
|
+
clonedObject[key] = value;
|
|
7324
|
+
});
|
|
7325
|
+
return clonedObject;
|
|
7326
|
+
}
|
|
7327
|
+
static GetDeepClone(originalObject, circular = true) {
|
|
7328
|
+
// First create an empty object with
|
|
7329
|
+
// same prototype of our original source
|
|
7330
|
+
let propertyIndex;
|
|
7331
|
+
let descriptor;
|
|
7332
|
+
let keys;
|
|
7333
|
+
let current;
|
|
7334
|
+
let nextSource;
|
|
7335
|
+
let indexOf;
|
|
7336
|
+
const copies = [{
|
|
7337
|
+
source: originalObject,
|
|
7338
|
+
target: Object.create(Object.getPrototypeOf(originalObject))
|
|
7339
|
+
}];
|
|
7340
|
+
const cloneObject = copies[0].target;
|
|
7341
|
+
const sourceReferences = [originalObject];
|
|
7342
|
+
const targetReferences = [cloneObject];
|
|
7343
|
+
// First in, first out
|
|
7344
|
+
while (current = copies.shift()) { //NOSONAR
|
|
7345
|
+
keys = Object.getOwnPropertyNames(current.source);
|
|
7346
|
+
for (propertyIndex = 0; propertyIndex < keys.length; propertyIndex++) {
|
|
7347
|
+
// Save the source's descriptor
|
|
7348
|
+
descriptor = Object.getOwnPropertyDescriptor(current.source, keys[propertyIndex]);
|
|
7349
|
+
if (!descriptor.value || typeof descriptor.value !== "object") {
|
|
7350
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
7351
|
+
continue;
|
|
7352
|
+
}
|
|
7353
|
+
nextSource = descriptor.value;
|
|
7354
|
+
descriptor.value = Array.isArray(nextSource) ?
|
|
7355
|
+
[] :
|
|
7356
|
+
Object.create(Object.getPrototypeOf(nextSource));
|
|
7357
|
+
if (circular) {
|
|
7358
|
+
indexOf = sourceReferences.indexOf(nextSource);
|
|
7359
|
+
if (indexOf !== -1) {
|
|
7360
|
+
// The source is already referenced, just assign reference
|
|
7361
|
+
descriptor.value = targetReferences[indexOf];
|
|
7362
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
7363
|
+
continue;
|
|
7364
|
+
}
|
|
7365
|
+
sourceReferences.push(nextSource);
|
|
7366
|
+
targetReferences.push(descriptor.value);
|
|
7367
|
+
}
|
|
7368
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
7369
|
+
copies.push({ source: nextSource, target: descriptor.value });
|
|
7370
|
+
}
|
|
7371
|
+
}
|
|
7372
|
+
return cloneObject;
|
|
7373
|
+
}
|
|
7374
|
+
static IsEmpty(obj) {
|
|
7375
|
+
return isNill(obj) || Object.getOwnPropertyNames(obj).length === 0;
|
|
7376
|
+
}
|
|
7377
|
+
// Returns whether given object is an existing, plain object. That is, it defined, its type if 'object' and it is NOT an array or func.
|
|
7378
|
+
static IsPlainObject(object) {
|
|
7379
|
+
return object !== null && !Array.isArray(object) && typeof object !== "function" && typeof object === "object";
|
|
7380
|
+
}
|
|
7381
|
+
/**
|
|
7382
|
+
* Returns an instance of given class with data of given dataObject. Only works if that class has a default constructor without args.
|
|
7383
|
+
* Does not actually create a new object if it alread is an instance of that class.
|
|
7384
|
+
* @param {any} clazz A class that has a default constructor
|
|
7385
|
+
* @param {any} [dataObject] The object with data to copy to the new instance of the class
|
|
7386
|
+
* @returns {any} An object that is an instance of given class, with given data applied to it.
|
|
7387
|
+
*/
|
|
7388
|
+
static MakeInstanceOf(clazz, dataObject) {
|
|
7389
|
+
// dont make a clone if given dataObject already instance of clazz
|
|
7390
|
+
if (dataObject instanceof clazz) {
|
|
7391
|
+
return dataObject;
|
|
7392
|
+
}
|
|
7393
|
+
else {
|
|
7394
|
+
const asClazz = new clazz();
|
|
7395
|
+
ObjectUtils.CopyPropertiesFrom(dataObject, asClazz);
|
|
7396
|
+
return asClazz;
|
|
7397
|
+
}
|
|
7398
|
+
}
|
|
7399
|
+
// Returns the value of a random own property of given object.
|
|
7400
|
+
static PickRandomPropertyValue(object) {
|
|
7401
|
+
if (!object) {
|
|
7402
|
+
return;
|
|
7403
|
+
}
|
|
7404
|
+
let result;
|
|
7405
|
+
let count = 0;
|
|
7406
|
+
for (const prop in object) {
|
|
7407
|
+
if (object.hasOwnProperty(prop)) {
|
|
7408
|
+
count++;
|
|
7409
|
+
if (Math.random() < 1 / count) {
|
|
7410
|
+
result = object[prop];
|
|
7411
|
+
}
|
|
7412
|
+
}
|
|
7413
|
+
}
|
|
7414
|
+
return result;
|
|
7415
|
+
}
|
|
7416
|
+
// Returns a default if given value doesn't exist, otherwise just value.
|
|
7417
|
+
static ValueOrDefault(value, defaultReturnVal = "") {
|
|
7418
|
+
return notNill(value) ? value : defaultReturnVal;
|
|
7419
|
+
}
|
|
7420
|
+
static _isArguments(x) {
|
|
7421
|
+
const supportsArgsClass = this._supportsArgumentsClass();
|
|
7422
|
+
return supportsArgsClass ? this._isArgumentsWhenArgsClassSupported(x) : this._isArgumentsWhenArgsClassNotSupported(x);
|
|
7423
|
+
}
|
|
7424
|
+
static _isArgumentsWhenArgsClassNotSupported(object) {
|
|
7425
|
+
return object &&
|
|
7426
|
+
typeof object === "object" &&
|
|
7427
|
+
typeof object.length === "number" &&
|
|
7428
|
+
Object.prototype.hasOwnProperty.call(object, "callee") &&
|
|
7429
|
+
!Object.prototype.propertyIsEnumerable.call(object, "callee") ||
|
|
7430
|
+
false;
|
|
7431
|
+
}
|
|
7432
|
+
static _isArgumentsWhenArgsClassSupported(object) {
|
|
7433
|
+
return Object.prototype.toString.call(object) === "[object Arguments]";
|
|
7434
|
+
}
|
|
7435
|
+
static _isBuffer(x) {
|
|
7436
|
+
if (!x || typeof x !== "object" || typeof x.length !== "number") {
|
|
7437
|
+
return false;
|
|
7438
|
+
}
|
|
7439
|
+
if (typeof x.copy !== "function" || typeof x.slice !== "function") {
|
|
7440
|
+
return false;
|
|
7441
|
+
}
|
|
7442
|
+
return !(x.length > 0 && typeof x[0] !== "number");
|
|
7443
|
+
}
|
|
7444
|
+
static _isUndefinedOrNull(value) {
|
|
7445
|
+
return value === null || value === undefined;
|
|
7446
|
+
}
|
|
7447
|
+
static _objEquiv(a, b) {
|
|
7448
|
+
let i, key;
|
|
7449
|
+
if (this._isUndefinedOrNull(a) || this._isUndefinedOrNull(b)) {
|
|
7450
|
+
return false;
|
|
7451
|
+
}
|
|
7452
|
+
if (a.prototype !== b.prototype) {
|
|
7453
|
+
return false;
|
|
7454
|
+
}
|
|
7455
|
+
if (this._isArguments(a)) {
|
|
7456
|
+
if (!this._isArguments(b)) {
|
|
7457
|
+
return false;
|
|
7458
|
+
}
|
|
7459
|
+
a = Array.prototype.slice.call(a);
|
|
7460
|
+
b = Array.prototype.slice.call(b);
|
|
7461
|
+
return this.DeepEquals(a, b);
|
|
7462
|
+
}
|
|
7463
|
+
if (this._isBuffer(a)) {
|
|
7464
|
+
if (!this._isBuffer(b)) {
|
|
7465
|
+
return false;
|
|
7466
|
+
}
|
|
7467
|
+
if (a.length !== b.length) {
|
|
7468
|
+
return false;
|
|
7469
|
+
}
|
|
7470
|
+
for (i = 0; i < a.length; i++) {
|
|
7471
|
+
if (a[i] !== b[i]) {
|
|
7472
|
+
return false;
|
|
7473
|
+
}
|
|
7474
|
+
}
|
|
7475
|
+
return true;
|
|
7476
|
+
}
|
|
7477
|
+
let ka;
|
|
7478
|
+
let kb;
|
|
7479
|
+
try {
|
|
7480
|
+
ka = Object.keys(a);
|
|
7481
|
+
kb = Object.keys(b);
|
|
7482
|
+
}
|
|
7483
|
+
catch (e) {
|
|
7484
|
+
return false;
|
|
7485
|
+
}
|
|
7486
|
+
if (ka.length !== kb.length) {
|
|
7487
|
+
return false;
|
|
7488
|
+
}
|
|
7489
|
+
ka.sort();
|
|
7490
|
+
kb.sort();
|
|
7491
|
+
for (i = ka.length - 1; i >= 0; i--) {
|
|
7492
|
+
if (ka[i] !== kb[i]) {
|
|
7493
|
+
return false;
|
|
7494
|
+
}
|
|
7495
|
+
}
|
|
7496
|
+
for (i = ka.length - 1; i >= 0; i--) {
|
|
7497
|
+
key = ka[i];
|
|
7498
|
+
if (!this.DeepEquals(a[key], b[key])) {
|
|
7499
|
+
return false;
|
|
7500
|
+
}
|
|
7501
|
+
}
|
|
7502
|
+
return typeof a === typeof b;
|
|
7503
|
+
}
|
|
7504
|
+
static _supportsArgumentsClass() {
|
|
7505
|
+
return Object.prototype.toString.call(arguments) === "[object Arguments]";
|
|
7506
|
+
}
|
|
7507
|
+
}
|
|
7508
|
+
|
|
7509
|
+
// Static utility function holder related to numeric variable evaluations and operations.
|
|
7510
|
+
class NumberUtils {
|
|
7511
|
+
// For user-typed number input; supports comma's as decimal delimiter.
|
|
7512
|
+
static ParseIntNumberInput(arg) {
|
|
7513
|
+
return NumberUtils.ParseInt(NumberUtils._NumberInputToNumberStr(arg));
|
|
7514
|
+
}
|
|
7515
|
+
// Parses given argument to an integer, using a native parseInt() function with a radix of 10. Returns NaN if parsing was not possible.
|
|
7516
|
+
static ParseInt(arg) {
|
|
7517
|
+
if (isNill(arg) || Array.isArray(arg)) {
|
|
7518
|
+
return undefined;
|
|
7519
|
+
}
|
|
7520
|
+
return parseInt(arg, 10);
|
|
7521
|
+
}
|
|
7522
|
+
// For user-typed number input; supports comma's as decimal delimiter.
|
|
7523
|
+
static ParseFloatNumberInput(arg, decimalPrecision = 2) {
|
|
7524
|
+
return NumberUtils.ParseFloat(NumberUtils._NumberInputToNumberStr(arg), decimalPrecision);
|
|
7525
|
+
}
|
|
7526
|
+
static ParseFloatNumberInputKeepPrecision(arg) {
|
|
7527
|
+
const correctedInputStr = NumberUtils._NumberInputToNumberStr(arg);
|
|
7528
|
+
const decimalPrecision = this.GetDecimalPlaces(correctedInputStr);
|
|
7529
|
+
return NumberUtils.ParseFloat(correctedInputStr, decimalPrecision);
|
|
7530
|
+
}
|
|
7531
|
+
/**
|
|
7532
|
+
* Returns given arg as a float number with given decimal precision, if possible. Returns NaN if parse conversion failed.
|
|
7533
|
+
*
|
|
7534
|
+
* @param {any} arg The argument to parse to a float
|
|
7535
|
+
* @param {number} decimalPrecision The number of decimals, or the precision, the parsed return float should have
|
|
7536
|
+
* @returns {number} NaN if not possible, else the parsed float value
|
|
7537
|
+
*/
|
|
7538
|
+
static ParseFloat(arg, decimalPrecision = 2) {
|
|
7539
|
+
if (!ObjectUtils.AllExist(arg, decimalPrecision) || Array.isArray(arg)) {
|
|
7540
|
+
return NaN;
|
|
7541
|
+
}
|
|
7542
|
+
if (!NumberUtils.IsInteger(decimalPrecision) || decimalPrecision < 0) {
|
|
7543
|
+
decimalPrecision = 2;
|
|
7544
|
+
// toFixed() can only handle up until 20
|
|
7545
|
+
}
|
|
7546
|
+
else if (decimalPrecision > 20) {
|
|
7547
|
+
decimalPrecision = 20;
|
|
7548
|
+
}
|
|
7549
|
+
return parseFloat(parseFloat(arg).toFixed(decimalPrecision));
|
|
7550
|
+
}
|
|
7551
|
+
/**
|
|
7552
|
+
* Returns given arg as a float number with given decimal precision, if possible. Returns NaN if parse conversion failed.
|
|
7553
|
+
*
|
|
7554
|
+
* @param arg The argument to parse to a float
|
|
7555
|
+
* @returns {number} The argument as a float with its original decimal precision intact
|
|
7556
|
+
*/
|
|
7557
|
+
static ParseFloatKeepPrecision(arg) {
|
|
7558
|
+
const decimalPrecision = this.GetDecimalPlaces(arg);
|
|
7559
|
+
return this.ParseFloat(arg, decimalPrecision);
|
|
7560
|
+
}
|
|
7561
|
+
/**
|
|
7562
|
+
* Returns the given argument as a number. Returns given defaultValue if conversion of argument was impossible.
|
|
7563
|
+
* @param arg
|
|
7564
|
+
* @param {number} [defaultValue = 0]
|
|
7565
|
+
* @returns {number}
|
|
7566
|
+
*/
|
|
7567
|
+
static ParseNumberOrDefault(arg, defaultValue = 0) {
|
|
7568
|
+
if (Array.isArray(arg)) {
|
|
7569
|
+
return defaultValue;
|
|
7570
|
+
}
|
|
7571
|
+
if (!NumberUtils.IsNumber(arg)) {
|
|
7572
|
+
arg = parseFloat(arg);
|
|
7573
|
+
arg = isNaN(arg) ? defaultValue : arg;
|
|
7574
|
+
}
|
|
7575
|
+
return arg;
|
|
7576
|
+
}
|
|
7577
|
+
// Returns true iff given argument is an integer number. Returns false on non-numbers or numbers with significant decimals.
|
|
7578
|
+
static IsInteger(arg) {
|
|
7579
|
+
if (isNaN(arg) || Array.isArray(arg)) {
|
|
7580
|
+
return false;
|
|
7581
|
+
}
|
|
7582
|
+
const argAsFloat = parseFloat(arg);
|
|
7583
|
+
return ((argAsFloat | 0) === argAsFloat); // returns whether 'arg converted to an integer equals arg'
|
|
7584
|
+
}
|
|
7585
|
+
// Returns the number of decimal places of the given number. Returns 0 if no decimals whatsoever could be found on given arg.
|
|
7586
|
+
static GetDecimalPlaces(arg, maxAnswer = 1000) {
|
|
7587
|
+
const match = ("" + arg).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
|
|
7588
|
+
if (!match) {
|
|
7589
|
+
return 0;
|
|
7590
|
+
}
|
|
7591
|
+
let answer = Math.max(0,
|
|
7592
|
+
// number of digits right of decimal point.
|
|
7593
|
+
(match[1] ? match[1].length : 0)
|
|
7594
|
+
// adjust for scientific notation
|
|
7595
|
+
- (match[2] ? +match[2] : 0));
|
|
7596
|
+
if (answer > maxAnswer) {
|
|
7597
|
+
answer = maxAnswer;
|
|
7598
|
+
}
|
|
7599
|
+
return answer;
|
|
7600
|
+
}
|
|
7601
|
+
// Parses given numberInput to a number, or returns given defaultValue if parse not possible. Allows ',' char as decimal delimiter.
|
|
7602
|
+
static ParseNumberInputOrDefault(numberInput, defaultValue = 0) {
|
|
7603
|
+
return NumberUtils.ParseNumberOrDefault(NumberUtils._NumberInputToNumberStr(numberInput), defaultValue);
|
|
7604
|
+
}
|
|
7605
|
+
// Returns whether the type of given argument is 'number'.
|
|
7606
|
+
static IsNumber(arg) {
|
|
7607
|
+
return typeof arg === "number" && !isNaN(arg);
|
|
7608
|
+
}
|
|
7609
|
+
/**
|
|
7610
|
+
* Returns whether given arg is indeed not a number (it's NaN or it has another type than 'number')
|
|
7611
|
+
* Our exact copy of AS Flex'es isNaN(arg) function. Always use this method for copying Flex isNaN(..) occurences into TypeScript.
|
|
7612
|
+
* @param arg
|
|
7613
|
+
* @returns {boolean}
|
|
7614
|
+
* @constructor
|
|
7615
|
+
*/
|
|
7616
|
+
static IsNaN(arg) {
|
|
7617
|
+
return isNaN(arg) || !NumberUtils.IsNumber(arg);
|
|
7618
|
+
}
|
|
7619
|
+
// Our copy of CoMath.NaN. Returns number, or substitute if NumberUtils.IsNaN(number) holds true.
|
|
7620
|
+
static NaN(number, substitute = 0) {
|
|
7621
|
+
return NumberUtils.IsNaN(number) ? substitute : number;
|
|
7622
|
+
}
|
|
7623
|
+
// Returns whether the value is parasable as a number.
|
|
7624
|
+
static IsParsableNumber(arg) {
|
|
7625
|
+
if (Array.isArray(arg)) {
|
|
7626
|
+
return false;
|
|
7627
|
+
}
|
|
7628
|
+
return !isNaN(parseFloat(arg));
|
|
7629
|
+
}
|
|
7630
|
+
static IsParsableNumberInput(numberInput) {
|
|
7631
|
+
return NumberUtils.IsParsableNumber(NumberUtils._NumberInputToNumberStr(numberInput));
|
|
7632
|
+
}
|
|
7633
|
+
/**
|
|
7634
|
+
* Returns whether given arg is parseable as a number, and whether the lengts of its number parse result is equal to its original length.
|
|
7635
|
+
* I.e. this function returns FALSE with given number-parsable strings, but that have non-numeric appendices, eg '2233ff'. That arg
|
|
7636
|
+
* IS number-parseable, but not a strict 'string number', the latter being what this method actually checks for.
|
|
7637
|
+
*/
|
|
7638
|
+
static IsStringNumber(arg) {
|
|
7639
|
+
if (!NumberUtils.IsParsableNumber(arg)) {
|
|
7640
|
+
return false;
|
|
7641
|
+
}
|
|
7642
|
+
else {
|
|
7643
|
+
return arg.toString().length === parseFloat(arg).toString().length;
|
|
7644
|
+
}
|
|
7645
|
+
}
|
|
7646
|
+
static IsListOfNumbers(arg, separator = ",") {
|
|
7647
|
+
const nrs = arg.split(separator);
|
|
7648
|
+
if (nrs.length === 0) {
|
|
7649
|
+
return false;
|
|
7650
|
+
}
|
|
7651
|
+
return nrs.filter(s => NumberUtils.IsStringNumber(s)).length === nrs.length;
|
|
7652
|
+
}
|
|
7653
|
+
// Returns given argument as a string representation of a number parse, e.g. "1" for a number parse result of arg to 1.
|
|
7654
|
+
static ParseStringNumber(arg) {
|
|
7655
|
+
if (!this.IsStringNumber(arg)) {
|
|
7656
|
+
return NaN;
|
|
7657
|
+
}
|
|
7658
|
+
return NumberUtils.ParseFloatKeepPrecision(arg);
|
|
7659
|
+
}
|
|
7660
|
+
static ParseStringNumberDefault(arg, defaultValue = 0) {
|
|
7661
|
+
return NumberUtils.NaN(NumberUtils.ParseStringNumber(arg), defaultValue);
|
|
7662
|
+
}
|
|
7663
|
+
/**
|
|
7664
|
+
* Returns a random integer in range [lowerBound .. upperBound], an inclusive range. Returns NaN if not possible.
|
|
7665
|
+
* Given bounds are truncated first, before serving as the true lower- and upper bounds for the random int.
|
|
7666
|
+
*/
|
|
7667
|
+
static RandomInt(lowerBoundInt, upperBoundInt) {
|
|
7668
|
+
if (!NumberUtils.IsNumber(lowerBoundInt) || !NumberUtils.IsNumber(upperBoundInt) || lowerBoundInt > upperBoundInt) {
|
|
7669
|
+
return NaN;
|
|
7670
|
+
}
|
|
7671
|
+
lowerBoundInt = Math.trunc(lowerBoundInt);
|
|
7672
|
+
upperBoundInt = Math.trunc(upperBoundInt);
|
|
7673
|
+
if (lowerBoundInt === upperBoundInt) {
|
|
7674
|
+
return lowerBoundInt;
|
|
7675
|
+
}
|
|
7676
|
+
const delta = upperBoundInt - lowerBoundInt;
|
|
7677
|
+
return (Math.round(Math.random() * delta) + lowerBoundInt);
|
|
7678
|
+
}
|
|
7679
|
+
// Adds thousands comma's to given value, E.g. '1000' to '1,000'. Returns empty string if value was undefined.
|
|
7680
|
+
static AddThousandsCommasTo(value) {
|
|
7681
|
+
if (isNill(value)) {
|
|
7682
|
+
return "";
|
|
7683
|
+
}
|
|
7684
|
+
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
7685
|
+
}
|
|
7686
|
+
/**
|
|
7687
|
+
* Function used to check wether a given number is composed of another number, power-of-two wise.
|
|
7688
|
+
* Example usage: NumberUtils.NumIsComposedOf(articleListObject.publication, ArticlePublication.Selector).
|
|
7689
|
+
* This would return whether or not that articleListObject was publicated for selector or not, where articleListObject.publication
|
|
7690
|
+
* was possibly a 'COMPOSITE that was made out of (including)' ArticlePublication.Selector.
|
|
7691
|
+
*/
|
|
7692
|
+
static NumIsComposedOfOtherPowTwoNum(bigNrToCheck, powTwoNumItShouldBeComposedOf) {
|
|
7693
|
+
if (!bigNrToCheck) {
|
|
7694
|
+
return false;
|
|
7695
|
+
}
|
|
7696
|
+
else if (!powTwoNumItShouldBeComposedOf) {
|
|
7697
|
+
return true;
|
|
7698
|
+
}
|
|
7699
|
+
else {
|
|
7700
|
+
return ((bigNrToCheck & powTwoNumItShouldBeComposedOf) === powTwoNumItShouldBeComposedOf);
|
|
7701
|
+
}
|
|
7702
|
+
}
|
|
7703
|
+
/**
|
|
7704
|
+
* Returns given nr, or the given default number (default 0) if the nr number was undefined or otherwise not a number.
|
|
7705
|
+
* Same as CoMath.NaN from AS code (used as its substitute in transaction logic)
|
|
7706
|
+
* @param nr
|
|
7707
|
+
* @param defaultNr
|
|
7708
|
+
* @returns {number}
|
|
7709
|
+
*/
|
|
7710
|
+
static NrOrDefault(nr, defaultNr = 0) {
|
|
7711
|
+
if (notNill(nr) && NumberUtils.IsNumber(nr)) {
|
|
7712
|
+
return nr;
|
|
7713
|
+
}
|
|
7714
|
+
else {
|
|
7715
|
+
return defaultNr;
|
|
7716
|
+
}
|
|
7717
|
+
}
|
|
7718
|
+
/**
|
|
7719
|
+
* Returns whether given nrToCheck is within the given precision and scale limits. Precision and scale, here, are Oracle DB terms.
|
|
7720
|
+
* This function can thus be used to check whether the given number is safe to send to the 'database' beforehand, if we know the
|
|
7721
|
+
* precision and scale of the number in the db declaration.
|
|
7722
|
+
*
|
|
7723
|
+
* I.e. A number declared in the Oracle DB as number(5, 2) has a precision of 5 and a scale of 2.
|
|
7724
|
+
*
|
|
7725
|
+
* @param {number} nrToCheck
|
|
7726
|
+
* @param {number} precision The number of significant digits, including possibly negative scale. E.g. 3 in '123' and 5 in '51.123'
|
|
7727
|
+
* @param {number} [scale = 0] The number of significant digits AFTER the decimal point. E.g. 1 in 5432.1 and 3 in 54000.003
|
|
7728
|
+
* @returns {CheckPrecisionAndScaleResult} Whether given nrToCheck is ok for given precision and scale, and if not, the
|
|
7729
|
+
* nearest number that IS ok for those constraints.
|
|
7730
|
+
*/
|
|
7731
|
+
static CheckPrecisionAndScale(nrToCheck, precision, scale = 0) {
|
|
7732
|
+
// let's say any undefined number is checked OK, and all numbers are checked OK for an undefined precision
|
|
7733
|
+
if (!ObjectUtils.AllExist(nrToCheck, precision, scale)) {
|
|
7734
|
+
return { isOk: true, nearestOkNr: NaN };
|
|
7735
|
+
}
|
|
7736
|
+
// no number can have 0 or less than 0 significant digits, in our universe
|
|
7737
|
+
if (precision < 1 || precision - scale < 1) {
|
|
7738
|
+
return { isOk: false, nearestOkNr: NaN };
|
|
7739
|
+
}
|
|
7740
|
+
// begin check
|
|
7741
|
+
const isNegative = (nrToCheck < 0);
|
|
7742
|
+
const nrParts = nrToCheck.toString().split(".");
|
|
7743
|
+
// remove minus sign if negative
|
|
7744
|
+
if (isNegative) {
|
|
7745
|
+
nrParts[0] = nrParts[0].slice(1);
|
|
7746
|
+
}
|
|
7747
|
+
const numCountBeforeDot = nrParts[0].length;
|
|
7748
|
+
const allowedNumCountBeforeDot = precision - scale;
|
|
7749
|
+
if (numCountBeforeDot <= allowedNumCountBeforeDot) {
|
|
7750
|
+
return { isOk: true, nearestOkNr: nrToCheck };
|
|
7751
|
+
}
|
|
7752
|
+
else {
|
|
7753
|
+
// cut a part from the "before decimal number" so that the number is not too big anymore
|
|
7754
|
+
const numCountToRemove = numCountBeforeDot - allowedNumCountBeforeDot;
|
|
7755
|
+
// remove the right-most numbers before the decimal dot
|
|
7756
|
+
nrParts[0] = nrParts[0].slice(0, -1 * numCountToRemove);
|
|
7757
|
+
// add minus sign again if it was negative
|
|
7758
|
+
if (isNegative) {
|
|
7759
|
+
nrParts[0] = "-" + nrParts[0];
|
|
7760
|
+
}
|
|
7761
|
+
// build and return composite number again
|
|
7762
|
+
let nearestOkNr;
|
|
7763
|
+
if (nrParts[1]) {
|
|
7764
|
+
nearestOkNr = Number(nrParts[0] + "." + nrParts[1]);
|
|
7765
|
+
}
|
|
7766
|
+
else {
|
|
7767
|
+
nearestOkNr = Number(nrParts[0]);
|
|
7768
|
+
}
|
|
7769
|
+
return { isOk: false, nearestOkNr: nearestOkNr };
|
|
7770
|
+
}
|
|
7771
|
+
}
|
|
7772
|
+
/**
|
|
7773
|
+
* Returns whether given x is OK within the given min, max and step boundaries, where it should hold that nrToCheck = min + N * step,
|
|
7774
|
+
* with N integer or 0.
|
|
7775
|
+
* @param {number} nrToCheck Number to check whether it's within the given bounds
|
|
7776
|
+
* @param min Inclusive
|
|
7777
|
+
* @param max Inclusive
|
|
7778
|
+
* @param stepSize
|
|
7779
|
+
* @returns {CheckWithinSteppedBounds} Returns remainder of undefined when nrToCheck was OUTSIDE [min, max], else full result object.
|
|
7780
|
+
*/
|
|
7781
|
+
static CheckWithinSteppedBounds(nrToCheck, min, max, stepSize = 1) {
|
|
7782
|
+
if (nrToCheck < min || nrToCheck > max) {
|
|
7783
|
+
return { isOk: false, remainder: undefined };
|
|
7784
|
+
}
|
|
7785
|
+
// we're in [min, max], but still check if nrToCheck = min + N * step holds (for N integer or 0)
|
|
7786
|
+
let remainder = (nrToCheck - min) % stepSize;
|
|
7787
|
+
// correct float for largest precision amongst input numbers
|
|
7788
|
+
remainder = NumberUtils.ParseFloat(remainder, NumberUtils._GetLargestDecimalPrecisionOf(nrToCheck, min, stepSize));
|
|
7789
|
+
return { isOk: (remainder === 0), remainder: remainder };
|
|
7790
|
+
}
|
|
7791
|
+
/**
|
|
7792
|
+
* Finds the number closest to the originalNumber, that adheres to the given bounds. That is, for which it holds that
|
|
7793
|
+
* nr = min + N * step with N integer or 0.
|
|
7794
|
+
* @param {number} originalNr Find closest answer to this number
|
|
7795
|
+
* @param min Inclusive
|
|
7796
|
+
* @param max Inclusive
|
|
7797
|
+
* @param stepSize
|
|
7798
|
+
* @returns {boolean} The closest OK number for bounds.
|
|
7799
|
+
*/
|
|
7800
|
+
static GetNearestNumberWithinSteppedBounds(originalNr, min, max, stepSize = 1) {
|
|
7801
|
+
if (originalNr < min) {
|
|
7802
|
+
return min;
|
|
7803
|
+
}
|
|
7804
|
+
else if (originalNr > max) {
|
|
7805
|
+
return NumberUtils.GetTrueSteppedBoundsMax(min, max, stepSize);
|
|
7806
|
+
}
|
|
7807
|
+
const boundsCheck = NumberUtils.CheckWithinSteppedBounds(originalNr, min, max, stepSize);
|
|
7808
|
+
if (boundsCheck.isOk) {
|
|
7809
|
+
return originalNr;
|
|
7810
|
+
}
|
|
7811
|
+
let answer;
|
|
7812
|
+
const remainder = boundsCheck.remainder;
|
|
7813
|
+
if (remainder) {
|
|
7814
|
+
// round up or down?
|
|
7815
|
+
if ((remainder / stepSize) < 0.5) {
|
|
7816
|
+
// round down, but not below min
|
|
7817
|
+
answer = (originalNr - remainder >= min ? originalNr - remainder : min);
|
|
7818
|
+
}
|
|
7819
|
+
else {
|
|
7820
|
+
// round up, but not above max
|
|
7821
|
+
answer = (originalNr + stepSize - remainder <= max ? originalNr + stepSize - remainder :
|
|
7822
|
+
NumberUtils.GetTrueSteppedBoundsMax(min, max, stepSize));
|
|
7823
|
+
}
|
|
7824
|
+
}
|
|
7825
|
+
else {
|
|
7826
|
+
// is this real life, why wasn't our stepped bounds check OK?
|
|
7827
|
+
answer = originalNr;
|
|
7828
|
+
}
|
|
7829
|
+
// 'correct' float errors
|
|
7830
|
+
answer = NumberUtils.ParseFloat(answer, NumberUtils._GetLargestDecimalPrecisionOf(originalNr, min, max, stepSize));
|
|
7831
|
+
return answer;
|
|
7832
|
+
}
|
|
7833
|
+
/**
|
|
7834
|
+
* Returns the true maximum allowed value for the given "stepped bounds": min, stepSize and max, for which it holds that each allowed
|
|
7835
|
+
* value Y = min + stepSize * N, for any INTEGER or 0 N where it also holds, of course, that Y <= max.
|
|
7836
|
+
* @param min
|
|
7837
|
+
* @param max
|
|
7838
|
+
* @param stepSize
|
|
7839
|
+
*/
|
|
7840
|
+
static GetTrueSteppedBoundsMax(min, max, stepSize = 1) {
|
|
7841
|
+
// solve max integer X in formula min + X * step <= max, and return min + X * stepSize for that X
|
|
7842
|
+
const maxSteps = Math.floor((max - min) / stepSize);
|
|
7843
|
+
// 'correct' float errors
|
|
7844
|
+
return NumberUtils.ParseFloat(min + maxSteps * stepSize, NumberUtils._GetLargestDecimalPrecisionOf(min, min, max));
|
|
7845
|
+
}
|
|
7846
|
+
// Returns the nearest number, relative to the given originalNr, that is within the given [min, max] inclusive bounds.
|
|
7847
|
+
static GetNearestNumberWithinBounds(originalNr, min, max) {
|
|
7848
|
+
let answer = originalNr;
|
|
7849
|
+
if (originalNr < min) {
|
|
7850
|
+
answer = min;
|
|
7851
|
+
}
|
|
7852
|
+
else if (originalNr > max) {
|
|
7853
|
+
answer = max;
|
|
7854
|
+
}
|
|
7855
|
+
return answer;
|
|
7856
|
+
}
|
|
7857
|
+
// Returns the string representation of given number. If it's not a number, returns the empty string.
|
|
7858
|
+
static ToString(nr) {
|
|
7859
|
+
if (!NumberUtils.IsNaN(nr)) {
|
|
7860
|
+
return "" + nr;
|
|
7861
|
+
}
|
|
7862
|
+
else {
|
|
7863
|
+
return "";
|
|
7864
|
+
}
|
|
7865
|
+
}
|
|
7866
|
+
static DecimalsToStepIncrement(numberOfDecimals) {
|
|
7867
|
+
return Math.pow(10, -1 * numberOfDecimals);
|
|
7868
|
+
}
|
|
7869
|
+
static Round(value, decimals) {
|
|
7870
|
+
const factor = Math.pow(10, decimals);
|
|
7871
|
+
return Math.round(value * factor) / factor;
|
|
7872
|
+
}
|
|
7873
|
+
// @returns The inclusive max value
|
|
7874
|
+
static PrecisionScaleToMaxValue(precision, scale) {
|
|
7875
|
+
const oneStep = this.DecimalsToStepIncrement(scale);
|
|
7876
|
+
const maxExclusive = Math.pow(10, precision - scale);
|
|
7877
|
+
return maxExclusive - oneStep;
|
|
7878
|
+
}
|
|
7879
|
+
// @returns the difference between given 2 numbers
|
|
7880
|
+
static DifferenceBetweenNumbers(numberA, numberB) {
|
|
7881
|
+
return Math.abs(numberA - numberB);
|
|
7882
|
+
}
|
|
7883
|
+
static _GetLargestDecimalPrecisionOf(...args) {
|
|
7884
|
+
const result = ArrayUtils.GetMaxCalculatedValue(args, (arg) => {
|
|
7885
|
+
return NumberUtils.GetDecimalPlaces(arg);
|
|
7886
|
+
});
|
|
7887
|
+
return result;
|
|
7888
|
+
}
|
|
7889
|
+
// Returns given number input as a number that's useable by Javascript. Allows for incoming ',' decimal delimiter.
|
|
7890
|
+
static _NumberInputToNumberStr(numberInput) {
|
|
7891
|
+
return (numberInput + "").replace(",", ".");
|
|
7892
|
+
}
|
|
7893
|
+
}
|
|
7894
|
+
|
|
7895
|
+
class ArrayUtils {
|
|
7896
|
+
/**
|
|
7897
|
+
* Returns whether at least one element in given array could be found by given finder function.
|
|
7898
|
+
*
|
|
7899
|
+
* @param {T[]} array
|
|
7900
|
+
* @param {(element: T) => boolean} finder A finder function that takes an element of the array and returns a boolean that represents
|
|
7901
|
+
* the 'found status' for that element; whether it should have been found or not.
|
|
7902
|
+
*/
|
|
7903
|
+
static ContainsAnElementFoundBy(array, finder) {
|
|
7904
|
+
if (!array || !finder) {
|
|
7905
|
+
return false;
|
|
7906
|
+
}
|
|
7907
|
+
return notNill(this.Find(array, finder));
|
|
7908
|
+
}
|
|
7909
|
+
/**
|
|
7910
|
+
* Cross-browser Array.find() function. Returns the first item in given array for which the foundBy function returns true. Returns
|
|
7911
|
+
* undefined when none was found.
|
|
7912
|
+
*
|
|
7913
|
+
* Example usage:
|
|
7914
|
+
* const foundItem: BusinessObject = ArrayUtils.Find<BusinessObject>(modelArray, (modelItem: BusinessObject) => <br>
|
|
7915
|
+
* (return modelItem.getId() === '1')
|
|
7916
|
+
* * });
|
|
7917
|
+
*
|
|
7918
|
+
* @param array The array with items to search in.
|
|
7919
|
+
* @param foundBy The finder function applied on each items of the array, when that returns true, the item is considered found.
|
|
7920
|
+
*/
|
|
7921
|
+
static Find(array, foundBy) {
|
|
7922
|
+
if (!array || !foundBy) {
|
|
7923
|
+
return undefined;
|
|
7924
|
+
}
|
|
7925
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
7926
|
+
const itemCur = array[i];
|
|
7927
|
+
if (foundBy(itemCur)) {
|
|
7928
|
+
return itemCur;
|
|
7929
|
+
}
|
|
7930
|
+
}
|
|
7931
|
+
return undefined;
|
|
7932
|
+
}
|
|
7933
|
+
// @returns empty array when nothing found, otherwise array with found items
|
|
7934
|
+
static FindAll(array, foundBy) {
|
|
7935
|
+
const answer = [];
|
|
7936
|
+
if (!array || !foundBy) {
|
|
7937
|
+
return answer;
|
|
7938
|
+
}
|
|
7939
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
7940
|
+
const itemCur = array[i];
|
|
7941
|
+
if (foundBy(itemCur)) {
|
|
7942
|
+
answer.push(itemCur);
|
|
7943
|
+
}
|
|
7944
|
+
}
|
|
7945
|
+
return answer;
|
|
7946
|
+
}
|
|
7947
|
+
// returns a simple clone of given array, using array.slice(0)
|
|
7948
|
+
static CloneArray(array) {
|
|
7949
|
+
let answer = [];
|
|
7950
|
+
if (array) {
|
|
7951
|
+
answer = array.slice(0);
|
|
7952
|
+
}
|
|
7953
|
+
return answer;
|
|
7954
|
+
}
|
|
7955
|
+
/**
|
|
7956
|
+
* Returns a 'semi deep clone' of given array. Its first-level members are object-shallow-cloned (optionally with a strongly typed constructor),
|
|
7957
|
+
* or just as plain object (see param arrayItemsClass).
|
|
7958
|
+
* @param array
|
|
7959
|
+
* @param arrayItemsClass If provided, the cloned array's first-level items will be strongly typed to / constructed as this class. Otherwise
|
|
7960
|
+
* it'll be a plain object.
|
|
7961
|
+
* @param deepClone Set to true if array items contain FUNCTIONS that need to be cloned..
|
|
7962
|
+
* @returns {Array} semi-deep clone of given array
|
|
7963
|
+
*/
|
|
7964
|
+
static CloneArrayAndItsItems(array, arrayItemsClass, deepClone = false) {
|
|
7965
|
+
const cloneArray = [];
|
|
7966
|
+
if (array) {
|
|
7967
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
7968
|
+
if (deepClone) {
|
|
7969
|
+
cloneArray.push(ObjectUtils.GetDeepClone(array[i]));
|
|
7970
|
+
}
|
|
7971
|
+
else {
|
|
7972
|
+
cloneArray.push(ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
|
|
7973
|
+
}
|
|
7974
|
+
}
|
|
7975
|
+
}
|
|
7976
|
+
else {
|
|
7977
|
+
return [];
|
|
7978
|
+
}
|
|
7979
|
+
return cloneArray;
|
|
7980
|
+
}
|
|
7981
|
+
/**
|
|
7982
|
+
* Removes element at given index from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really
|
|
7983
|
+
* removes the element using splice().
|
|
7984
|
+
*
|
|
7985
|
+
* @param {number} index
|
|
7986
|
+
* @param {any[]} array in-out
|
|
7987
|
+
* @returns {boolean} True if and only if the element on given index is succesfully removed from given array.
|
|
7988
|
+
*/
|
|
7989
|
+
static RemoveElementAtIndex(index, array) {
|
|
7990
|
+
if (NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
|
|
7991
|
+
return false;
|
|
7992
|
+
}
|
|
7993
|
+
if (index in array) {
|
|
7994
|
+
array.splice(index, 1);
|
|
7995
|
+
return true;
|
|
7996
|
+
}
|
|
7997
|
+
else {
|
|
7998
|
+
return false;
|
|
7999
|
+
}
|
|
8000
|
+
}
|
|
8001
|
+
/**
|
|
8002
|
+
* Removes given element from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really removes the
|
|
8003
|
+
* element using splice(). Also works on associative arrays.
|
|
8004
|
+
*
|
|
8005
|
+
* @param {T} element The element to remove.
|
|
8006
|
+
* @param {T[]} array The array to remove the element from.
|
|
8007
|
+
* @returns {boolean} True iff given element was truly successfully removed from given array.
|
|
8008
|
+
*/
|
|
8009
|
+
static RemoveElement(element, array) {
|
|
8010
|
+
if (!Array.isArray(array)) {
|
|
8011
|
+
return false;
|
|
8012
|
+
}
|
|
8013
|
+
const index = array.indexOf(element);
|
|
8014
|
+
return ArrayUtils.RemoveElementAtIndex(index, array);
|
|
8015
|
+
}
|
|
8016
|
+
// Checks if given array is defined, and is an array, and has length > 0, and, optionally checks that the first element is of type given clazz.
|
|
8017
|
+
static IsArrayWithElements(arrayToCheck, classItemsMustBeInstanceOf) {
|
|
8018
|
+
if (isNill(arrayToCheck)) {
|
|
8019
|
+
return false;
|
|
8020
|
+
}
|
|
8021
|
+
if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
|
|
8022
|
+
if (classItemsMustBeInstanceOf) {
|
|
8023
|
+
return arrayToCheck[0] instanceof classItemsMustBeInstanceOf;
|
|
8024
|
+
}
|
|
8025
|
+
else {
|
|
8026
|
+
return true;
|
|
8027
|
+
}
|
|
8028
|
+
}
|
|
8029
|
+
else {
|
|
8030
|
+
return false;
|
|
8031
|
+
}
|
|
8032
|
+
}
|
|
8033
|
+
// Removes all elements from given array for which given filter function holds true. Returns true if at least one removed, else false.
|
|
8034
|
+
static RemoveElementsByFilter(array, filterFunction) {
|
|
8035
|
+
if (!ArrayUtils.IsArrayWithElements(array) || !filterFunction) {
|
|
8036
|
+
return false;
|
|
8037
|
+
}
|
|
8038
|
+
let atLeastOneRemoved = false;
|
|
8039
|
+
const len = array.length;
|
|
8040
|
+
for (let i = len - 1; i >= 0; i--) {
|
|
8041
|
+
const item = array[i];
|
|
8042
|
+
if (filterFunction.call(this, item) === true) {
|
|
8043
|
+
array.splice(i, 1);
|
|
8044
|
+
atLeastOneRemoved = true;
|
|
8045
|
+
}
|
|
8046
|
+
}
|
|
8047
|
+
return atLeastOneRemoved;
|
|
8048
|
+
}
|
|
8049
|
+
static MoveElement(element, toIndex, array) {
|
|
8050
|
+
if (!Array.isArray(array) || isNill(toIndex)) {
|
|
8051
|
+
return false;
|
|
8052
|
+
}
|
|
8053
|
+
const fromIndex = array.indexOf(element);
|
|
8054
|
+
const toIndexCorrected = NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
|
|
8055
|
+
if (fromIndex === -1 || array[toIndexCorrected] === element) {
|
|
8056
|
+
// element did not exist in given array, or already existed on given toIndex
|
|
8057
|
+
return false;
|
|
8058
|
+
}
|
|
8059
|
+
array.splice(toIndexCorrected, 0, array.splice(fromIndex, 1)[0]);
|
|
8060
|
+
return true;
|
|
8061
|
+
}
|
|
8062
|
+
// PRE: elements exists in given array. POST: given elementToPlace has a lower index than given afterThisElement. Array is in-out manipulated.
|
|
8063
|
+
static PlaceElementAfterOther(array, elementToPlace, afterThisElement) {
|
|
8064
|
+
if (array) {
|
|
8065
|
+
const afterThisElIdx = array.indexOf(afterThisElement);
|
|
8066
|
+
const elToPlaceIdx = array.indexOf(elementToPlace);
|
|
8067
|
+
if (afterThisElIdx >= elToPlaceIdx) {
|
|
8068
|
+
ArrayUtils.MoveElement(elementToPlace, afterThisElIdx + 1, array);
|
|
8069
|
+
}
|
|
8070
|
+
}
|
|
8071
|
+
}
|
|
8072
|
+
/**
|
|
8073
|
+
* Returns max value from all resulting values from applying given itemValueFunction to all items of given array.
|
|
8074
|
+
* @param array
|
|
8075
|
+
* @param itemValueFunction The function applied to each array item that gives it a numerical value. The max num val found is returned.
|
|
8076
|
+
*/
|
|
8077
|
+
static GetMaxCalculatedValue(array, itemValueFunction) {
|
|
8078
|
+
if (!array || !itemValueFunction) {
|
|
8079
|
+
return NaN;
|
|
8080
|
+
}
|
|
8081
|
+
let max = undefined;
|
|
8082
|
+
const len = array.length;
|
|
8083
|
+
for (let i = 0; i < len; i++) {
|
|
8084
|
+
const valueCur = itemValueFunction.call(this);
|
|
8085
|
+
if (valueCur > max) {
|
|
8086
|
+
max = valueCur;
|
|
8087
|
+
}
|
|
8088
|
+
}
|
|
8089
|
+
return max;
|
|
8090
|
+
}
|
|
8091
|
+
}
|
|
8092
|
+
|
|
8093
|
+
// Static utility function holder related to ref codes and string enums (as in our string enum representations of the db table REF_CODE).
|
|
8094
|
+
class RefCodeUtils {
|
|
8095
|
+
// Returns true if given valueToCheck is a composition of the second numeric argument. Usesul for checking user rights, for instance.
|
|
8096
|
+
static Check(valueToCheck, powTwoNumToCheckAgainst) {
|
|
8097
|
+
return NumberUtils.NumIsComposedOfOtherPowTwoNum(valueToCheck, powTwoNumToCheckAgainst);
|
|
8098
|
+
}
|
|
8099
|
+
/**
|
|
8100
|
+
* Returns true if given number value is a composition of at least one of the rest numeric arguments. Usesul for checking user rights,
|
|
8101
|
+
* for instance, or any other numerical composite refcode.
|
|
8102
|
+
*/
|
|
8103
|
+
static CheckAny(valueToCheck, ...powTwoNumsToCheckAgainst) {
|
|
8104
|
+
const len = powTwoNumsToCheckAgainst.length;
|
|
8105
|
+
for (let i = 0; i < len; i++) {
|
|
8106
|
+
if (RefCodeUtils.Check(valueToCheck, powTwoNumsToCheckAgainst[i])) {
|
|
8107
|
+
return true;
|
|
8108
|
+
}
|
|
8109
|
+
}
|
|
8110
|
+
return false;
|
|
8111
|
+
}
|
|
8112
|
+
static GetMultiRefCodeChoices(multiRefCode) {
|
|
8113
|
+
const choices = [];
|
|
8114
|
+
// magic number 22 was chosen as a 'high' power of two, i.e. we don't expect multi ref codes with more than 21 options
|
|
8115
|
+
let powTwoExponent = 22;
|
|
8116
|
+
let powTwoVal = Math.pow(2, powTwoExponent);
|
|
8117
|
+
let remainder = multiRefCode;
|
|
8118
|
+
while (remainder > 0) {
|
|
8119
|
+
if (remainder - powTwoVal >= 0) {
|
|
8120
|
+
choices.push(powTwoVal);
|
|
8121
|
+
remainder -= powTwoVal;
|
|
8122
|
+
}
|
|
8123
|
+
powTwoExponent--;
|
|
8124
|
+
powTwoVal = Math.pow(2, powTwoExponent);
|
|
8125
|
+
}
|
|
8126
|
+
choices.reverse();
|
|
8127
|
+
return choices;
|
|
8128
|
+
}
|
|
8129
|
+
static GetNumbersArraySum(numbersArray) {
|
|
8130
|
+
if (!Array.isArray(numbersArray) || numbersArray.length === 0) {
|
|
8131
|
+
return;
|
|
8132
|
+
}
|
|
8133
|
+
let sum = 0;
|
|
8134
|
+
numbersArray.forEach((num) => {
|
|
8135
|
+
sum += num;
|
|
8136
|
+
});
|
|
8137
|
+
return sum;
|
|
8138
|
+
}
|
|
8139
|
+
}
|
|
8140
|
+
|
|
8141
|
+
// DOM_BESTANDSSOORT
|
|
8142
|
+
var FileType;
|
|
8143
|
+
(function (FileType) {
|
|
8144
|
+
// DOC: Document
|
|
8145
|
+
FileType["Document"] = "DOC";
|
|
8146
|
+
// IMG: Afbeelding
|
|
8147
|
+
FileType["Image"] = "IMG";
|
|
8148
|
+
// SDWEB: Digitale handtekening
|
|
8149
|
+
FileType["DigitalSignature"] = "SDWEB";
|
|
8150
|
+
FileType["CollectiveSalaryInfo"] = "LOONSTAAT";
|
|
8151
|
+
//3d model file
|
|
8152
|
+
FileType["ThreeDFile"] = "UNITYWEB";
|
|
8153
|
+
})(FileType || (FileType = {}));
|
|
8154
|
+
|
|
8155
|
+
class CoDocumentSharedFieldLogic {
|
|
8156
|
+
static BuildAllDocuments(documentation, images) {
|
|
8157
|
+
let allDocuments = [];
|
|
8158
|
+
allDocuments = allDocuments.concat(documentation);
|
|
8159
|
+
allDocuments = allDocuments.concat(images);
|
|
8160
|
+
allDocuments.sort((a, b) => {
|
|
8161
|
+
return a.index < b.index ? -1 : 1;
|
|
8162
|
+
});
|
|
8163
|
+
return allDocuments;
|
|
8164
|
+
}
|
|
8165
|
+
static BuildImagesAndDocumentation(documents) {
|
|
8166
|
+
const images = [];
|
|
8167
|
+
const documentation = [];
|
|
8168
|
+
const len = documents.length;
|
|
8169
|
+
for (let i = 0; i < len; i++) {
|
|
8170
|
+
// re-index documents order
|
|
8171
|
+
documents[i].index = i + 1;
|
|
8172
|
+
if (documents[i].fileType === FileType.Image) {
|
|
8173
|
+
images.push(documents[i]);
|
|
8174
|
+
}
|
|
8175
|
+
else {
|
|
8176
|
+
documentation.push(documents[i]);
|
|
8177
|
+
}
|
|
8178
|
+
}
|
|
8179
|
+
return {
|
|
8180
|
+
images: images,
|
|
8181
|
+
documentation: documentation
|
|
8182
|
+
};
|
|
8183
|
+
}
|
|
8184
|
+
// Returns an index number that is 1 higher than the highest one in the collection
|
|
8185
|
+
static GenerateAvailableIndexNr(documents) {
|
|
8186
|
+
const indexNumbers = [];
|
|
8187
|
+
documents.forEach((collectionItem) => {
|
|
8188
|
+
if (collectionItem && collectionItem.index > -1) {
|
|
8189
|
+
indexNumbers.push(collectionItem.index);
|
|
8190
|
+
}
|
|
8191
|
+
});
|
|
8192
|
+
indexNumbers.sort((a, b) => {
|
|
8193
|
+
return a - b;
|
|
8194
|
+
});
|
|
8195
|
+
if (indexNumbers && indexNumbers.length > 0) {
|
|
8196
|
+
return indexNumbers[indexNumbers.length - 1] + 1;
|
|
8197
|
+
}
|
|
8198
|
+
else {
|
|
8199
|
+
return 0;
|
|
8200
|
+
}
|
|
8201
|
+
}
|
|
8202
|
+
}
|
|
8203
|
+
|
|
8204
|
+
/**
|
|
8205
|
+
* Property decorator which enables template syntax like "someBoolInput" instead of "[someBoolInput]='true'". Makes use of the fact that
|
|
8206
|
+
* Angular assigns an empty string to the input property in the naked "someBoolInput" template case.
|
|
8207
|
+
*/
|
|
8208
|
+
function InputBoolean(bindingPropertyName) {
|
|
8209
|
+
const inputDecorator = Input(bindingPropertyName);
|
|
8210
|
+
return (target, key) => {
|
|
8211
|
+
inputDecorator(target, key);
|
|
8212
|
+
const descriptor = Object.getOwnPropertyDescriptor(target, key) || {};
|
|
8213
|
+
Object.defineProperty(target, key, {
|
|
8214
|
+
get: descriptor.get || function () {
|
|
8215
|
+
return this["__" + key];
|
|
8216
|
+
},
|
|
8217
|
+
set: function (newValue) {
|
|
8218
|
+
const val = InputBooleanDecorator.InputValueToBoolean(newValue);
|
|
8219
|
+
descriptor.set ? descriptor.set(val) : this["__" + key] = val;
|
|
8220
|
+
},
|
|
8221
|
+
enumerable: true,
|
|
8222
|
+
configurable: true
|
|
8223
|
+
});
|
|
8224
|
+
};
|
|
8225
|
+
}
|
|
8226
|
+
// Utility function holder of the InputBooleanDecorator decorator.
|
|
8227
|
+
class InputBooleanDecorator {
|
|
8228
|
+
static InputValueToBoolean(value) {
|
|
8229
|
+
if (StringUtils.IsString(value) && !StringUtils.IsStringWithLength(value)) {
|
|
8230
|
+
return true;
|
|
8231
|
+
}
|
|
8232
|
+
return !!value;
|
|
8233
|
+
}
|
|
8234
|
+
}
|
|
8235
|
+
|
|
8236
|
+
// Component that shows a full screen dropzone target area
|
|
8237
|
+
class AppFileDropzoneComponent {
|
|
8238
|
+
constructor(dictionary, iconCacheService) {
|
|
8239
|
+
this.dictionary = dictionary;
|
|
8240
|
+
this.iconCacheService = iconCacheService;
|
|
8241
|
+
this.icons = Icon;
|
|
8242
|
+
this.Icons = Icon;
|
|
8243
|
+
this._defaultDropActionMessage = "DROP_ZONE_DOCUMENTS";
|
|
8244
|
+
}
|
|
8245
|
+
showClass() {
|
|
8246
|
+
return true;
|
|
8247
|
+
}
|
|
8248
|
+
getDropActionMessage() {
|
|
8249
|
+
return this.dictionary.get(this.customDropActionMessage ? this.customDropActionMessage : this._defaultDropActionMessage);
|
|
8250
|
+
}
|
|
8251
|
+
}
|
|
8252
|
+
AppFileDropzoneComponent.decorators = [
|
|
8253
|
+
{ type: Component, args: [{
|
|
8254
|
+
selector: "co-app-file-dropzone",
|
|
8255
|
+
template: `
|
|
8256
|
+
<div class="drop-files-wrapper">
|
|
8257
|
+
<div class="description">
|
|
8258
|
+
<span class="title" [textContent]="getDropActionMessage()"></span>
|
|
8259
|
+
<span class="description"></span>
|
|
8260
|
+
<div class="icon-wrapper">
|
|
8261
|
+
<co-icon [iconData]="iconCacheService.getIcon(icons.Dropzone)"></co-icon>
|
|
8262
|
+
</div>
|
|
8263
|
+
</div>
|
|
8264
|
+
<div class="dropzone"></div>
|
|
8265
|
+
</div>
|
|
8266
|
+
`,
|
|
8267
|
+
encapsulation: ViewEncapsulation.None
|
|
8268
|
+
},] }
|
|
8269
|
+
];
|
|
8270
|
+
AppFileDropzoneComponent.ctorParameters = () => [
|
|
8271
|
+
{ type: DictionaryService },
|
|
8272
|
+
{ type: IconCacheService }
|
|
8273
|
+
];
|
|
8274
|
+
AppFileDropzoneComponent.propDecorators = {
|
|
8275
|
+
customDropActionMessage: [{ type: Input }],
|
|
8276
|
+
showClass: [{ type: HostBinding, args: ['class.co-app-file-dropzone',] }]
|
|
8277
|
+
};
|
|
8278
|
+
|
|
8279
|
+
// <b>Enum</b> Encapsulation of the doc numbers to store it in DOCUMENTATIE table, java enum ReportDocKind
|
|
8280
|
+
var DocumentEmailReport;
|
|
8281
|
+
(function (DocumentEmailReport) {
|
|
8282
|
+
DocumentEmailReport[DocumentEmailReport["Orderbevestiging"] = 1] = "Orderbevestiging";
|
|
8283
|
+
DocumentEmailReport[DocumentEmailReport["Afleverbon"] = 2] = "Afleverbon";
|
|
8284
|
+
DocumentEmailReport[DocumentEmailReport["Factuur"] = 4] = "Factuur";
|
|
8285
|
+
DocumentEmailReport[DocumentEmailReport["Bestelbon"] = 8] = "Bestelbon";
|
|
8286
|
+
DocumentEmailReport[DocumentEmailReport["Atelierbon"] = 16] = "Atelierbon";
|
|
8287
|
+
DocumentEmailReport[DocumentEmailReport["Werkbon"] = 32] = "Werkbon";
|
|
8288
|
+
DocumentEmailReport[DocumentEmailReport["Vrachtbrief"] = 64] = "Vrachtbrief";
|
|
8289
|
+
DocumentEmailReport[DocumentEmailReport["Leverindicatie"] = 128] = "Leverindicatie";
|
|
8290
|
+
DocumentEmailReport[DocumentEmailReport["Uitlopende_levering"] = 256] = "Uitlopende_levering";
|
|
8291
|
+
DocumentEmailReport[DocumentEmailReport["Goederen_binnen"] = 512] = "Goederen_binnen";
|
|
8292
|
+
DocumentEmailReport[DocumentEmailReport["Afspraakbevestiging"] = 1024] = "Afspraakbevestiging";
|
|
8293
|
+
DocumentEmailReport[DocumentEmailReport["Herinneringsbestelbon"] = 2048] = "Herinneringsbestelbon";
|
|
8294
|
+
DocumentEmailReport[DocumentEmailReport["Aanmaninglevertijd"] = 4096] = "Aanmaninglevertijd";
|
|
8295
|
+
})(DocumentEmailReport || (DocumentEmailReport = {}));
|
|
8296
|
+
|
|
8297
|
+
// Enum of all domain names (refcodes) from db table CG_REF_CODES2 (2!!) that iOneJS currently uses.
|
|
8298
|
+
var DomainMultipleName;
|
|
8299
|
+
(function (DomainMultipleName) {
|
|
8300
|
+
DomainMultipleName["ArticlePublication"] = "ART_PUBLICATIE";
|
|
8301
|
+
DomainMultipleName["ArticlePublicationSales"] = "ART_PUBLICATIE_VERK";
|
|
8302
|
+
DomainMultipleName["ArticleSyncField"] = "DOM_SYNC_VELDEN";
|
|
8303
|
+
DomainMultipleName["DocumentPublication"] = "DOC_PUBLICATIE";
|
|
8304
|
+
DomainMultipleName["TextType"] = "TEKST_PUBLICATIE";
|
|
8305
|
+
DomainMultipleName["TextPublication"] = "TEKSTSOORT";
|
|
8306
|
+
DomainMultipleName["RotationOption"] = "ART_ROTATION_ALLOWED";
|
|
8307
|
+
DomainMultipleName["WeekDays"] = "WEEKDAGEN";
|
|
8308
|
+
})(DomainMultipleName || (DomainMultipleName = {}));
|
|
8309
|
+
|
|
8310
|
+
// Component that shows a popup when the user wants to upload a CoDocument
|
|
8311
|
+
class FileUploadPopupComponent {
|
|
8312
|
+
constructor(
|
|
8313
|
+
//private _workabilityService: AppWorkabilityService,
|
|
8314
|
+
_promptService, _fileTypeImgPipe) {
|
|
8315
|
+
this._promptService = _promptService;
|
|
8316
|
+
this._fileTypeImgPipe = _fileTypeImgPipe;
|
|
8317
|
+
this.useWithoutSettingProps = false;
|
|
8318
|
+
this.hasPublicAccessVisible = false;
|
|
8319
|
+
this.showDocumentReportPicker = true;
|
|
8320
|
+
this.displayReadWriteAccess = true;
|
|
8321
|
+
this.documentChangeEvent = new EventEmitter();
|
|
8322
|
+
this.popupCloseEvent = new EventEmitter();
|
|
8323
|
+
this.documentPublication = DocumentPublication;
|
|
8324
|
+
this.documentEmailReports = DocumentEmailReport;
|
|
8325
|
+
this.domain = DomainMultipleName;
|
|
8326
|
+
this.fileTypes = FileType;
|
|
8327
|
+
this.hideCancel = false;
|
|
8328
|
+
this.storeGroups = [];
|
|
8329
|
+
this.userGroupsForWrite = [];
|
|
8330
|
+
this.userGroupsForRead = [];
|
|
8331
|
+
this.documentTags = [];
|
|
8332
|
+
this._filesUploadConfigObjects = {}; // Instantiate with empty object to avoid nullpointers in the template
|
|
8333
|
+
this._boFactory = new BusinessObjectFactory();
|
|
8334
|
+
this._readonly = false;
|
|
8335
|
+
}
|
|
8336
|
+
set documentUnderEdit(doc) {
|
|
8337
|
+
this._documentUnderEdit = doc ? this._boFactory.makeWithRawBackendData(CoDocument, doc) : undefined;
|
|
8338
|
+
}
|
|
8339
|
+
get documentUnderEdit() {
|
|
8340
|
+
return this._documentUnderEdit;
|
|
8341
|
+
}
|
|
8342
|
+
set readonly(value) {
|
|
8343
|
+
this._readonly = value;
|
|
8344
|
+
if (value) {
|
|
8345
|
+
//this._toastService.spawnToast("MESSAGE_DOCUMENT_LOCK_SINGLE");
|
|
8346
|
+
}
|
|
8347
|
+
}
|
|
8348
|
+
set filesUploadConfigObjects(value) {
|
|
8349
|
+
this._filesUploadConfigObjects = value;
|
|
8350
|
+
}
|
|
8351
|
+
showClass() {
|
|
8352
|
+
return true;
|
|
8353
|
+
}
|
|
8354
|
+
get showReadWriteAccess() {
|
|
8355
|
+
//TODO get userrights
|
|
8356
|
+
return true;
|
|
8357
|
+
//return this._userRights.workabilityParameterEnabled && this.displayReadWriteAccess;
|
|
8358
|
+
}
|
|
8359
|
+
get filesUploadConfigObjects() {
|
|
8360
|
+
return this._filesUploadConfigObjects;
|
|
8361
|
+
}
|
|
8362
|
+
get isWorkability() {
|
|
8363
|
+
//TODO fix workability
|
|
8364
|
+
return false;
|
|
8365
|
+
//return this._workabilityService.workabilitySystemEnabled;
|
|
8366
|
+
}
|
|
8367
|
+
get docUnderEditIsReadOnly() {
|
|
8368
|
+
return this.documentUnderEdit.readonly || this._readonly;
|
|
8369
|
+
}
|
|
8370
|
+
get thumbnail() {
|
|
8371
|
+
if (this.documentUnderEdit.isImageDocument()) {
|
|
8372
|
+
return this._thumbnail;
|
|
8373
|
+
}
|
|
8374
|
+
return this._fileTypeImgPipe.transform(this.documentUnderEdit.fileTypeInternal);
|
|
8375
|
+
}
|
|
8376
|
+
get popupHeader() {
|
|
8377
|
+
if (this.documentUnderEdit && this.documentUnderEdit.isImageDocument()) {
|
|
8378
|
+
return "IMAGE";
|
|
8379
|
+
}
|
|
8380
|
+
else {
|
|
8381
|
+
return "DOCUMENT";
|
|
8382
|
+
}
|
|
8383
|
+
}
|
|
8384
|
+
get publicationConfigName() {
|
|
8385
|
+
if (this.filesUploadConfigObjects) {
|
|
8386
|
+
return this.documentUnderEdit.isImageDocument() ?
|
|
8387
|
+
this.filesUploadConfigObjects.ImageDocumentPublishTo :
|
|
8388
|
+
this.filesUploadConfigObjects.TextDocumentPublishTo;
|
|
8389
|
+
}
|
|
8390
|
+
else {
|
|
8391
|
+
return; // No configname found
|
|
8392
|
+
}
|
|
8393
|
+
}
|
|
8394
|
+
get tagsConfigName() {
|
|
8395
|
+
if (this.filesUploadConfigObjects) {
|
|
8396
|
+
return this.documentUnderEdit.isImageDocument() ?
|
|
8397
|
+
this.filesUploadConfigObjects.TagsImageConfigNames :
|
|
8398
|
+
this.filesUploadConfigObjects.TagsTextConfigNames;
|
|
8399
|
+
}
|
|
8400
|
+
else {
|
|
8401
|
+
return; // No configname found
|
|
8402
|
+
}
|
|
8403
|
+
}
|
|
8404
|
+
ngOnInit() {
|
|
8405
|
+
this.loadCollection();
|
|
8406
|
+
if (this.documentUnderEdit.isImageDocument()) {
|
|
8407
|
+
this._thumbnail = this.documentUnderEdit.documentBodyAsDataUri;
|
|
8408
|
+
}
|
|
8409
|
+
}
|
|
8410
|
+
loadCollection() {
|
|
8411
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8412
|
+
//this.documentTags = await this._tagsRepo.getJoinedTags(this.tagReferenceTable, this.documentKey);
|
|
8413
|
+
//this.storeGroups = await this._baseDataRepo.getStoreGroupList();
|
|
8414
|
+
});
|
|
8415
|
+
}
|
|
8416
|
+
onPreviewClick() {
|
|
8417
|
+
if (this.documentUnderEdit.isImageDocument()) { //preview image
|
|
8418
|
+
this._promptService.showImage(this.documentUnderEdit.documentBodyAsDataUri, "Preview");
|
|
8419
|
+
}
|
|
8420
|
+
else { //download document
|
|
8421
|
+
try {
|
|
8422
|
+
FileUtils.DownloadFromDataUri(this.documentUnderEdit.bodyAsDataUri, this.documentUnderEdit.fileName);
|
|
8423
|
+
}
|
|
8424
|
+
catch (error) {
|
|
8425
|
+
}
|
|
8426
|
+
}
|
|
8427
|
+
}
|
|
8428
|
+
saveDocumentUnderEditRights() {
|
|
8429
|
+
this.documentUnderEdit.rights = [];
|
|
8430
|
+
const forWriteLength = this.userGroupsForWrite.length;
|
|
8431
|
+
for (let i = 0; i < forWriteLength; i++) {
|
|
8432
|
+
const rights = new CoDocumentRight();
|
|
8433
|
+
rights.userGroupId = this.userGroupsForWrite[i];
|
|
8434
|
+
rights.rightLevel = ObjectRightType.ReadWrite;
|
|
8435
|
+
this.documentUnderEdit.rights.push(rights);
|
|
8436
|
+
}
|
|
8437
|
+
const forReadLength = this.userGroupsForRead.length;
|
|
8438
|
+
for (let i = 0; i < forReadLength; i++) {
|
|
8439
|
+
const rights = new CoDocumentRight();
|
|
8440
|
+
rights.userGroupId = this.userGroupsForRead[i];
|
|
8441
|
+
rights.rightLevel = ObjectRightType.ReadOnly;
|
|
8442
|
+
this.documentUnderEdit.rights.push(rights);
|
|
8443
|
+
}
|
|
8444
|
+
}
|
|
8445
|
+
onPopupOkClick() {
|
|
8446
|
+
if (this.form) {
|
|
8447
|
+
this.form.submit();
|
|
8448
|
+
}
|
|
8449
|
+
}
|
|
8450
|
+
handlePropertyChange(refSumOfEnabledItems) {
|
|
8451
|
+
this._publicationNumber = refSumOfEnabledItems;
|
|
8452
|
+
}
|
|
8453
|
+
handleReportsPropertyChange(refSumOfEnabledItems) {
|
|
8454
|
+
this._reportsNumber = refSumOfEnabledItems;
|
|
8455
|
+
}
|
|
8456
|
+
onValidSubmit() {
|
|
8457
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8458
|
+
this._publicationNumber ? this.documentUnderEdit.publication = this._publicationNumber : this.documentUnderEdit.publication = 0;
|
|
8459
|
+
this._reportsNumber ? this.documentUnderEdit.reports = this._reportsNumber : this.documentUnderEdit.reports = 0;
|
|
8460
|
+
this.documentUnderEdit.retailFormulas = this.storeGroupIds;
|
|
8461
|
+
this.saveDocumentUnderEditRights();
|
|
8462
|
+
this.documentChangeEvent.emit(this.documentUnderEdit);
|
|
8463
|
+
this.onPopupClose();
|
|
8464
|
+
});
|
|
8465
|
+
}
|
|
8466
|
+
onPopupCancelClick() {
|
|
8467
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8468
|
+
this.onPopupClose();
|
|
8469
|
+
});
|
|
8470
|
+
}
|
|
8471
|
+
onPopupClose() {
|
|
8472
|
+
this.userGroupsForWrite.length = 0;
|
|
8473
|
+
this.userGroupsForRead.length = 0;
|
|
8474
|
+
this.documentUnderEdit = undefined;
|
|
8475
|
+
this.popupCloseEvent.next();
|
|
8476
|
+
}
|
|
8477
|
+
}
|
|
8478
|
+
FileUploadPopupComponent.decorators = [
|
|
8479
|
+
{ type: Component, args: [{
|
|
8480
|
+
selector: "co-file-upload-popup",
|
|
8481
|
+
template: `
|
|
8482
|
+
<co-dialog *ngIf="!useWithoutSettingProps && documentUnderEdit" cssId="popup_files_upload_content"
|
|
8483
|
+
[headerTemplate]="headerTemplate" contentSize noClickOutside
|
|
8484
|
+
(close)="onPopupClose()">
|
|
8485
|
+
<div class="co-dialog-wrapper">
|
|
8486
|
+
<div class="file-upload-form-wrapper" fxLayout="column" fxLayoutGap="10px">
|
|
8487
|
+
<co-form class="narrow-scrollbar" (validSubmit)="onValidSubmit()">
|
|
8488
|
+
<div class="horizontal-layout-column">
|
|
8489
|
+
<div class="document-thumb column-left" *ngIf="!addDocumentByUrl">
|
|
8490
|
+
<a (click)="onPreviewClick()"><img [src]="thumbnail"/></a>
|
|
8491
|
+
</div>
|
|
8492
|
+
<div class="column-right">
|
|
8493
|
+
<co-input-text
|
|
8494
|
+
[model]="documentUnderEdit.fileSize"
|
|
8495
|
+
[screenConfigurationObject]="documentUnderEdit.isImageDocument() ?
|
|
8496
|
+
filesUploadConfigObjects?.ImageDocumentFileSize :
|
|
8497
|
+
filesUploadConfigObjects?.TextDocumentFileSize"
|
|
8498
|
+
[placeholder]="'SIZE' | localize"
|
|
8499
|
+
forceReadonly
|
|
8500
|
+
noValidation>
|
|
8501
|
+
</co-input-text>
|
|
8502
|
+
<ng-container *ngIf="documentUnderEdit.isImageDocument()">
|
|
8503
|
+
<co-input-text [placeholder]="'DIMENSIONS' | localize"
|
|
8504
|
+
[model]="documentUnderEdit.imageDimensions"
|
|
8505
|
+
[screenConfigurationObject]="filesUploadConfigObjects?.ImageDocumentDimensions"
|
|
8506
|
+
forceReadonly noValidation></co-input-text>
|
|
8507
|
+
</ng-container>
|
|
8508
|
+
<co-input-text
|
|
8509
|
+
[(model)]="documentUnderEdit.title"
|
|
8510
|
+
[screenConfigurationObject]="documentUnderEdit.isImageDocument() ?
|
|
8511
|
+
filesUploadConfigObjects?.ImageDocumentTitle :
|
|
8512
|
+
filesUploadConfigObjects?.TextDocumentTitle"
|
|
8513
|
+
[placeholder]="'TITLE2' | localize"
|
|
8514
|
+
noValidation forceReadonly></co-input-text>
|
|
8515
|
+
</div>
|
|
8516
|
+
</div>
|
|
8517
|
+
|
|
8518
|
+
<div>
|
|
8519
|
+
<!--<sc-tags
|
|
8520
|
+
[tagCategory]="tagCategory"
|
|
8521
|
+
[readonly]="docUnderEditIsReadOnly"-->
|
|
8522
|
+
|
|
8523
|
+
<!-- ></sc-tags>--><!-- [myCfgNames]="tagsConfigName" | [(joinedTags)]="this.documentUnderEdit.tags"-->
|
|
8524
|
+
</div>
|
|
8525
|
+
<!--<div>
|
|
8526
|
+
<read-write-access *ngIf="showReadWriteAccess"
|
|
8527
|
+
[readWriteCfgNames]="filesUploadConfigObjects?.readWriteAccess"
|
|
8528
|
+
[layoutHorizontal]="true"
|
|
8529
|
+
[medicalUserGroups]="medicalUserGroups"
|
|
8530
|
+
[(userGroupsForWrite)]="userGroupsForWrite"
|
|
8531
|
+
[(userGroupsForRead)]="userGroupsForRead"
|
|
8532
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8533
|
+
></read-write-access>
|
|
8534
|
+
</div>-->
|
|
8535
|
+
<!--<div class="horizontal-layout-column">
|
|
8536
|
+
<ng-container *ngIf="addDocumentByUrl">
|
|
8537
|
+
<co-input-text required [placeholder]="'URL' | localize" [(model)]="documentUnderEdit.filePath"
|
|
8538
|
+
[readonly]="docUnderEditIsReadOnly"></co-input-text>
|
|
8539
|
+
</ng-container>
|
|
8540
|
+
</div>-->
|
|
8541
|
+
<div class="horizontal-layout-column">
|
|
8542
|
+
<div class="column-left">
|
|
8543
|
+
<co-input-text [placeholder]="'DESCRIPTION' | localize" [(model)]="documentUnderEdit.description"
|
|
8544
|
+
[screenConfigurationObject]="documentUnderEdit.isImageDocument() ?
|
|
8545
|
+
filesUploadConfigObjects?.ImageDocumentDescription :
|
|
8546
|
+
filesUploadConfigObjects?.TextDocumentDescription"
|
|
8547
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8548
|
+
></co-input-text>
|
|
8549
|
+
|
|
8550
|
+
</div>
|
|
8551
|
+
<!--<div *ngIf="hasPublicAccessVisible" class="column-right">
|
|
8552
|
+
<input-switcher-yes-no label="PUBLIC_ACCESS"
|
|
8553
|
+
[(model)]="documentUnderEdit.hasPublicAccess"
|
|
8554
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8555
|
+
></input-switcher-yes-no>
|
|
8556
|
+
</div>-->
|
|
8557
|
+
</div>
|
|
8558
|
+
<div class="horizontal-layout-column">
|
|
8559
|
+
<ng-container *ngIf="!documentUnderEdit.isImageDocument()">
|
|
8560
|
+
<div class="column-left">
|
|
8561
|
+
<!-- <input-switcher-yes-no label="DOWNLOADABLE"
|
|
8562
|
+
[(model)]="documentUnderEdit.downloadable"
|
|
8563
|
+
[cfgName]="filesUploadConfigObjects?.TextDocumentDownloadable"
|
|
8564
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8565
|
+
></input-switcher-yes-no>-->
|
|
8566
|
+
</div>
|
|
8567
|
+
</ng-container>
|
|
8568
|
+
</div>
|
|
8569
|
+
<div class="horizontal-layout-column">
|
|
8570
|
+
<ng-container *ngIf="fileType === fileTypes.ThreeDFile">
|
|
8571
|
+
<div class="column-left">
|
|
8572
|
+
<!-- <input-switcher-yes-no label="ALSO_AS_USDZ"
|
|
8573
|
+
[(model)]="documentUnderEdit.convertToUSDZ"
|
|
8574
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8575
|
+
></input-switcher-yes-no>-->
|
|
8576
|
+
</div>
|
|
8577
|
+
</ng-container>
|
|
8578
|
+
</div>
|
|
8579
|
+
<div class="horizontal-layout-column">
|
|
8580
|
+
<ng-container *ngIf="documentUnderEdit.isImageDocument()">
|
|
8581
|
+
<div class="column-left"><!--
|
|
8582
|
+
<input-switcher-yes-no label="ATTACH_TO_NOTIFICATION"
|
|
8583
|
+
[(model)]="documentUnderEdit.attachToNotification"
|
|
8584
|
+
[cfgName]="filesUploadConfigObjects?.ImageDocumentAttachNotification"
|
|
8585
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8586
|
+
></input-switcher-yes-no>-->
|
|
8587
|
+
</div>
|
|
8588
|
+
<div class="column-right"><!--
|
|
8589
|
+
<image-type-select
|
|
8590
|
+
[cfgName]="filesUploadConfigObjects?.ImageDocumentDisplayType"
|
|
8591
|
+
[(selectedModelId)]="this.documentUnderEdit.imageDisplayKind"
|
|
8592
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8593
|
+
label="DISPLAY_TYPE"
|
|
8594
|
+
></image-type-select>-->
|
|
8595
|
+
</div>
|
|
8596
|
+
</ng-container>
|
|
8597
|
+
</div>
|
|
8598
|
+
<div *ngIf="!isWorkability">
|
|
8599
|
+
<!-- <multiple-property-toggler *ngIf="!showDocumentReportPicker"
|
|
8600
|
+
[propertyNamesToToggle]="documentPublication"
|
|
8601
|
+
[(enableditems)]="this.documentUnderEdit.publication"
|
|
8602
|
+
(onPropertyItemChange)="handlePropertyChange($event)"
|
|
8603
|
+
label="PUBLISH_TO"
|
|
8604
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8605
|
+
></multiple-property-toggler>-->
|
|
8606
|
+
<co-multiple-property-toggler *ngIf="showDocumentReportPicker"
|
|
8607
|
+
[propertyNamesToToggle]="documentEmailReports"
|
|
8608
|
+
[(enableditems)]="documentUnderEdit.reports"
|
|
8609
|
+
(onPropertyItemChange)="handleReportsPropertyChange($event)"
|
|
8610
|
+
label="REPORTS_TO_ATTACH_TO"
|
|
8611
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8612
|
+
></co-multiple-property-toggler>
|
|
8613
|
+
|
|
8614
|
+
<!--<ng-container *ngIf="documentUnderEdit.isImageDocument()"
|
|
8615
|
+
[templateWrapper]="templateImage"></ng-container>-->
|
|
8616
|
+
</div>
|
|
8617
|
+
</co-form>
|
|
8618
|
+
<div class="ok-cancel-buttons">
|
|
8619
|
+
<co-button [disabled]="docUnderEditIsReadOnly" [textContent]="'OK' | localize" (click)="onPopupOkClick()"></co-button>
|
|
8620
|
+
<co-button *ngIf="hideCancel" [textContent]="'STICKER' | localize" (click)="onPopupCancelClick()"></co-button>
|
|
8621
|
+
</div>
|
|
8622
|
+
<!-- <default-ok-cancel-buttons class="justify-center"
|
|
8623
|
+
[okDisabled]="docUnderEditIsReadOnly"
|
|
8624
|
+
[hideCancel]="hideCancel"
|
|
8625
|
+
(okClick)="onPopupOkClick()"
|
|
8626
|
+
(cancelClick)="onPopupCancelClick()">
|
|
8627
|
+
</default-ok-cancel-buttons>-->
|
|
8628
|
+
</div>
|
|
8629
|
+
</div>
|
|
8630
|
+
</co-dialog>
|
|
8631
|
+
<ng-template #headerTemplate>
|
|
8632
|
+
<div [textContent]="popupHeader | localize"></div>
|
|
8633
|
+
</ng-template>
|
|
8634
|
+
<ng-template #templateImage *ngIf="!isWorkability">
|
|
8635
|
+
<!-- <div class="column-right">
|
|
8636
|
+
<input-lov-multi-select
|
|
8637
|
+
[cfgName]="filesUploadConfigObjects.ImageDocumentStoreGroups"
|
|
8638
|
+
[(selectedModelIds)]="storeGroupIds"
|
|
8639
|
+
[collection]="storeGroups"
|
|
8640
|
+
[readonly]="docUnderEditIsReadOnly"
|
|
8641
|
+
descriptionField="description"
|
|
8642
|
+
doNotLoadCollection
|
|
8643
|
+
customWidth
|
|
8644
|
+
label="RETAIL_FORMULAS"
|
|
8645
|
+
></input-lov-multi-select>
|
|
8646
|
+
</div>-->
|
|
8647
|
+
</ng-template>
|
|
8648
|
+
`,
|
|
8649
|
+
encapsulation: ViewEncapsulation.None
|
|
8650
|
+
},] }
|
|
8651
|
+
];
|
|
8652
|
+
FileUploadPopupComponent.ctorParameters = () => [
|
|
8653
|
+
{ type: PromptService },
|
|
8654
|
+
{ type: FileTypeImagePipe }
|
|
8655
|
+
];
|
|
8656
|
+
FileUploadPopupComponent.propDecorators = {
|
|
8657
|
+
form: [{ type: ViewChild, args: [FormComponent,] }],
|
|
8658
|
+
useWithoutSettingProps: [{ type: Input }],
|
|
8659
|
+
hasPublicAccessVisible: [{ type: Input }],
|
|
8660
|
+
showDocumentReportPicker: [{ type: Input }],
|
|
8661
|
+
documentUnderEdit: [{ type: Input }],
|
|
8662
|
+
readonly: [{ type: Input }],
|
|
8663
|
+
filesUploadConfigObjects: [{ type: Input }],
|
|
8664
|
+
tagCategory: [{ type: Input }],
|
|
8665
|
+
medicalUserGroups: [{ type: Input }],
|
|
8666
|
+
displayReadWriteAccess: [{ type: Input }],
|
|
8667
|
+
tagReferenceTable: [{ type: Input }],
|
|
8668
|
+
documentKey: [{ type: Input }],
|
|
8669
|
+
documentTable: [{ type: Input }],
|
|
8670
|
+
fileType: [{ type: Input }],
|
|
8671
|
+
addDocumentByUrl: [{ type: Input }],
|
|
8672
|
+
documentChangeEvent: [{ type: Output }],
|
|
8673
|
+
popupCloseEvent: [{ type: Output }],
|
|
8674
|
+
showClass: [{ type: HostBinding, args: ['class.co-file-upload-popup',] }]
|
|
8675
|
+
};
|
|
8676
|
+
__decorate([
|
|
8677
|
+
InputBoolean()
|
|
8678
|
+
], FileUploadPopupComponent.prototype, "useWithoutSettingProps", void 0);
|
|
8679
|
+
__decorate([
|
|
8680
|
+
InputBoolean()
|
|
8681
|
+
], FileUploadPopupComponent.prototype, "hasPublicAccessVisible", void 0);
|
|
8682
|
+
__decorate([
|
|
8683
|
+
InputBoolean()
|
|
8684
|
+
], FileUploadPopupComponent.prototype, "showDocumentReportPicker", void 0);
|
|
8685
|
+
__decorate([
|
|
8686
|
+
InputBoolean()
|
|
8687
|
+
], FileUploadPopupComponent.prototype, "medicalUserGroups", void 0);
|
|
8688
|
+
__decorate([
|
|
8689
|
+
InputBoolean()
|
|
8690
|
+
], FileUploadPopupComponent.prototype, "addDocumentByUrl", void 0);
|
|
8691
|
+
|
|
8692
|
+
// A base component that lets the user make a list of files from its device. Doesn't actually upload, but outputs chosen files as filesChanged.
|
|
8693
|
+
class BaseFileUploadComponent {
|
|
8694
|
+
// private static readonly _dummyTrueFunction: OperationCallbackSimpleFunction = (object: any) => Promise.resolve(true);
|
|
8695
|
+
constructor(
|
|
8696
|
+
//protected _promptService: PromptService,
|
|
8697
|
+
_dictionaryService,
|
|
8698
|
+
//protected _userService: UserService,
|
|
8699
|
+
_container, _factory) {
|
|
8700
|
+
this._dictionaryService = _dictionaryService;
|
|
8701
|
+
this._container = _container;
|
|
8702
|
+
this._factory = _factory;
|
|
8703
|
+
this.documents = [];
|
|
8704
|
+
// The ability to drop files on the page
|
|
8705
|
+
this.fullPageDrop = false;
|
|
8706
|
+
// If user gets the ability of adding files.
|
|
8707
|
+
this.canAdd = true;
|
|
8708
|
+
// Show add button
|
|
8709
|
+
this.addWithButton = true;
|
|
8710
|
+
// If user gets the ability of deleting files.
|
|
8711
|
+
this.canDelete = true;
|
|
8712
|
+
this.noDragDropOrdering = false;
|
|
8713
|
+
this.askBeforeDelete = true;
|
|
8714
|
+
this.resizeImages = false;
|
|
8715
|
+
this.lockOperation = OperationWithAlwaysSuccessCallback;
|
|
8716
|
+
this.unlockOperation = OperationWithAlwaysSuccessCallback;
|
|
8717
|
+
this.beforeDeleteOperation = OperationWithAlwaysSuccessCallback;
|
|
8718
|
+
this.afterDeleteOperation = OperationWithAlwaysSuccessCallback;
|
|
8719
|
+
this.beforeCreateOperation = OperationWithAlwaysSuccessCallback;
|
|
8720
|
+
this.afterCreateOperation = OperationWithAlwaysSuccessCallback;
|
|
8721
|
+
this.beforeEditOperation = OperationWithAlwaysSuccessCallback;
|
|
8722
|
+
this.dontAskBeforeDelete = false;
|
|
8723
|
+
this.noOwnDeleteOperation = false;
|
|
8724
|
+
this.useWithoutSettingProps = false;
|
|
8725
|
+
this.medicalUserGroups = false;
|
|
8726
|
+
// Use with customFileDropEvent
|
|
8727
|
+
this.useCustomFileDropEvent = false;
|
|
8728
|
+
// Use in conjunction with useCustomFileDropEvent
|
|
8729
|
+
this.customFileDropEvent = new EventEmitter();
|
|
8730
|
+
// Emits if user wants to add multiple documents at once
|
|
8731
|
+
this.documentsAdded = new EventEmitter();
|
|
8732
|
+
this.documentDeleted = new EventEmitter();
|
|
8733
|
+
// Emits every time the order of documents was changed
|
|
8734
|
+
this.sortableListChanged = new EventEmitter();
|
|
8735
|
+
this.documentChangeEvent = new EventEmitter();
|
|
8736
|
+
// Use this if consumer requires to perform extra actions, like locking a parent businessObject if it contains the collection of documents. Emit with true when popup opened, false for close
|
|
8737
|
+
this.popupOpenedStateChange = new EventEmitter();
|
|
8738
|
+
this._documentKey = "";
|
|
8739
|
+
this._readonly = false;
|
|
8740
|
+
}
|
|
8741
|
+
// The fileType that the documents should be saved as, leave empty to automatically detect filetype. Also determines file picker filter
|
|
8742
|
+
set fileType(value) {
|
|
8743
|
+
if (value) {
|
|
8744
|
+
this._fileType = value;
|
|
8745
|
+
//TODO Documentdataloader fix
|
|
8746
|
+
//this._coDocumentDataLoader.loadAllowedTypes().then(() => {this.handleAcceptedFileTypesLoaded(value)});
|
|
8747
|
+
}
|
|
8748
|
+
}
|
|
8749
|
+
get fileType() {
|
|
8750
|
+
return this._fileType;
|
|
8751
|
+
}
|
|
8752
|
+
set documentKey(value) {
|
|
8753
|
+
this._documentKey = value + ""; // force string
|
|
8754
|
+
}
|
|
8755
|
+
get documentKey() {
|
|
8756
|
+
return this._documentKey;
|
|
8757
|
+
}
|
|
8758
|
+
set readonly(value) {
|
|
8759
|
+
this._readonly = value;
|
|
8760
|
+
if (this._popup && this._popup.instance) {
|
|
8761
|
+
this._popup.instance.readonly = value;
|
|
8762
|
+
}
|
|
8763
|
+
}
|
|
8764
|
+
get readonly() {
|
|
8765
|
+
return this._readonly;
|
|
8766
|
+
}
|
|
8767
|
+
set maxUploadSizeParam(value) {
|
|
8768
|
+
if (value) {
|
|
8769
|
+
this._setInternalParamObj(value);
|
|
8770
|
+
}
|
|
8771
|
+
}
|
|
8772
|
+
onDrop(event) {
|
|
8773
|
+
event.preventDefault();
|
|
8774
|
+
event.stopPropagation();
|
|
8775
|
+
if (!this.useCustomFileDropEvent) {
|
|
8776
|
+
this.filesPicked(event.dataTransfer.files);
|
|
8777
|
+
}
|
|
8778
|
+
else {
|
|
8779
|
+
this.customFileDropEvent.emit(event.dataTransfer.files);
|
|
8780
|
+
}
|
|
8781
|
+
this._clearDropzone();
|
|
8782
|
+
}
|
|
8783
|
+
onDragEnd(event) {
|
|
8784
|
+
event.dataTransfer.clearData();
|
|
8785
|
+
this._clearDropzone();
|
|
8786
|
+
}
|
|
8787
|
+
onDragOver(event) {
|
|
8788
|
+
event.preventDefault();
|
|
8789
|
+
}
|
|
8790
|
+
onDragEnter(event) {
|
|
8791
|
+
this._dragEnterTarget = event.target;
|
|
8792
|
+
this._showDropzone();
|
|
8793
|
+
}
|
|
8794
|
+
onDragLeave(event) {
|
|
8795
|
+
if (event.target === this._dragEnterTarget) {
|
|
8796
|
+
this._clearDropzone();
|
|
8797
|
+
}
|
|
8798
|
+
}
|
|
8799
|
+
ngOnDestroy() {
|
|
8800
|
+
this._clearDropzone();
|
|
8801
|
+
}
|
|
8802
|
+
_showDropzone() {
|
|
8803
|
+
if (!this._dropZone) {
|
|
8804
|
+
const fact = this._factory.resolveComponentFactory(AppFileDropzoneComponent);
|
|
8805
|
+
this._dropZone = this._container.createComponent(fact);
|
|
8806
|
+
this._dropZone.instance.customDropActionMessage = this.dropMessage;
|
|
8807
|
+
}
|
|
8808
|
+
}
|
|
8809
|
+
_clearDropzone() {
|
|
8810
|
+
this._container.clear();
|
|
8811
|
+
if (this._dropZone) {
|
|
8812
|
+
this._dropZone.destroy();
|
|
8813
|
+
this._dropZone = undefined;
|
|
8814
|
+
}
|
|
8815
|
+
}
|
|
8816
|
+
// Remove file from upload array.
|
|
8817
|
+
handleDelete(file) {
|
|
8818
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8819
|
+
let success = yield this.beforeDeleteOperation(file);
|
|
8820
|
+
try {
|
|
8821
|
+
if (success) {
|
|
8822
|
+
yield this._delete(file);
|
|
8823
|
+
success = true;
|
|
8824
|
+
}
|
|
8825
|
+
}
|
|
8826
|
+
finally {
|
|
8827
|
+
yield this.afterDeleteOperation(file);
|
|
8828
|
+
}
|
|
8829
|
+
return Promise.resolve(success);
|
|
8830
|
+
});
|
|
8831
|
+
}
|
|
8832
|
+
_delete(file) {
|
|
8833
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8834
|
+
let doDelete = true;
|
|
8835
|
+
if (!this.dontAskBeforeDelete) {
|
|
8836
|
+
//TODO make dialogService
|
|
8837
|
+
//doDelete = await this._promptService.showYesNo("MESSAGE_DELETE_RECORD_QUESTION");
|
|
8838
|
+
}
|
|
8839
|
+
if (doDelete) {
|
|
8840
|
+
if (!this.noOwnDeleteOperation) {
|
|
8841
|
+
ArrayUtils.RemoveElement(file, this.documents);
|
|
8842
|
+
}
|
|
8843
|
+
this.documentDeleted.emit(file);
|
|
8844
|
+
}
|
|
8845
|
+
});
|
|
8846
|
+
}
|
|
8847
|
+
handleSortingChange(docs) {
|
|
8848
|
+
this.sortableListChanged.emit(docs);
|
|
8849
|
+
}
|
|
8850
|
+
handleFileChange(event) {
|
|
8851
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8852
|
+
if (event && event.target && event.target.files && event.target.files.length > 0) {
|
|
8853
|
+
// check file sizes and extension
|
|
8854
|
+
//Todo: fix this
|
|
8855
|
+
//const allowedExtensions = await this._baseDataDalRepository.getAllowedExtensions();
|
|
8856
|
+
let allFilesAreSmallEnough = true;
|
|
8857
|
+
let allFilesHaveAllowedExtensions = true;
|
|
8858
|
+
const sizeToCompare = this._maxUploadFileSize ? this._maxUploadFileSize : undefined;
|
|
8859
|
+
const len = event.target.files.length;
|
|
8860
|
+
for (let i = 0; i < len; i++) {
|
|
8861
|
+
const uploadSizeAllowed = FileUtils.CheckMaxUploadSize(event.target.files[i], sizeToCompare);
|
|
8862
|
+
if (!uploadSizeAllowed) {
|
|
8863
|
+
allFilesAreSmallEnough = false;
|
|
8864
|
+
break;
|
|
8865
|
+
}
|
|
8866
|
+
const extensionAllowed = true; //FileUtils.CheckExtension(event.target.files[i], allowedExtensions);
|
|
8867
|
+
if (!extensionAllowed) {
|
|
8868
|
+
allFilesHaveAllowedExtensions = false;
|
|
8869
|
+
break;
|
|
8870
|
+
}
|
|
8871
|
+
}
|
|
8872
|
+
if (!allFilesAreSmallEnough) {
|
|
8873
|
+
//TODO make dialogService
|
|
8874
|
+
//this._promptService.showWarning(this._dictionaryService.get("FILE_TOO_LARGE_TO_UPLOAD", true, "" + [FileUtils.getMaxUploadSizeInMb(sizeToCompare)]));
|
|
8875
|
+
}
|
|
8876
|
+
else if (!allFilesHaveAllowedExtensions) {
|
|
8877
|
+
//const extensionsList = allowedExtensions.map(allowedExtension => allowedExtension.extension).sort().join(", ");
|
|
8878
|
+
//this._promptService.showWarning(this._dictionaryService.get("FILE_HAS_DISALLOWED_EXTENSION", false, extensionsList));
|
|
8879
|
+
}
|
|
8880
|
+
else {
|
|
8881
|
+
const filesToAdd = yield this.convertFilesIntoCoDocuments(event.target.files);
|
|
8882
|
+
if (filesToAdd.length > 1) {
|
|
8883
|
+
this.documentsAdded.emit(filesToAdd);
|
|
8884
|
+
}
|
|
8885
|
+
else {
|
|
8886
|
+
if (this.useWithoutSettingProps) {
|
|
8887
|
+
this.documentsAdded.next(filesToAdd);
|
|
8888
|
+
}
|
|
8889
|
+
else {
|
|
8890
|
+
this.documentUnderEdit = filesToAdd[0];
|
|
8891
|
+
this.openPopup();
|
|
8892
|
+
}
|
|
8893
|
+
}
|
|
8894
|
+
}
|
|
8895
|
+
}
|
|
8896
|
+
});
|
|
8897
|
+
}
|
|
8898
|
+
handleEditDocumentClick(docToEdit) {
|
|
8899
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8900
|
+
this.documentUnderEdit = docToEdit;
|
|
8901
|
+
const showPopup = yield this.beforeEditOperation(docToEdit);
|
|
8902
|
+
if (showPopup) {
|
|
8903
|
+
this.openPopup();
|
|
8904
|
+
}
|
|
8905
|
+
});
|
|
8906
|
+
}
|
|
8907
|
+
openPopup() {
|
|
8908
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8909
|
+
this._createAndFillPopupInstance();
|
|
8910
|
+
this._docChangeSub = this._popup.instance.documentChangeEvent.subscribe((doc) => {
|
|
8911
|
+
this.documentChangeEvent.emit(doc);
|
|
8912
|
+
});
|
|
8913
|
+
});
|
|
8914
|
+
}
|
|
8915
|
+
openPopupToAddDocumentByUrl() {
|
|
8916
|
+
this._createDocumentToAddByUrl();
|
|
8917
|
+
this._createAndFillPopupInstance(true);
|
|
8918
|
+
this._docChangeSub = this._popup.instance.documentChangeEvent.subscribe((doc) => {
|
|
8919
|
+
doc.fileName = doc.filePath;
|
|
8920
|
+
this.documentChangeEvent.emit(doc);
|
|
8921
|
+
});
|
|
8922
|
+
}
|
|
8923
|
+
_createDocumentToAddByUrl() {
|
|
8924
|
+
this.documentUnderEdit = new CoDocument();
|
|
8925
|
+
this.documentUnderEdit.table = this.documentTable;
|
|
8926
|
+
this.documentUnderEdit.key = this.documentKey;
|
|
8927
|
+
this.documentUnderEdit.fileType = this.fileType;
|
|
8928
|
+
this.documentUnderEdit.documentType = CoDocumentType.SaveAsLinkOnRandomLocation;
|
|
8929
|
+
this.documentUnderEdit.pathIsUrl = true;
|
|
8930
|
+
//TODO Fix user Input
|
|
8931
|
+
//this.documentUnderEdit.creationUser = this._userService.userName.toUpperCase();
|
|
8932
|
+
//this.documentUnderEdit.modifiedUser = this._userService.userName.toUpperCase();
|
|
8933
|
+
this.documentUnderEdit.creationDate = new Date();
|
|
8934
|
+
this.documentUnderEdit.modifiedDate = new Date();
|
|
8935
|
+
}
|
|
8936
|
+
_createAndFillPopupInstance(addDocumentByUrl = false) {
|
|
8937
|
+
this.popupOpenedStateChange.emit(true);
|
|
8938
|
+
const factory = this._factory.resolveComponentFactory(FileUploadPopupComponent);
|
|
8939
|
+
this._popup = this._container.createComponent(factory);
|
|
8940
|
+
this._popup.instance.readonly = this._readonly;
|
|
8941
|
+
this._popup.instance.addDocumentByUrl = addDocumentByUrl;
|
|
8942
|
+
this._popup.instance.hasPublicAccessVisible = this.documentTable === TableName.Goods;
|
|
8943
|
+
this._popup.instance.showDocumentReportPicker = (this.documentTable === TableName.Transactions || this.documentTable === TableName.TransactionLines);
|
|
8944
|
+
this._popup.instance.documentUnderEdit = this.documentUnderEdit;
|
|
8945
|
+
this._popup.instance.filesUploadConfigObjects = this.filesUploadConfigObjects;
|
|
8946
|
+
this._popup.instance.medicalUserGroups = this.medicalUserGroups;
|
|
8947
|
+
this._popup.instance.tagCategory = this.tagCategory;
|
|
8948
|
+
this._popup.instance.displayReadWriteAccess = this.displayReadWriteAccess;
|
|
8949
|
+
this._popup.instance.tagReferenceTable = this.tagReferenceTable;
|
|
8950
|
+
this._popup.instance.publicationIds = RefCodeUtils.GetMultiRefCodeChoices(this.documentUnderEdit.publication);
|
|
8951
|
+
this._popup.instance.storeGroupIds = this.documentUnderEdit.retailFormulas;
|
|
8952
|
+
this._popup.instance.fileType = this.fileType;
|
|
8953
|
+
this._prepareFileRights();
|
|
8954
|
+
this._popupCloseSub = this._popup.instance.popupCloseEvent.subscribe(() => {
|
|
8955
|
+
this._unlockDocument();
|
|
8956
|
+
this.popupOpenedStateChange.emit(false);
|
|
8957
|
+
this._popupCloseSub.unsubscribe();
|
|
8958
|
+
this._docChangeSub.unsubscribe();
|
|
8959
|
+
this._popup.destroy();
|
|
8960
|
+
this._popup = undefined;
|
|
8961
|
+
});
|
|
8962
|
+
}
|
|
8963
|
+
convertFilesIntoCoDocuments(files) {
|
|
8964
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8965
|
+
const amountOfFiles = files.length;
|
|
8966
|
+
const filesToAdd = [];
|
|
8967
|
+
for (let i = 0; i < amountOfFiles; i++) {
|
|
8968
|
+
const fileAsDocument = yield this._getFileAsDocument(files[i]);
|
|
8969
|
+
fileAsDocument.index = CoDocumentSharedFieldLogic.GenerateAvailableIndexNr(this.documents || []) + i;
|
|
8970
|
+
filesToAdd.push(fileAsDocument);
|
|
8971
|
+
}
|
|
8972
|
+
return filesToAdd;
|
|
8973
|
+
});
|
|
8974
|
+
}
|
|
8975
|
+
filesPicked(files) {
|
|
8976
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
8977
|
+
if (files && files.length) {
|
|
8978
|
+
let allFilesAreValid = true;
|
|
8979
|
+
const amountOfFiles = files.length;
|
|
8980
|
+
for (let i = 0; i < amountOfFiles; i++) {
|
|
8981
|
+
if (!FileUtils.CheckMaxUploadSize(files[i], this._maxUploadFileSize)) {
|
|
8982
|
+
allFilesAreValid = false;
|
|
8983
|
+
break;
|
|
8984
|
+
}
|
|
8985
|
+
}
|
|
8986
|
+
if (!allFilesAreValid) {
|
|
8987
|
+
//TODO make dialogService
|
|
8988
|
+
//this._promptService.showWarning(this._dictionaryService.get("FILE_TOO_LARGE_TO_UPLOAD", true, "" + FileUtils.getMaxUploadSizeInMb(this._maxUploadFileSize).toString()));
|
|
8989
|
+
}
|
|
8990
|
+
else {
|
|
8991
|
+
const filesToAdd = yield this.convertFilesIntoCoDocuments(files);
|
|
8992
|
+
if (filesToAdd.length > 1 || this.useWithoutSettingProps) {
|
|
8993
|
+
this.documentsAdded.emit(filesToAdd);
|
|
8994
|
+
}
|
|
8995
|
+
else {
|
|
8996
|
+
this.documentUnderEdit = filesToAdd[0]; // Setting docUnderEdit opens the popup window
|
|
8997
|
+
this.openPopup();
|
|
8998
|
+
}
|
|
8999
|
+
}
|
|
9000
|
+
}
|
|
9001
|
+
});
|
|
9002
|
+
}
|
|
9003
|
+
handleAcceptedFileTypesLoaded(value) {
|
|
9004
|
+
//TODO fix loading
|
|
9005
|
+
//this.acceptedUploadFormats = this._coDocumentDataLoader.getAllowedExtensionsForType(value);
|
|
9006
|
+
}
|
|
9007
|
+
_getFileAsDocument(file) {
|
|
9008
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9009
|
+
const fileAsCoDocument = yield FileUtils.ReadFileAsNewCoDocument(file, this.resizeImages);
|
|
9010
|
+
// set some extra known fields for the codocument:
|
|
9011
|
+
fileAsCoDocument.table = this.documentTable;
|
|
9012
|
+
fileAsCoDocument.key = this.documentKey;
|
|
9013
|
+
//TODO fix add users
|
|
9014
|
+
//fileAsCoDocument.creationUser = this._userService.userName.toUpperCase();
|
|
9015
|
+
//fileAsCoDocument.modifiedUser = this._userService.userName.toUpperCase();
|
|
9016
|
+
fileAsCoDocument.creationDate = new Date();
|
|
9017
|
+
fileAsCoDocument.modifiedDate = new Date();
|
|
9018
|
+
fileAsCoDocument.fileType = this.fileType ? this.fileType : FileUtils.IsImageFile(file) ? FileType$1.Image : FileType$1.Document;
|
|
9019
|
+
if (fileAsCoDocument) {
|
|
9020
|
+
return fileAsCoDocument;
|
|
9021
|
+
}
|
|
9022
|
+
});
|
|
9023
|
+
}
|
|
9024
|
+
_setInternalParamObj(value) {
|
|
9025
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9026
|
+
//TODO fix params
|
|
9027
|
+
//const param: InternalParameterObject = await this._generalDalRepository.getInternalParamObject(value);
|
|
9028
|
+
//this._maxUploadFileSize = isNaN(parseInt(param.value, 0)) ? undefined : parseInt(param.value, 0);
|
|
9029
|
+
});
|
|
9030
|
+
}
|
|
9031
|
+
_lockDocument() {
|
|
9032
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9033
|
+
if (!this.documentUnderEdit.documentId) {
|
|
9034
|
+
return true; // New document does not have an ID and therefore does not have to be locked
|
|
9035
|
+
}
|
|
9036
|
+
const lockOk = yield this.lockOperation(CoDocument);
|
|
9037
|
+
return lockOk;
|
|
9038
|
+
});
|
|
9039
|
+
}
|
|
9040
|
+
_unlockDocument() {
|
|
9041
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9042
|
+
if (!this.documentUnderEdit.documentId) {
|
|
9043
|
+
return true; // New document does not have an ID and therefore does not have to be locked
|
|
9044
|
+
}
|
|
9045
|
+
const unlockOk = yield this.unlockOperation(CoDocument);
|
|
9046
|
+
return unlockOk;
|
|
9047
|
+
});
|
|
9048
|
+
}
|
|
9049
|
+
_prepareFileRights() {
|
|
9050
|
+
const len = this.documentUnderEdit.rights.length;
|
|
9051
|
+
for (let i = 0; i < len; i++) {
|
|
9052
|
+
const right = this.documentUnderEdit.rights[i];
|
|
9053
|
+
if (right.rightLevel === ObjectRightType.ReadWrite) {
|
|
9054
|
+
this._popup.instance.userGroupsForWrite.push(right.userGroupId);
|
|
9055
|
+
}
|
|
9056
|
+
if (right.rightLevel === ObjectRightType.ReadOnly) {
|
|
9057
|
+
this._popup.instance.userGroupsForRead.push(right.userGroupId);
|
|
9058
|
+
}
|
|
9059
|
+
}
|
|
9060
|
+
}
|
|
9061
|
+
}
|
|
9062
|
+
BaseFileUploadComponent.decorators = [
|
|
9063
|
+
{ type: Directive }
|
|
9064
|
+
];
|
|
9065
|
+
BaseFileUploadComponent.ctorParameters = () => [
|
|
9066
|
+
{ type: DictionaryService },
|
|
9067
|
+
{ type: ViewContainerRef },
|
|
9068
|
+
{ type: ComponentFactoryResolver }
|
|
9069
|
+
];
|
|
9070
|
+
BaseFileUploadComponent.propDecorators = {
|
|
9071
|
+
fileType: [{ type: Input }],
|
|
9072
|
+
documents: [{ type: Input }],
|
|
9073
|
+
documentTable: [{ type: Input }],
|
|
9074
|
+
documentKey: [{ type: Input }],
|
|
9075
|
+
fullPageDrop: [{ type: Input }],
|
|
9076
|
+
canAdd: [{ type: Input }],
|
|
9077
|
+
dropMessage: [{ type: Input }],
|
|
9078
|
+
addWithButton: [{ type: Input }],
|
|
9079
|
+
canDelete: [{ type: Input }],
|
|
9080
|
+
noDragDropOrdering: [{ type: Input }],
|
|
9081
|
+
readonly: [{ type: Input }],
|
|
9082
|
+
askBeforeDelete: [{ type: Input }],
|
|
9083
|
+
resizeImages: [{ type: Input }],
|
|
9084
|
+
lockOperation: [{ type: Input }],
|
|
9085
|
+
unlockOperation: [{ type: Input }],
|
|
9086
|
+
beforeDeleteOperation: [{ type: Input }],
|
|
9087
|
+
afterDeleteOperation: [{ type: Input }],
|
|
9088
|
+
beforeCreateOperation: [{ type: Input }],
|
|
9089
|
+
afterCreateOperation: [{ type: Input }],
|
|
9090
|
+
beforeEditOperation: [{ type: Input }],
|
|
9091
|
+
dontAskBeforeDelete: [{ type: Input }],
|
|
9092
|
+
noOwnDeleteOperation: [{ type: Input }],
|
|
9093
|
+
maxUploadSizeParam: [{ type: Input }],
|
|
9094
|
+
useWithoutSettingProps: [{ type: Input }],
|
|
9095
|
+
filesUploadConfigObjects: [{ type: Input }],
|
|
9096
|
+
medicalUserGroups: [{ type: Input }],
|
|
9097
|
+
tagCategory: [{ type: Input }],
|
|
9098
|
+
tagReferenceTable: [{ type: Input }],
|
|
9099
|
+
displayReadWriteAccess: [{ type: Input }],
|
|
9100
|
+
useCustomFileDropEvent: [{ type: Input }],
|
|
9101
|
+
customFileDropEvent: [{ type: Output }],
|
|
9102
|
+
documentsAdded: [{ type: Output }],
|
|
9103
|
+
documentDeleted: [{ type: Output }],
|
|
9104
|
+
sortableListChanged: [{ type: Output }],
|
|
9105
|
+
documentChangeEvent: [{ type: Output }],
|
|
9106
|
+
popupOpenedStateChange: [{ type: Output }],
|
|
9107
|
+
hidden: [{ type: HostBinding, args: ["class.hidden",] }],
|
|
9108
|
+
onDrop: [{ type: HostListener, args: ["drop", ["$event"],] }],
|
|
9109
|
+
onDragEnd: [{ type: HostListener, args: ["dragend", ["$event"],] }],
|
|
9110
|
+
onDragOver: [{ type: HostListener, args: ["dragover", ["$event"],] }],
|
|
9111
|
+
onDragEnter: [{ type: HostListener, args: ["dragenter", ["$event"],] }],
|
|
9112
|
+
onDragLeave: [{ type: HostListener, args: ["dragleave", ["$event"],] }]
|
|
9113
|
+
};
|
|
9114
|
+
__decorate([
|
|
9115
|
+
InputBoolean()
|
|
9116
|
+
], BaseFileUploadComponent.prototype, "noDragDropOrdering", void 0);
|
|
9117
|
+
__decorate([
|
|
9118
|
+
InputBoolean()
|
|
9119
|
+
], BaseFileUploadComponent.prototype, "readonly", null);
|
|
9120
|
+
__decorate([
|
|
9121
|
+
InputBoolean()
|
|
9122
|
+
], BaseFileUploadComponent.prototype, "askBeforeDelete", void 0);
|
|
9123
|
+
__decorate([
|
|
9124
|
+
InputBoolean()
|
|
9125
|
+
], BaseFileUploadComponent.prototype, "resizeImages", void 0);
|
|
9126
|
+
__decorate([
|
|
9127
|
+
InputBoolean()
|
|
9128
|
+
], BaseFileUploadComponent.prototype, "dontAskBeforeDelete", void 0);
|
|
9129
|
+
__decorate([
|
|
9130
|
+
InputBoolean()
|
|
9131
|
+
], BaseFileUploadComponent.prototype, "noOwnDeleteOperation", void 0);
|
|
9132
|
+
__decorate([
|
|
9133
|
+
InputBoolean()
|
|
9134
|
+
], BaseFileUploadComponent.prototype, "useWithoutSettingProps", void 0);
|
|
9135
|
+
__decorate([
|
|
9136
|
+
InputBoolean()
|
|
9137
|
+
], BaseFileUploadComponent.prototype, "medicalUserGroups", void 0);
|
|
9138
|
+
__decorate([
|
|
9139
|
+
InputBoolean()
|
|
9140
|
+
], BaseFileUploadComponent.prototype, "displayReadWriteAccess", void 0);
|
|
9141
|
+
__decorate([
|
|
9142
|
+
InputBoolean()
|
|
9143
|
+
], BaseFileUploadComponent.prototype, "useCustomFileDropEvent", void 0);
|
|
9144
|
+
|
|
9145
|
+
// A component that lets the user make a list of files from its device. Doesn't actually upload, but outputs chosen files as filesChanged.
|
|
9146
|
+
class FilesUploadComponent extends BaseFileUploadComponent {
|
|
9147
|
+
constructor(
|
|
9148
|
+
//promptService: PromptService,
|
|
9149
|
+
dictionaryService,
|
|
9150
|
+
//userService: UserService,
|
|
9151
|
+
_container, _factory) {
|
|
9152
|
+
super(dictionaryService, _container, _factory);
|
|
9153
|
+
this._container = _container;
|
|
9154
|
+
this._factory = _factory;
|
|
9155
|
+
// Input button label
|
|
9156
|
+
this.label = "UPLOAD_FILE";
|
|
9157
|
+
this.customImageClick = false;
|
|
9158
|
+
this.isEditable = false;
|
|
9159
|
+
this.hideAvatars = false;
|
|
9160
|
+
this.editSlideoutSubmit = new EventEmitter();
|
|
9161
|
+
this.tagsChangeEvent = new EventEmitter();
|
|
9162
|
+
this.imageClick = new EventEmitter();
|
|
9163
|
+
this.slideoutShown = false;
|
|
9164
|
+
this.isDropzone = false;
|
|
9165
|
+
}
|
|
9166
|
+
set dropzone(value) {
|
|
9167
|
+
this.isDropzone = value;
|
|
9168
|
+
}
|
|
9169
|
+
showClass() {
|
|
9170
|
+
return true;
|
|
9171
|
+
}
|
|
9172
|
+
get editable() {
|
|
9173
|
+
return this.canAdd;
|
|
9174
|
+
}
|
|
9175
|
+
get empty() {
|
|
9176
|
+
return !this.documents || this.documents.length === 0;
|
|
9177
|
+
}
|
|
9178
|
+
ngOnDestroy() {
|
|
9179
|
+
this.slideoutTemplate = undefined;
|
|
9180
|
+
this.input = undefined;
|
|
9181
|
+
super.ngOnDestroy();
|
|
9182
|
+
}
|
|
9183
|
+
openFileBrowser() {
|
|
9184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9185
|
+
if (this.input && this.input.nativeElement) {
|
|
9186
|
+
this.input.nativeElement.click();
|
|
9187
|
+
}
|
|
9188
|
+
});
|
|
9189
|
+
}
|
|
9190
|
+
handleAddClick() {
|
|
9191
|
+
this.openFileBrowser();
|
|
9192
|
+
}
|
|
9193
|
+
}
|
|
9194
|
+
FilesUploadComponent.decorators = [
|
|
9195
|
+
{ type: Component, args: [{
|
|
9196
|
+
selector: "co-files-upload",
|
|
9197
|
+
template: `
|
|
9198
|
+
<div class="files-upload-wrapper">
|
|
9199
|
+
<drag-drop-container
|
|
9200
|
+
[sortableList]="documents"
|
|
9201
|
+
(sortingChange)="handleSortingChange($event)"
|
|
9202
|
+
[handleSort]="true"
|
|
9203
|
+
dragHandle="tile"
|
|
9204
|
+
[enabled]="!noDragDropOrdering">
|
|
9205
|
+
<co-file-upload *ngIf="canAdd && addWithButton" class="add-file"
|
|
9206
|
+
isAddingTile
|
|
9207
|
+
icon="plus_round_open"
|
|
9208
|
+
[link]="true"
|
|
9209
|
+
[label]="label | localize"
|
|
9210
|
+
(mouseover)="mouseOverAdd = true"
|
|
9211
|
+
(mouseout)="mouseOverAdd = false"
|
|
9212
|
+
(click)="handleAddClick()"></co-file-upload> <!-- (click)="handleAddClick()" -->
|
|
9213
|
+
<co-file-upload *ngFor="let file of documents" class="tile"
|
|
9214
|
+
[readonly]="file.readonly || readonly"
|
|
9215
|
+
[class.hidden]="hideAvatars ? file.isAvatar : false"
|
|
9216
|
+
[file]="file"
|
|
9217
|
+
[label]="file.fileName"
|
|
9218
|
+
[showTrashCan]="canDelete"
|
|
9219
|
+
[fileSavesOnPopupOkClick]="fileSavesOnPopupOkClick"
|
|
9220
|
+
[isEditable]="isEditable"
|
|
9221
|
+
[customImageClick]="customImageClick"
|
|
9222
|
+
(imageClick)="imageClick.emit($event)"
|
|
9223
|
+
(deleteClick)="handleDelete(file)"
|
|
9224
|
+
(editClick)="handleEditDocumentClick($event)"></co-file-upload>
|
|
9225
|
+
</drag-drop-container>
|
|
9226
|
+
<span class="maxuploadsize" textContent="getMaxFileSizeNotition()" [class.show]="mouseOverAdd"></span>
|
|
9227
|
+
<input #inputFile [accept]="acceptedUploadFormats" (change)="handleFileChange($event)" type="file" hidden multiple/>
|
|
9228
|
+
</div>
|
|
9229
|
+
`,
|
|
9230
|
+
encapsulation: ViewEncapsulation.None,
|
|
9231
|
+
providers: [
|
|
9232
|
+
{
|
|
9233
|
+
provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
|
|
9234
|
+
useExisting: forwardRef(() => FilesUploadComponent)
|
|
9235
|
+
}
|
|
9236
|
+
]
|
|
9237
|
+
},] }
|
|
9238
|
+
];
|
|
9239
|
+
FilesUploadComponent.ctorParameters = () => [
|
|
9240
|
+
{ type: DictionaryService },
|
|
9241
|
+
{ type: ViewContainerRef },
|
|
9242
|
+
{ type: ComponentFactoryResolver }
|
|
9243
|
+
];
|
|
9244
|
+
FilesUploadComponent.propDecorators = {
|
|
9245
|
+
dropzone: [{ type: Input }],
|
|
9246
|
+
slideoutTemplate: [{ type: ContentChild, args: ["slideoutTemplate", { static: true },] }],
|
|
9247
|
+
input: [{ type: ViewChild, args: ["inputFile", { static: true },] }],
|
|
9248
|
+
label: [{ type: Input }],
|
|
9249
|
+
cfgNames: [{ type: Input }],
|
|
9250
|
+
customImageClick: [{ type: Input }],
|
|
9251
|
+
isEditable: [{ type: Input }],
|
|
9252
|
+
hideAvatars: [{ type: Input }],
|
|
9253
|
+
fileSavesOnPopupOkClick: [{ type: Input }],
|
|
9254
|
+
selected: [{ type: Input }],
|
|
9255
|
+
editSlideoutSubmit: [{ type: Output }],
|
|
9256
|
+
tagsChangeEvent: [{ type: Output }],
|
|
9257
|
+
imageClick: [{ type: Output }],
|
|
9258
|
+
showClass: [{ type: HostBinding, args: ['class.co-files-upload',] }],
|
|
9259
|
+
editable: [{ type: HostBinding, args: ["class.editable",] }],
|
|
9260
|
+
empty: [{ type: HostBinding, args: ["class.empty",] }],
|
|
9261
|
+
isDropzone: [{ type: HostBinding, args: ['class.dropzone',] }]
|
|
9262
|
+
};
|
|
9263
|
+
__decorate([
|
|
9264
|
+
InputBoolean()
|
|
9265
|
+
], FilesUploadComponent.prototype, "isEditable", void 0);
|
|
9266
|
+
__decorate([
|
|
9267
|
+
InputBoolean()
|
|
9268
|
+
], FilesUploadComponent.prototype, "hideAvatars", void 0);
|
|
9269
|
+
|
|
9270
|
+
class DragDropContainer {
|
|
9271
|
+
constructor(element, direction) {
|
|
9272
|
+
this.element = element;
|
|
9273
|
+
this.direction = direction;
|
|
9274
|
+
}
|
|
9275
|
+
}
|
|
9276
|
+
|
|
9277
|
+
/**
|
|
9278
|
+
* Handles drag and drop elements
|
|
9279
|
+
*/
|
|
9280
|
+
class DragDropService {
|
|
9281
|
+
constructor() {
|
|
9282
|
+
this.drag = new Subject();
|
|
9283
|
+
this.drop = new Subject();
|
|
9284
|
+
// Container(s) holding the elements to be dragged.
|
|
9285
|
+
this._containers = [];
|
|
9286
|
+
this._disabledContainers = [];
|
|
9287
|
+
// Drag handle(s) that contains the classes of the handles.
|
|
9288
|
+
this._dragHandles = [];
|
|
9289
|
+
this._isdragging = false;
|
|
9290
|
+
this._clickCounter = 0;
|
|
9291
|
+
this._ghostLeft = 0;
|
|
9292
|
+
this._ghostTop = 0;
|
|
9293
|
+
this._mouseDown = false;
|
|
9294
|
+
this._currentMousePosition = { x: 0, y: 0 };
|
|
9295
|
+
this._currentMouseOffset = { x: 0, y: 0 };
|
|
9296
|
+
// Handles the mouse down event. Saves the current mouse position.
|
|
9297
|
+
this._handleMouseDown = (event) => {
|
|
9298
|
+
this._currentMousePosition.x = event.screenX;
|
|
9299
|
+
this._currentMousePosition.y = event.screenY;
|
|
9300
|
+
if (event.buttons !== 1 || event.metaKey || event.ctrlKey) {
|
|
9301
|
+
return;
|
|
9302
|
+
}
|
|
9303
|
+
const element = event.target ? event.target : event.srcElement;
|
|
9304
|
+
const dragElement = this._getValidDragDropElement(element, true);
|
|
9305
|
+
if (!dragElement) {
|
|
9306
|
+
return;
|
|
9307
|
+
}
|
|
9308
|
+
if (this._disabledContainers.indexOf(dragElement.container) !== -1) {
|
|
9309
|
+
return;
|
|
9310
|
+
}
|
|
9311
|
+
this._dragElement = dragElement;
|
|
9312
|
+
this._dragInContainer = dragElement.container.element;
|
|
9313
|
+
const offset = this._getOffset();
|
|
9314
|
+
this._currentMouseOffset.x = event.clientX - offset.left;
|
|
9315
|
+
this._currentMouseOffset.y = event.clientY - offset.top;
|
|
9316
|
+
this._mouseDown = true;
|
|
9317
|
+
this._handleEventListener(document, "mousemove", this._handleMouseMove);
|
|
9318
|
+
this._clickCounter++;
|
|
9319
|
+
};
|
|
9320
|
+
this._handleMouseUp = (event) => {
|
|
9321
|
+
this._mouseDown = false;
|
|
9322
|
+
this._handleEventListener(document, "mousemove", this._handleMouseMove, false);
|
|
9323
|
+
this._clickCounter--;
|
|
9324
|
+
if (this._isdragging) {
|
|
9325
|
+
this._endDrag();
|
|
9326
|
+
}
|
|
9327
|
+
};
|
|
9328
|
+
this._handleMouseMove = (event) => {
|
|
9329
|
+
// nothing to drag?
|
|
9330
|
+
if (!this._dragElement) {
|
|
9331
|
+
return;
|
|
9332
|
+
}
|
|
9333
|
+
// only drag when mouse down and there actually is movement
|
|
9334
|
+
if (!this._mouseDown || (this._currentMousePosition.x === event.screenX && this._currentMousePosition.y === event.screenY)) {
|
|
9335
|
+
return;
|
|
9336
|
+
}
|
|
9337
|
+
this._isdragging = true;
|
|
9338
|
+
this._startDrag();
|
|
9339
|
+
this._drag(event);
|
|
9340
|
+
this._currentMousePosition.x = event.screenX;
|
|
9341
|
+
this._currentMousePosition.y = event.screenY;
|
|
9342
|
+
};
|
|
9343
|
+
}
|
|
9344
|
+
set renderer(value) {
|
|
9345
|
+
this._renderer = value;
|
|
9346
|
+
this._setEvents();
|
|
9347
|
+
}
|
|
9348
|
+
set ghostLeft(value) {
|
|
9349
|
+
this._ghostLeft = value;
|
|
9350
|
+
this._positionGhostImage();
|
|
9351
|
+
}
|
|
9352
|
+
set ghostTop(value) {
|
|
9353
|
+
this._ghostTop = value;
|
|
9354
|
+
this._positionGhostImage();
|
|
9355
|
+
}
|
|
9356
|
+
ngOnDestroy() {
|
|
9357
|
+
this._removeListeners();
|
|
9358
|
+
}
|
|
9359
|
+
addContainer(container) {
|
|
9360
|
+
const direction = (getComputedStyle(container.element).flexDirection === "row" && getComputedStyle(container.element).display === "flex")
|
|
9361
|
+
? CoOrientation.Horizontal
|
|
9362
|
+
: CoOrientation.Vertical;
|
|
9363
|
+
container.direction = direction;
|
|
9364
|
+
this._containers.push(container);
|
|
9365
|
+
}
|
|
9366
|
+
addDragHandle(handle) {
|
|
9367
|
+
this._dragHandles.push(handle);
|
|
9368
|
+
}
|
|
9369
|
+
removeContainer(container) {
|
|
9370
|
+
ArrayUtils.RemoveElement(container, this._containers);
|
|
9371
|
+
ArrayUtils.RemoveElement(container, this._disabledContainers);
|
|
9372
|
+
if (!this._containers || this._containers.length === 0) {
|
|
9373
|
+
this._removeListeners();
|
|
9374
|
+
}
|
|
9375
|
+
}
|
|
9376
|
+
removeDragHandle(handle) {
|
|
9377
|
+
ArrayUtils.RemoveElement(handle, this._dragHandles);
|
|
9378
|
+
}
|
|
9379
|
+
enableContainer(container) {
|
|
9380
|
+
ArrayUtils.RemoveElement(container, this._disabledContainers);
|
|
9381
|
+
}
|
|
9382
|
+
disableContainer(container) {
|
|
9383
|
+
this._disabledContainers.push(container);
|
|
9384
|
+
}
|
|
9385
|
+
_removeListeners() {
|
|
9386
|
+
this._handleEventListener(document, "mouseup", this._handleMouseUp, false);
|
|
9387
|
+
this._handleEventListener(document, "mousemove", this._handleMouseMove, false);
|
|
9388
|
+
}
|
|
9389
|
+
_setEvents() {
|
|
9390
|
+
this._handleEventListener(document, "mousedown", this._handleMouseDown); //TODO: mousedown only within given containers
|
|
9391
|
+
this._handleEventListener(document, "mouseup", this._handleMouseUp);
|
|
9392
|
+
}
|
|
9393
|
+
_setElementClass(element, elementClass) {
|
|
9394
|
+
if (!this._renderer) {
|
|
9395
|
+
return;
|
|
9396
|
+
}
|
|
9397
|
+
this._renderer.addClass(element, elementClass);
|
|
9398
|
+
}
|
|
9399
|
+
_handleEventListener(element, event, handler, add = true) {
|
|
9400
|
+
if (add) {
|
|
9401
|
+
element.removeEventListener(event, handler);
|
|
9402
|
+
element.addEventListener(event, handler);
|
|
9403
|
+
}
|
|
9404
|
+
else {
|
|
9405
|
+
element.removeEventListener(event, handler);
|
|
9406
|
+
}
|
|
9407
|
+
}
|
|
9408
|
+
// Returns the container that holds given element.
|
|
9409
|
+
_getContainerOfElement(element) {
|
|
9410
|
+
for (let i = 0, len1 = this._containers.length; i < len1; i++) {
|
|
9411
|
+
const container = this._containers[i];
|
|
9412
|
+
for (let ii = 0, len2 = container.element.children.length; ii < len2; ii++) {
|
|
9413
|
+
if (container.element.children[ii] === element) {
|
|
9414
|
+
return container;
|
|
9415
|
+
}
|
|
9416
|
+
}
|
|
9417
|
+
}
|
|
9418
|
+
}
|
|
9419
|
+
/**
|
|
9420
|
+
* Checks if given element is a child of container(s)
|
|
9421
|
+
* @param element
|
|
9422
|
+
* @returns {number} index of element
|
|
9423
|
+
*/
|
|
9424
|
+
_getElementOfContainer(element) {
|
|
9425
|
+
for (let i = 0, len1 = this._containers.length; i < len1; i++) {
|
|
9426
|
+
const container = this._containers[i];
|
|
9427
|
+
for (let ii = 0, len2 = container.element.children.length; ii < len2; ii++) {
|
|
9428
|
+
if (container.element.children[ii] === element) {
|
|
9429
|
+
return { container: container, element: element, elementIdx: ii };
|
|
9430
|
+
}
|
|
9431
|
+
}
|
|
9432
|
+
}
|
|
9433
|
+
return { container: undefined, element: undefined, elementIdx: -1 };
|
|
9434
|
+
}
|
|
9435
|
+
/**
|
|
9436
|
+
* Returns next sibling of container that contains given element.
|
|
9437
|
+
* @param element
|
|
9438
|
+
* @returns {any} null if there are no siblings left
|
|
9439
|
+
*/
|
|
9440
|
+
_getNextElementInContainer(element) {
|
|
9441
|
+
const container = this._getContainerOfElement(element);
|
|
9442
|
+
for (let i = 0, len = container.element.children.length; i < len; i++) {
|
|
9443
|
+
if (container.element.children[i] === element) {
|
|
9444
|
+
return i < (len - 1) ? { container: container, element: container.element.children[i + 1], elementIdx: i } : null;
|
|
9445
|
+
}
|
|
9446
|
+
}
|
|
9447
|
+
}
|
|
9448
|
+
_getDragHandleClicked(element) {
|
|
9449
|
+
if (this._dragHandles && this._dragHandles.length > 0) { // check if handle clicked
|
|
9450
|
+
while (element) {
|
|
9451
|
+
for (let i = 0, len = this._dragHandles.length; i < len; i++) {
|
|
9452
|
+
if (element.classList && element.classList.length > 0 && !!this._dragHandles[i]) {
|
|
9453
|
+
if (element.classList.contains(this._dragHandles[i])) {
|
|
9454
|
+
return true;
|
|
9455
|
+
}
|
|
9456
|
+
}
|
|
9457
|
+
}
|
|
9458
|
+
element = element.parentNode === document ? null : element.parentNode;
|
|
9459
|
+
}
|
|
9460
|
+
return false;
|
|
9461
|
+
}
|
|
9462
|
+
else {
|
|
9463
|
+
return true;
|
|
9464
|
+
}
|
|
9465
|
+
}
|
|
9466
|
+
// Returns element when it's a valid drop target, false otherwise.
|
|
9467
|
+
_getValidDragDropElement(element, checkHandle = false) {
|
|
9468
|
+
if (checkHandle) {
|
|
9469
|
+
const validHandleClicked = this._getDragHandleClicked(element);
|
|
9470
|
+
if (!validHandleClicked) {
|
|
9471
|
+
return undefined;
|
|
9472
|
+
}
|
|
9473
|
+
}
|
|
9474
|
+
while (element) {
|
|
9475
|
+
const elementOfContainer = this._getElementOfContainer(element);
|
|
9476
|
+
if (elementOfContainer.elementIdx > -1) {
|
|
9477
|
+
return elementOfContainer;
|
|
9478
|
+
}
|
|
9479
|
+
element = element.parentNode === document ? null : element.parentNode;
|
|
9480
|
+
}
|
|
9481
|
+
return undefined;
|
|
9482
|
+
}
|
|
9483
|
+
_getNextSibling(element) {
|
|
9484
|
+
return this._getNextElementInContainer(element);
|
|
9485
|
+
}
|
|
9486
|
+
// Returns the current index of element within its container.
|
|
9487
|
+
_indexOf(element) {
|
|
9488
|
+
const elementOfContainer = this._getElementOfContainer(element.hasOwnProperty("element") ? element.element : element);
|
|
9489
|
+
return elementOfContainer ? elementOfContainer.elementIdx : -1;
|
|
9490
|
+
}
|
|
9491
|
+
// Creates a ghost image/element of the element being dragged.
|
|
9492
|
+
_createGhostImage() {
|
|
9493
|
+
if (this._ghostDragImage) {
|
|
9494
|
+
return;
|
|
9495
|
+
}
|
|
9496
|
+
// create ghost drag image
|
|
9497
|
+
const offsetRect = this._getOffset();
|
|
9498
|
+
this._ghostDragImage = this._dragElement.element.cloneNode(true);
|
|
9499
|
+
this._ghostDragImage.style.width = offsetRect.width + "px";
|
|
9500
|
+
this._ghostDragImage.style.height = offsetRect.height + "px";
|
|
9501
|
+
this.ghostLeft = offsetRect.left;
|
|
9502
|
+
this.ghostTop = offsetRect.top;
|
|
9503
|
+
this._setElementClass(this._ghostDragImage, "ghost-image");
|
|
9504
|
+
this._setElementClass(document.activeElement, "no-select");
|
|
9505
|
+
document.body.appendChild(this._ghostDragImage);
|
|
9506
|
+
}
|
|
9507
|
+
_destroyGhostImage() {
|
|
9508
|
+
if (this._ghostDragImage) {
|
|
9509
|
+
this._renderer.removeClass(document.activeElement, "no-select");
|
|
9510
|
+
document.body.removeChild(this._ghostDragImage);
|
|
9511
|
+
this._ghostDragImage = undefined;
|
|
9512
|
+
}
|
|
9513
|
+
}
|
|
9514
|
+
// Positions the ghost image at the given coordinates.
|
|
9515
|
+
_positionGhostImage() {
|
|
9516
|
+
if (!this._ghostDragImage) {
|
|
9517
|
+
return;
|
|
9518
|
+
}
|
|
9519
|
+
this._ghostDragImage.style.left = this._ghostLeft + "px";
|
|
9520
|
+
this._ghostDragImage.style.top = this._ghostTop + "px";
|
|
9521
|
+
}
|
|
9522
|
+
_getScroll(scrollProp, offsetProp) {
|
|
9523
|
+
if (document.activeElement.clientHeight) {
|
|
9524
|
+
return document.activeElement[scrollProp];
|
|
9525
|
+
}
|
|
9526
|
+
return document.body[scrollProp];
|
|
9527
|
+
}
|
|
9528
|
+
_getOffset() {
|
|
9529
|
+
const rect = this._dragElement.element.getBoundingClientRect();
|
|
9530
|
+
const scrollLeft = 0;
|
|
9531
|
+
const scrollTop = 0;
|
|
9532
|
+
return {
|
|
9533
|
+
bottom: rect.bottom,
|
|
9534
|
+
height: rect.height,
|
|
9535
|
+
left: rect.left + scrollLeft,
|
|
9536
|
+
right: rect.right,
|
|
9537
|
+
top: rect.top + scrollTop,
|
|
9538
|
+
width: rect.width
|
|
9539
|
+
};
|
|
9540
|
+
}
|
|
9541
|
+
_determineDroptarget(element, x, y) {
|
|
9542
|
+
const dropElement = this._getValidDragDropElement(element);
|
|
9543
|
+
if (dropElement) {
|
|
9544
|
+
if (dropElement.element !== this._dragElement.element) {
|
|
9545
|
+
this._dropTargetElement = dropElement;
|
|
9546
|
+
return;
|
|
9547
|
+
}
|
|
9548
|
+
}
|
|
9549
|
+
this._dropTargetElement = null;
|
|
9550
|
+
}
|
|
9551
|
+
/**
|
|
9552
|
+
* Briefly hides the ghost image to be able to determine which element is under mouse.
|
|
9553
|
+
* @param x
|
|
9554
|
+
* @param y
|
|
9555
|
+
* @returns {Element} Top level element
|
|
9556
|
+
*/
|
|
9557
|
+
_getHoveredElement(x, y) {
|
|
9558
|
+
this._setElementClass(this._ghostDragImage, "ghost-image-hide");
|
|
9559
|
+
const elm = document.elementFromPoint(x, y);
|
|
9560
|
+
this._renderer.removeClass(this._ghostDragImage, "ghost-image-hide");
|
|
9561
|
+
return elm;
|
|
9562
|
+
}
|
|
9563
|
+
_animateVisibility(element, transitionTime = 0.2, start = "0", end = "1") {
|
|
9564
|
+
if (!element) {
|
|
9565
|
+
return;
|
|
9566
|
+
}
|
|
9567
|
+
const transitionStyle = "opacity " + transitionTime + "s ease-in-out";
|
|
9568
|
+
const transition = element.style.transition;
|
|
9569
|
+
element.style.transition = transition + (transition ? "," : "") + transitionStyle;
|
|
9570
|
+
element.style.opacity = start;
|
|
9571
|
+
element.style.opacity = end;
|
|
9572
|
+
return new Promise((resolve) => {
|
|
9573
|
+
setTimeout(() => {
|
|
9574
|
+
resolve();
|
|
9575
|
+
}, transitionTime * 1000);
|
|
9576
|
+
});
|
|
9577
|
+
}
|
|
9578
|
+
_animateMove(parent, dragElement, dropTargetElement, down) {
|
|
9579
|
+
if (down) { // insert element before
|
|
9580
|
+
parent.insertBefore(dragElement.element, dropTargetElement.element);
|
|
9581
|
+
}
|
|
9582
|
+
else { // insert after
|
|
9583
|
+
parent.insertBefore(dragElement.element, dropTargetElement.element.nextSibling);
|
|
9584
|
+
}
|
|
9585
|
+
}
|
|
9586
|
+
_startDrag() {
|
|
9587
|
+
this._createGhostImage();
|
|
9588
|
+
this._setElementClass(this._dragElement.element, "is-dragged");
|
|
9589
|
+
}
|
|
9590
|
+
_drag(event) {
|
|
9591
|
+
this.ghostLeft = this._ghostLeft + (event.screenX - this._currentMousePosition.x);
|
|
9592
|
+
this.ghostTop = this._ghostTop + (event.screenY - this._currentMousePosition.y);
|
|
9593
|
+
const x = event.clientX;
|
|
9594
|
+
const y = event.clientY;
|
|
9595
|
+
const hoveredElement = this._getHoveredElement(x, y);
|
|
9596
|
+
this._determineDroptarget(hoveredElement, x, y);
|
|
9597
|
+
if (this._dropTargetElement) {
|
|
9598
|
+
const down = (this._dropTargetElement.container.direction === CoOrientation.Vertical && event.screenY > this._currentMousePosition.y) ||
|
|
9599
|
+
(this._dropTargetElement.container.direction === CoOrientation.Horizontal && event.screenX > this._currentMousePosition.x);
|
|
9600
|
+
this._animateMove(this._dropTargetElement.container.element, this._dragElement, this._dropTargetElement, down);
|
|
9601
|
+
this.drag.next({
|
|
9602
|
+
element: this._dragElement,
|
|
9603
|
+
elementIndex: this._dragElement.elementIdx,
|
|
9604
|
+
source: this._dropTargetElement.container.element
|
|
9605
|
+
});
|
|
9606
|
+
this._lastDropTarget = this._dropTargetElement;
|
|
9607
|
+
}
|
|
9608
|
+
}
|
|
9609
|
+
// element is dropped
|
|
9610
|
+
_endDrag() {
|
|
9611
|
+
this._renderer.removeClass(this._dragElement.element, "is-dragged");
|
|
9612
|
+
this._destroyGhostImage();
|
|
9613
|
+
this.drop.next({
|
|
9614
|
+
element: this._dragElement.element,
|
|
9615
|
+
elementIndex: this._dragElement.elementIdx,
|
|
9616
|
+
target: this._lastDropTarget ? this._lastDropTarget.element : null,
|
|
9617
|
+
targetIndex: this._lastDropTarget ? this._lastDropTarget.elementIdx : -1,
|
|
9618
|
+
container: this._lastDropTarget ? this._lastDropTarget.container : null
|
|
9619
|
+
});
|
|
9620
|
+
this._resetDrag();
|
|
9621
|
+
}
|
|
9622
|
+
_resetDrag() {
|
|
9623
|
+
this._dragElement = null;
|
|
9624
|
+
this._dragInContainer = null;
|
|
9625
|
+
this._lastDropTarget = null;
|
|
9626
|
+
this._isdragging = false;
|
|
9627
|
+
}
|
|
9628
|
+
}
|
|
9629
|
+
DragDropService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DragDropService_Factory() { return new DragDropService(); }, token: DragDropService, providedIn: "root" });
|
|
9630
|
+
DragDropService.decorators = [
|
|
9631
|
+
{ type: Injectable, args: [{
|
|
9632
|
+
providedIn: "root"
|
|
9633
|
+
},] }
|
|
9634
|
+
];
|
|
9635
|
+
DragDropService.ctorParameters = () => [];
|
|
9636
|
+
|
|
9637
|
+
class DragDropContainerComponent {
|
|
9638
|
+
constructor(_elementRef, _renderer, _dragDropService) {
|
|
9639
|
+
this._elementRef = _elementRef;
|
|
9640
|
+
this._renderer = _renderer;
|
|
9641
|
+
this._dragDropService = _dragDropService;
|
|
9642
|
+
this.handleSort = false;
|
|
9643
|
+
/**
|
|
9644
|
+
* Class of the handle to drag operations
|
|
9645
|
+
*/
|
|
9646
|
+
this.dragHandle = "";
|
|
9647
|
+
// Emits when the order of sortableList items changed after a drag-drop action.
|
|
9648
|
+
this.sortingChange = new EventEmitter();
|
|
9649
|
+
this.showClass = true;
|
|
9650
|
+
this._enabled = true;
|
|
9651
|
+
this._initialized = false;
|
|
9652
|
+
this._dragDropService.renderer = this._renderer;
|
|
9653
|
+
this._container = new DragDropContainer(_elementRef.nativeElement, CoOrientation.Vertical);
|
|
9654
|
+
}
|
|
9655
|
+
set enabled(value) {
|
|
9656
|
+
this._enabled = value;
|
|
9657
|
+
this.handleEnabledChange();
|
|
9658
|
+
}
|
|
9659
|
+
ngAfterViewInit() {
|
|
9660
|
+
this._initialized = true;
|
|
9661
|
+
this._createDragDrop();
|
|
9662
|
+
if (this._initialized) {
|
|
9663
|
+
this._updateEnableDisableContainer();
|
|
9664
|
+
}
|
|
9665
|
+
}
|
|
9666
|
+
/**
|
|
9667
|
+
* Cleanup...
|
|
9668
|
+
*/
|
|
9669
|
+
ngOnDestroy() {
|
|
9670
|
+
this._removeDragDrop();
|
|
9671
|
+
this._elementRef = undefined;
|
|
9672
|
+
}
|
|
9673
|
+
handleEnabledChange() {
|
|
9674
|
+
if (!this._initialized) {
|
|
9675
|
+
return;
|
|
9676
|
+
}
|
|
9677
|
+
if (this._enabled) {
|
|
9678
|
+
this._dragDropService.enableContainer(this._container);
|
|
9679
|
+
this._createDragDrop();
|
|
9680
|
+
}
|
|
9681
|
+
else {
|
|
9682
|
+
this._dragDropService.disableContainer(this._container);
|
|
9683
|
+
this._removeDragDrop();
|
|
9684
|
+
this._initialized = false;
|
|
9685
|
+
}
|
|
9686
|
+
}
|
|
9687
|
+
_createDragDrop() {
|
|
9688
|
+
this._dragDropService.addContainer(this._container);
|
|
9689
|
+
this._dragDropService.addDragHandle(this.dragHandle);
|
|
9690
|
+
if (this.handleSort) { // subscribe drop event to be able to adapt the order of dropped items
|
|
9691
|
+
this._handleOrderSub = this._dragDropService.drop.subscribe((event) => {
|
|
9692
|
+
this._handleOrder(event.container, event.elementIndex, event.targetIndex);
|
|
9693
|
+
});
|
|
9694
|
+
}
|
|
9695
|
+
this._initialized = true;
|
|
9696
|
+
}
|
|
9697
|
+
_removeDragDrop() {
|
|
9698
|
+
this._dragDropService.removeContainer(this._container);
|
|
9699
|
+
this._dragDropService.removeDragHandle(this.dragHandle);
|
|
9700
|
+
if (this._handleOrderSub) {
|
|
9701
|
+
this._handleOrderSub.unsubscribe();
|
|
9702
|
+
}
|
|
9703
|
+
}
|
|
9704
|
+
_handleOrder(container, oldIndex, newIndex) {
|
|
9705
|
+
if (container !== this._container) {
|
|
9706
|
+
return;
|
|
9707
|
+
}
|
|
9708
|
+
if (newIndex === -1) {
|
|
9709
|
+
newIndex = this.sortableList.length;
|
|
9710
|
+
}
|
|
9711
|
+
ArrayUtils$1.MoveElement(this.sortableList[oldIndex], newIndex, this.sortableList);
|
|
9712
|
+
this.sortingChange.emit(this.sortableList);
|
|
9713
|
+
}
|
|
9714
|
+
_updateEnableDisableContainer() {
|
|
9715
|
+
if (this._enabled) {
|
|
9716
|
+
this._dragDropService.enableContainer(this._container);
|
|
9717
|
+
}
|
|
9718
|
+
else {
|
|
9719
|
+
this._dragDropService.disableContainer(this._container);
|
|
9720
|
+
}
|
|
9721
|
+
}
|
|
9722
|
+
}
|
|
9723
|
+
DragDropContainerComponent.decorators = [
|
|
9724
|
+
{ type: Directive, args: [{
|
|
9725
|
+
selector: "drag-drop-container"
|
|
9726
|
+
},] }
|
|
9727
|
+
];
|
|
9728
|
+
DragDropContainerComponent.ctorParameters = () => [
|
|
9729
|
+
{ type: ElementRef },
|
|
9730
|
+
{ type: Renderer2 },
|
|
9731
|
+
{ type: DragDropService }
|
|
9732
|
+
];
|
|
9733
|
+
DragDropContainerComponent.propDecorators = {
|
|
9734
|
+
sortableList: [{ type: Input }],
|
|
9735
|
+
handleSort: [{ type: Input }],
|
|
9736
|
+
enabled: [{ type: Input }],
|
|
9737
|
+
dragHandle: [{ type: Input }],
|
|
9738
|
+
sortingChange: [{ type: Output }],
|
|
9739
|
+
showClass: [{ type: HostBinding, args: ["class.co-drag-drop-container",] }]
|
|
9740
|
+
};
|
|
9741
|
+
__decorate([
|
|
9742
|
+
InputBoolean()
|
|
9743
|
+
], DragDropContainerComponent.prototype, "handleSort", void 0);
|
|
9744
|
+
|
|
9745
|
+
class ImageDisplayComponent {
|
|
9746
|
+
constructor() {
|
|
9747
|
+
// The (localized) text to show when there is no image. Defaults to 'NO_IMAGE'.
|
|
9748
|
+
this.label = "NO_IMAGE";
|
|
9749
|
+
}
|
|
9750
|
+
showClass() {
|
|
9751
|
+
return true;
|
|
9752
|
+
}
|
|
9753
|
+
}
|
|
9754
|
+
ImageDisplayComponent.decorators = [
|
|
9755
|
+
{ type: Component, args: [{
|
|
9756
|
+
selector: "co-image-display",
|
|
9757
|
+
template: `
|
|
9758
|
+
<img class="image" *ngIf="!!model" [src]="model">
|
|
9759
|
+
<div class="no-image" *ngIf="!model">
|
|
9760
|
+
<div class="img"></div>
|
|
9761
|
+
<div class="no-image-label" [textContent]="label | localize"></div>
|
|
9762
|
+
</div>
|
|
9763
|
+
`,
|
|
9764
|
+
providers: [{
|
|
9765
|
+
provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
|
|
9766
|
+
useExisting: forwardRef(() => ImageDisplayComponent)
|
|
9767
|
+
}
|
|
9768
|
+
],
|
|
9769
|
+
encapsulation: ViewEncapsulation.None
|
|
9770
|
+
},] }
|
|
9771
|
+
];
|
|
9772
|
+
ImageDisplayComponent.propDecorators = {
|
|
9773
|
+
model: [{ type: Input }],
|
|
9774
|
+
label: [{ type: Input }],
|
|
9775
|
+
showClass: [{ type: HostBinding, args: ['class.co-image-display',] }],
|
|
9776
|
+
hidden: [{ type: HostBinding, args: ["class.co-transaction-hidden",] }]
|
|
9777
|
+
};
|
|
9778
|
+
|
|
9779
|
+
class ImageDisplayModule {
|
|
9780
|
+
}
|
|
9781
|
+
ImageDisplayModule.decorators = [
|
|
9782
|
+
{ type: NgModule, args: [{
|
|
9783
|
+
imports: [
|
|
9784
|
+
CoreComponentsTranslationModule,
|
|
9785
|
+
CommonModule,
|
|
9786
|
+
LocalizationModule
|
|
9787
|
+
],
|
|
9788
|
+
declarations: [
|
|
9789
|
+
ImageDisplayComponent
|
|
9790
|
+
],
|
|
9791
|
+
exports: [
|
|
9792
|
+
ImageDisplayComponent
|
|
9793
|
+
]
|
|
9794
|
+
},] }
|
|
9795
|
+
];
|
|
9796
|
+
|
|
9797
|
+
// The GUI part of the files-upload component. Not a standalone component.
|
|
9798
|
+
class FileUploadComponent {
|
|
9799
|
+
constructor(_promptService, _fileTypeImgPipe, iconService) {
|
|
9800
|
+
this._promptService = _promptService;
|
|
9801
|
+
this._fileTypeImgPipe = _fileTypeImgPipe;
|
|
9802
|
+
this.iconService = iconService;
|
|
9803
|
+
this.icons = Icon;
|
|
9804
|
+
// Element clickable
|
|
9805
|
+
this.link = false;
|
|
9806
|
+
this.readonly = false;
|
|
9807
|
+
// Is tile an 'adding' tile
|
|
9808
|
+
this.isAddingTile = false;
|
|
9809
|
+
// Set this parameter to false if clicking ok on the document edit popup does not save the document
|
|
9810
|
+
// so that refreshing of content on file open works correctly
|
|
9811
|
+
this.fileSavesOnPopupOkClick = true;
|
|
9812
|
+
this.isEditable = false;
|
|
9813
|
+
// Show a trashcan icon
|
|
9814
|
+
this.showTrashCan = false;
|
|
9815
|
+
// Show an image as placeholder
|
|
9816
|
+
this.showImage = false;
|
|
9817
|
+
this.customImageClick = false;
|
|
9818
|
+
this.deleteClick = new EventEmitter();
|
|
9819
|
+
this.editClick = new EventEmitter();
|
|
9820
|
+
this.imageClick = new EventEmitter();
|
|
9821
|
+
this.previewImage = "";
|
|
9822
|
+
this._label = "";
|
|
9823
|
+
}
|
|
9824
|
+
// Input file to upload.
|
|
9825
|
+
set file(document) {
|
|
9826
|
+
this._file = document;
|
|
9827
|
+
this._updatePreviewImage();
|
|
9828
|
+
// we should produce a preview image from given document, but its contents might not yet have been loaded:
|
|
9829
|
+
this._listenForDocumentBodyChanges();
|
|
9830
|
+
}
|
|
9831
|
+
get file() {
|
|
9832
|
+
return this._file;
|
|
9833
|
+
}
|
|
9834
|
+
set label(value) {
|
|
9835
|
+
this._label = value;
|
|
9836
|
+
}
|
|
9837
|
+
get label() {
|
|
9838
|
+
if (this._file && this._file.description) {
|
|
9839
|
+
return this._file.description;
|
|
9840
|
+
}
|
|
9841
|
+
else {
|
|
9842
|
+
return this._label;
|
|
9843
|
+
}
|
|
9844
|
+
}
|
|
9845
|
+
showClass() {
|
|
9846
|
+
return true;
|
|
9847
|
+
}
|
|
9848
|
+
get isLink() {
|
|
9849
|
+
return this.link;
|
|
9850
|
+
}
|
|
9851
|
+
ngOnDestroy() {
|
|
9852
|
+
if (this._docBodyChangeSub) {
|
|
9853
|
+
this._docBodyChangeSub.unsubscribe();
|
|
9854
|
+
}
|
|
9855
|
+
}
|
|
9856
|
+
onDeleteClick() {
|
|
9857
|
+
this.deleteClick.emit();
|
|
9858
|
+
}
|
|
9859
|
+
onImageClick() {
|
|
9860
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9861
|
+
if (this.isAddingTile) {
|
|
9862
|
+
return;
|
|
9863
|
+
}
|
|
9864
|
+
if (this.customImageClick) {
|
|
9865
|
+
this.imageClick.next(this._file);
|
|
9866
|
+
return;
|
|
9867
|
+
}
|
|
9868
|
+
//todo fix methods
|
|
9869
|
+
//first download document body if it is stored in a private cdn directory
|
|
9870
|
+
if (!this._file.documentBody) {
|
|
9871
|
+
//await this._generalDal.getDocumentContent(this._file).then(documentBody => this._file.documentBody = documentBody);
|
|
9872
|
+
}
|
|
9873
|
+
if (this._file.isImageDocument()) { //preview image
|
|
9874
|
+
this._promptService.showImage(this.file.documentBodyAsDataUri, "Preview");
|
|
9875
|
+
}
|
|
9876
|
+
else { //download document
|
|
9877
|
+
try {
|
|
9878
|
+
//FileUtils.DownloadFromDataUri(this._file.bodyAsDataUri, this._file.fileName);
|
|
9879
|
+
}
|
|
9880
|
+
catch (e) {
|
|
9881
|
+
}
|
|
9882
|
+
}
|
|
9883
|
+
});
|
|
9884
|
+
}
|
|
9885
|
+
onPencilClick() {
|
|
9886
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
9887
|
+
// refresh file content if files are saved individually
|
|
9888
|
+
if (this._file.hasId() && this.fileSavesOnPopupOkClick) {
|
|
9889
|
+
let idForLink;
|
|
9890
|
+
if (this._file.idForLink) {
|
|
9891
|
+
idForLink = this._file.idForLink;
|
|
9892
|
+
}
|
|
9893
|
+
// Get most recent version of this file if it has an id and therefore has been saved in the db
|
|
9894
|
+
//TODO fix fetch
|
|
9895
|
+
// this._file = await this._generalDal.getDocumentFromTable(this._file.documentId);
|
|
9896
|
+
//this._file.idForLink = idForLink; // Restore the idForLink
|
|
9897
|
+
}
|
|
9898
|
+
this.editClick.emit(this._file);
|
|
9899
|
+
});
|
|
9900
|
+
}
|
|
9901
|
+
// updates this.previewImage when doc body changes
|
|
9902
|
+
_listenForDocumentBodyChanges() {
|
|
9903
|
+
if (this._file) {
|
|
9904
|
+
if (this._docBodyChangeSub) {
|
|
9905
|
+
this._docBodyChangeSub.unsubscribe();
|
|
9906
|
+
}
|
|
9907
|
+
// @ts-ignore
|
|
9908
|
+
this._docBodyChangeSub = this._file.documentBodyChange.subscribe(() => {
|
|
9909
|
+
this._updatePreviewImage();
|
|
9910
|
+
});
|
|
9911
|
+
}
|
|
9912
|
+
}
|
|
9913
|
+
_updatePreviewImage() {
|
|
9914
|
+
if (this._file) {
|
|
9915
|
+
if (this._file.isImageDocument()) {
|
|
9916
|
+
this.previewImage = this._file.documentBodyAsDataUri;
|
|
9917
|
+
if (this.previewImage === "") {
|
|
9918
|
+
//TODO fix fetch
|
|
9919
|
+
//this._generalDal.getDocumentContent(this._file).then(documentBody => this._file.documentBody = documentBody);
|
|
9920
|
+
//this.previewImage = this._file.documentBody;
|
|
9921
|
+
}
|
|
9922
|
+
}
|
|
9923
|
+
else {
|
|
9924
|
+
this.previewImage = this._fileTypeImgPipe.transform(this.file.fileTypeInternal);
|
|
9925
|
+
}
|
|
9926
|
+
}
|
|
9927
|
+
}
|
|
9928
|
+
}
|
|
9929
|
+
FileUploadComponent.decorators = [
|
|
9930
|
+
{ type: Component, args: [{
|
|
9931
|
+
selector: "co-file-upload",
|
|
9932
|
+
template: `
|
|
9933
|
+
<co-tile-render [hideImageDisplayWhenNoImage]="true" [imageDataUri]="previewImage" [description]="label" (imageClick)="onImageClick()">
|
|
9934
|
+
<ng-template #infoTemplate>
|
|
9935
|
+
<co-button *ngIf="isEditable && !readonly" class="edit-file" [iconData]="iconService.getIcon(icons.Account)"
|
|
9936
|
+
(click)="onPencilClick()"></co-button>
|
|
9937
|
+
</ng-template>
|
|
9938
|
+
<co-icon *ngIf="showTrashCan && !readonly" [iconData]="iconService.getIcon(icons.Trashbin)" class="trash" (click)="onDeleteClick()"></co-icon>
|
|
9939
|
+
<co-icon tile-render-image-content *ngIf="icon" class="dark add-button" [icon]="icon"></co-icon>
|
|
9940
|
+
</co-tile-render>
|
|
9941
|
+
`,
|
|
9942
|
+
encapsulation: ViewEncapsulation.None
|
|
9943
|
+
},] }
|
|
9944
|
+
];
|
|
9945
|
+
FileUploadComponent.ctorParameters = () => [
|
|
9946
|
+
{ type: PromptService },
|
|
9947
|
+
{ type: FileTypeImagePipe },
|
|
9948
|
+
{ type: IconCacheService }
|
|
9949
|
+
];
|
|
9950
|
+
FileUploadComponent.propDecorators = {
|
|
9951
|
+
form: [{ type: ViewChild, args: [FormComponent,] }],
|
|
9952
|
+
file: [{ type: Input }],
|
|
9953
|
+
icon: [{ type: Input }],
|
|
9954
|
+
link: [{ type: Input }],
|
|
9955
|
+
readonly: [{ type: Input }],
|
|
9956
|
+
isAddingTile: [{ type: Input }],
|
|
9957
|
+
fileSavesOnPopupOkClick: [{ type: Input }],
|
|
9958
|
+
isEditable: [{ type: Input }],
|
|
9959
|
+
label: [{ type: Input }],
|
|
9960
|
+
showTrashCan: [{ type: Input }],
|
|
9961
|
+
showImage: [{ type: Input }],
|
|
9962
|
+
customImageClick: [{ type: Input }],
|
|
9963
|
+
deleteClick: [{ type: Output }],
|
|
9964
|
+
editClick: [{ type: Output }],
|
|
9965
|
+
imageClick: [{ type: Output }],
|
|
9966
|
+
showClass: [{ type: HostBinding, args: ['class.co-file-upload',] }],
|
|
9967
|
+
isLink: [{ type: HostBinding, args: ["class.link",] }]
|
|
9968
|
+
};
|
|
9969
|
+
__decorate([
|
|
9970
|
+
InputBoolean()
|
|
9971
|
+
], FileUploadComponent.prototype, "isAddingTile", void 0);
|
|
9972
|
+
__decorate([
|
|
9973
|
+
InputBoolean()
|
|
9974
|
+
], FileUploadComponent.prototype, "fileSavesOnPopupOkClick", void 0);
|
|
9975
|
+
__decorate([
|
|
9976
|
+
InputBoolean()
|
|
9977
|
+
], FileUploadComponent.prototype, "isEditable", void 0);
|
|
9978
|
+
|
|
9979
|
+
// large or small tiles for the <tile-render> component.
|
|
9980
|
+
var TileSizeType;
|
|
9981
|
+
(function (TileSizeType) {
|
|
9982
|
+
TileSizeType[TileSizeType["Small"] = 0] = "Small";
|
|
9983
|
+
TileSizeType[TileSizeType["Large"] = 1] = "Large";
|
|
9984
|
+
})(TileSizeType || (TileSizeType = {}));
|
|
9985
|
+
|
|
9986
|
+
/**
|
|
9987
|
+
* A generic component that shows a collection of simple inputs (description, image, price, etc.) as a tile-shaped graphic with an image
|
|
9988
|
+
* part (upper) and an info part (lower).
|
|
9989
|
+
*/
|
|
9990
|
+
class TileRenderComponent {
|
|
9991
|
+
constructor(iconCacheService) {
|
|
9992
|
+
this.iconCacheService = iconCacheService;
|
|
9993
|
+
this.icons = Icon;
|
|
9994
|
+
// Render a large or small tile.
|
|
9995
|
+
this.tileSize = TileSizeType.Large;
|
|
9996
|
+
// When this tile is selected, this icon will be shown green in the upper-left corner (defaults to 'check').
|
|
9997
|
+
this.iconWhenSelected = "check";
|
|
9998
|
+
// Emits when the image wrapper was clicked (top half of this component) .
|
|
9999
|
+
this.imageClick = new EventEmitter();
|
|
10000
|
+
// Emits when the info wrapper was clicked (bottom half of this component).
|
|
10001
|
+
this.infoClick = new EventEmitter();
|
|
10002
|
+
this.Icon = Icon;
|
|
10003
|
+
}
|
|
10004
|
+
get inSmallTileMode() {
|
|
10005
|
+
return this.tileSize === TileSizeType.Small;
|
|
10006
|
+
}
|
|
10007
|
+
showClass() {
|
|
10008
|
+
return true;
|
|
10009
|
+
}
|
|
10010
|
+
get inLargeTileMode() {
|
|
10011
|
+
return this.tileSize === TileSizeType.Large;
|
|
10012
|
+
}
|
|
10013
|
+
ngOnDestroy() {
|
|
10014
|
+
this.infoTemplate = undefined;
|
|
10015
|
+
}
|
|
10016
|
+
}
|
|
10017
|
+
TileRenderComponent.decorators = [
|
|
10018
|
+
{ type: Component, args: [{
|
|
10019
|
+
selector: "co-tile-render",
|
|
10020
|
+
template: `
|
|
10021
|
+
<div class="image" (click)="imageClick.emit()">
|
|
10022
|
+
<label *ngIf="inLargeTileMode && tagDescription" [textContent]="tagDescription"></label>
|
|
10023
|
+
<co-icon *ngIf="selected" class="selected small light circle" [iconData]="iconCacheService.getIcon(iconWhenSelected)" ></co-icon>
|
|
10024
|
+
<co-image [source]="imageDataUri" [class.hidden]="(inSmallTileMode || hideImageDisplayWhenNoImage) && !imageDataUri"
|
|
10025
|
+
></co-image>
|
|
10026
|
+
|
|
10027
|
+
|
|
10028
|
+
|
|
10029
|
+
<ng-content select="[tile-render-image-content]"></ng-content>
|
|
10030
|
+
</div>
|
|
10031
|
+
<div class="info" (click)="infoClick.emit()">
|
|
10032
|
+
<ng-container *ngIf="infoTemplate" [templateWrapper]="infoTemplate"></ng-container>
|
|
10033
|
+
<span *ngIf="inLargeTileMode && label" class="label" [textContent]="label"></span>
|
|
10034
|
+
<span *ngIf="inLargeTileMode && description" class="description" [textContent]="description"></span>
|
|
10035
|
+
</div>
|
|
10036
|
+
<ng-content></ng-content>
|
|
10037
|
+
`,
|
|
10038
|
+
encapsulation: ViewEncapsulation.None
|
|
10039
|
+
},] }
|
|
10040
|
+
];
|
|
10041
|
+
TileRenderComponent.ctorParameters = () => [
|
|
10042
|
+
{ type: IconCacheService }
|
|
10043
|
+
];
|
|
10044
|
+
TileRenderComponent.propDecorators = {
|
|
10045
|
+
infoTemplate: [{ type: ContentChild, args: ["infoTemplate", { static: true },] }],
|
|
10046
|
+
imageDataUri: [{ type: Input }],
|
|
10047
|
+
tagDescription: [{ type: Input }],
|
|
10048
|
+
label: [{ type: Input }],
|
|
10049
|
+
description: [{ type: Input }],
|
|
10050
|
+
tileSize: [{ type: Input }],
|
|
10051
|
+
price: [{ type: Input }],
|
|
10052
|
+
hidePrice: [{ type: Input }],
|
|
10053
|
+
iconWhenSelected: [{ type: Input }],
|
|
10054
|
+
hideImageDisplayWhenNoImage: [{ type: Input }],
|
|
10055
|
+
selected: [{ type: Input }, { type: HostBinding, args: ["class.selected",] }],
|
|
10056
|
+
imageClick: [{ type: Output }],
|
|
10057
|
+
infoClick: [{ type: Output }],
|
|
10058
|
+
inSmallTileMode: [{ type: HostBinding, args: ["class.small-size",] }],
|
|
10059
|
+
showClass: [{ type: HostBinding, args: ["class.co-tile-render",] }]
|
|
10060
|
+
};
|
|
10061
|
+
|
|
10062
|
+
class TileRenderModule {
|
|
10063
|
+
}
|
|
10064
|
+
TileRenderModule.decorators = [
|
|
10065
|
+
{ type: NgModule, args: [{
|
|
10066
|
+
imports: [
|
|
10067
|
+
ImageDisplayModule,
|
|
10068
|
+
CommonModule,
|
|
10069
|
+
IconModule,
|
|
10070
|
+
ImageModule,
|
|
10071
|
+
TemplateWrapperModule
|
|
10072
|
+
],
|
|
10073
|
+
declarations: [
|
|
10074
|
+
TileRenderComponent
|
|
10075
|
+
],
|
|
10076
|
+
exports: [
|
|
10077
|
+
TileRenderComponent
|
|
10078
|
+
],
|
|
10079
|
+
providers: []
|
|
10080
|
+
},] }
|
|
10081
|
+
];
|
|
10082
|
+
|
|
10083
|
+
class FileUploadModule {
|
|
10084
|
+
}
|
|
10085
|
+
FileUploadModule.decorators = [
|
|
10086
|
+
{ type: NgModule, args: [{
|
|
10087
|
+
imports: [
|
|
10088
|
+
IconModule,
|
|
10089
|
+
TileRenderModule,
|
|
10090
|
+
CommonModule,
|
|
10091
|
+
ButtonModule
|
|
10092
|
+
],
|
|
10093
|
+
declarations: [
|
|
10094
|
+
FileUploadComponent
|
|
10095
|
+
],
|
|
10096
|
+
exports: [
|
|
10097
|
+
FileUploadComponent
|
|
10098
|
+
],
|
|
10099
|
+
providers: []
|
|
10100
|
+
},] }
|
|
10101
|
+
];
|
|
10102
|
+
|
|
10103
|
+
// @dynamic
|
|
10104
|
+
class EnumUtils {
|
|
10105
|
+
// Returns a new array with all string values (not keys) of given string enum class.
|
|
10106
|
+
static StringEnumToArray(clazz) {
|
|
10107
|
+
const asArray = [];
|
|
10108
|
+
const keys = Object.keys(clazz);
|
|
10109
|
+
for (let i = 0, len = keys.length; i < len; i++) {
|
|
10110
|
+
asArray.push(clazz[keys[i]]);
|
|
10111
|
+
}
|
|
10112
|
+
return asArray;
|
|
10113
|
+
}
|
|
10114
|
+
/**
|
|
10115
|
+
* Returns a single string representation of given string enum class
|
|
10116
|
+
* @param clazz
|
|
10117
|
+
* @returns {string} eg "input-lov-slideout, financial-customer-group-select" for a given clazz of InputLovSlideoutComponentSelectors
|
|
10118
|
+
*/
|
|
10119
|
+
static StringEnumToSingleString(clazz) {
|
|
10120
|
+
return StringEnumToSingleString(clazz);
|
|
10121
|
+
}
|
|
10122
|
+
// Get the number values from an enum
|
|
10123
|
+
static GetNumberEnumValues(numberEnumClass) {
|
|
10124
|
+
return this.GetObjValues(numberEnumClass).filter(value => NumberUtils.IsNumber(value));
|
|
10125
|
+
}
|
|
10126
|
+
// Get the the property object value names in string format from the enum
|
|
10127
|
+
static GetStringEnumValues(stringEnumClass) {
|
|
10128
|
+
return this.GetObjValues(stringEnumClass).filter(value => StringUtils.IsString(value));
|
|
10129
|
+
}
|
|
10130
|
+
static GetObjValues(numberEnumClass) {
|
|
10131
|
+
return Object.keys(numberEnumClass).map(key => numberEnumClass[key]);
|
|
10132
|
+
}
|
|
10133
|
+
/**
|
|
10134
|
+
* Returns the enum in object format to make handling easier
|
|
10135
|
+
* Works for Enums with the following format:
|
|
10136
|
+
* foo: 1
|
|
10137
|
+
* bar: 2
|
|
10138
|
+
* etc...
|
|
10139
|
+
* @param enumClass
|
|
10140
|
+
* @returns {Object}
|
|
10141
|
+
*/
|
|
10142
|
+
static createObjectFromEnum(enumClass) {
|
|
10143
|
+
// const objectifiedEnum: { refNumber: number; name: string }[] = [];
|
|
10144
|
+
const objectifiedEnum = [];
|
|
10145
|
+
for (const enumItem in enumClass) {
|
|
10146
|
+
if (typeof enumClass[enumItem] === "number") {
|
|
10147
|
+
objectifiedEnum.push({ key: enumClass[enumItem], value: enumItem });
|
|
10148
|
+
}
|
|
10149
|
+
}
|
|
10150
|
+
return objectifiedEnum;
|
|
10151
|
+
}
|
|
10152
|
+
static getStringEnumKeysArray(enumType) {
|
|
10153
|
+
const members = Object.keys(enumType);
|
|
10154
|
+
if (!EnumUtils.isNumeral(enumType)) {
|
|
10155
|
+
return members;
|
|
10156
|
+
}
|
|
10157
|
+
const keys = [];
|
|
10158
|
+
members.forEach((x) => {
|
|
10159
|
+
const parsedValue = parseInt(x, 10);
|
|
10160
|
+
if (Number.isNaN(parsedValue)) {
|
|
10161
|
+
keys.push(x);
|
|
10162
|
+
}
|
|
10163
|
+
});
|
|
10164
|
+
return keys;
|
|
10165
|
+
}
|
|
10166
|
+
static buildPromiseDomainValueListFromEnumClass(enumClass, dictionary, keysAsDescription = false) {
|
|
10167
|
+
return new Promise((resolve, reject) => {
|
|
10168
|
+
try {
|
|
10169
|
+
resolve(EnumUtils.buildDomainValueListFromEnumClass(enumClass, dictionary, keysAsDescription));
|
|
10170
|
+
}
|
|
10171
|
+
catch (e) {
|
|
10172
|
+
reject();
|
|
10173
|
+
}
|
|
10174
|
+
});
|
|
10175
|
+
}
|
|
10176
|
+
static buildDomainValueListFromEnumClass(enumClass, dictionary, keysAsDescription = false) {
|
|
10177
|
+
const collection = [];
|
|
10178
|
+
if (keysAsDescription) {
|
|
10179
|
+
const enumKeys = EnumUtils.getStringEnumKeysArray(enumClass);
|
|
10180
|
+
enumKeys.forEach((key, index) => {
|
|
10181
|
+
const domainObjectForLov = new CoDomainValue();
|
|
10182
|
+
domainObjectForLov.code = enumClass[key];
|
|
10183
|
+
domainObjectForLov.description = dictionary.get(key);
|
|
10184
|
+
domainObjectForLov.sequence = index;
|
|
10185
|
+
collection.push(domainObjectForLov);
|
|
10186
|
+
});
|
|
10187
|
+
}
|
|
10188
|
+
else {
|
|
10189
|
+
EnumUtils.StringEnumToArray(enumClass).forEach((strEnumVal, index) => {
|
|
10190
|
+
const domainObjectForLov = new CoDomainValue();
|
|
10191
|
+
domainObjectForLov.code = strEnumVal;
|
|
10192
|
+
domainObjectForLov.description = dictionary.get(strEnumVal);
|
|
10193
|
+
domainObjectForLov.sequence = index;
|
|
10194
|
+
collection.push(domainObjectForLov);
|
|
10195
|
+
});
|
|
10196
|
+
}
|
|
10197
|
+
return collection;
|
|
10198
|
+
}
|
|
10199
|
+
static getKeyByValue(enumType, enumValue) {
|
|
10200
|
+
return Object.keys(enumType)[Object.values(enumType).indexOf(enumValue)];
|
|
10201
|
+
}
|
|
10202
|
+
static isNumeral(enumType) {
|
|
10203
|
+
const members = Object.keys(enumType);
|
|
10204
|
+
if (!members.some((x) => true)) {
|
|
10205
|
+
throw new TypeError("Invalid enumeration type.");
|
|
10206
|
+
}
|
|
10207
|
+
let parsedCount = 0;
|
|
10208
|
+
members.forEach((x) => {
|
|
10209
|
+
const parsedValue = parseInt(x, 10);
|
|
10210
|
+
if (!Number.isNaN(parsedValue)) {
|
|
10211
|
+
parsedCount++;
|
|
10212
|
+
}
|
|
10213
|
+
});
|
|
10214
|
+
return parsedCount === members.length / 2;
|
|
10215
|
+
}
|
|
10216
|
+
}
|
|
10217
|
+
// Outside the class because it's used to generate component selectors, and aot can't call statics.
|
|
10218
|
+
function StringEnumToSingleString(clazz) {
|
|
10219
|
+
let str = "";
|
|
10220
|
+
const keys = Object.keys(clazz);
|
|
10221
|
+
for (let i = 0, len = keys.length; i < len; i++) {
|
|
10222
|
+
str += clazz[keys[i]] + ", ";
|
|
10223
|
+
}
|
|
10224
|
+
str = StringUtils.RemoveLastChars(str, 2);
|
|
10225
|
+
return str;
|
|
10226
|
+
}
|
|
10227
|
+
|
|
10228
|
+
/**
|
|
10229
|
+
* Custom component for enabling and disabling multiple items based on an input enum
|
|
10230
|
+
* For the component to work, an enum is required and a list of enabled items so that
|
|
10231
|
+
* the component knows which items from the enum are already enabled
|
|
10232
|
+
*
|
|
10233
|
+
* Note: can be improved by not only accepting a string array of enabledItemProperties but also a full cgref number because that will save one conversion step as
|
|
10234
|
+
* BO's already contain these numbers.
|
|
10235
|
+
*/
|
|
10236
|
+
class MultiplePropertyTogglerComponent {
|
|
10237
|
+
constructor() {
|
|
10238
|
+
this.label = "";
|
|
10239
|
+
this.readonly = false;
|
|
10240
|
+
this.enableditemsChange = new EventEmitter();
|
|
10241
|
+
// Outputs the sum of cgrefkeys of all newly enabled items
|
|
10242
|
+
this.onPropertyItemChange = new EventEmitter();
|
|
10243
|
+
this.Icons = Icon;
|
|
10244
|
+
this.objectifiedEnum = [];
|
|
10245
|
+
this.enabledItemNumberList = [];
|
|
10246
|
+
}
|
|
10247
|
+
showClass() {
|
|
10248
|
+
return true;
|
|
10249
|
+
}
|
|
10250
|
+
ngAfterViewInit() {
|
|
10251
|
+
if (this.propertyNamesToToggle) {
|
|
10252
|
+
this.objectifiedEnum = EnumUtils.createObjectFromEnum(this.propertyNamesToToggle);
|
|
10253
|
+
}
|
|
10254
|
+
else {
|
|
10255
|
+
// PropertytogglerItems is empty
|
|
10256
|
+
}
|
|
10257
|
+
this.makeNumberArrayFromCgRefCodeSum();
|
|
10258
|
+
}
|
|
10259
|
+
isValueActive(propertyToCheck) {
|
|
10260
|
+
return this.enabledItemNumberList.includes(propertyToCheck.key);
|
|
10261
|
+
}
|
|
10262
|
+
clickToToggleProperty(target) {
|
|
10263
|
+
let newRefNumberSum = 0;
|
|
10264
|
+
if (this.enabledItemNumberList.includes(target.key)) {
|
|
10265
|
+
this.enabledItemNumberList.splice(this.enabledItemNumberList.indexOf(target.key), 1);
|
|
10266
|
+
}
|
|
10267
|
+
else {
|
|
10268
|
+
this.enabledItemNumberList.push(target.key);
|
|
10269
|
+
}
|
|
10270
|
+
this.enabledItemNumberList.forEach(enabledItem => {
|
|
10271
|
+
newRefNumberSum += this.objectifiedEnum.find(x => x.key === enabledItem).key;
|
|
10272
|
+
});
|
|
10273
|
+
this.onPropertyItemChange.emit(newRefNumberSum);
|
|
10274
|
+
}
|
|
10275
|
+
makeNumberArrayFromCgRefCodeSum() {
|
|
10276
|
+
if (this.enableditems) {
|
|
10277
|
+
this.enabledItemNumberList = RefCodeUtils.GetMultiRefCodeChoices(this.enableditems);
|
|
10278
|
+
}
|
|
10279
|
+
}
|
|
10280
|
+
}
|
|
10281
|
+
MultiplePropertyTogglerComponent.decorators = [
|
|
10282
|
+
{ type: Component, args: [{
|
|
10283
|
+
selector: "co-multiple-property-toggler",
|
|
10284
|
+
template: `
|
|
10285
|
+
<div class="input-text-content-wrapper">
|
|
10286
|
+
<h3 [textContent]="label"></h3> <!-- | localize-->
|
|
10287
|
+
|
|
10288
|
+
<div class="property-toggling-container">
|
|
10289
|
+
|
|
10290
|
+
<div class="row" *ngFor="let propertyTogglerItem of objectifiedEnum | keyvalue">
|
|
10291
|
+
|
|
10292
|
+
<co-input-checkbox [model]="isValueActive(propertyTogglerItem.value)"
|
|
10293
|
+
(click)="clickToToggleProperty(propertyTogglerItem.value)"></co-input-checkbox>
|
|
10294
|
+
|
|
10295
|
+
<label [textContent]="propertyTogglerItem.value.value"></label>
|
|
10296
|
+
</div>
|
|
10297
|
+
</div>
|
|
10298
|
+
</div>
|
|
10299
|
+
`,
|
|
10300
|
+
encapsulation: ViewEncapsulation.None
|
|
10301
|
+
},] }
|
|
10302
|
+
];
|
|
10303
|
+
MultiplePropertyTogglerComponent.propDecorators = {
|
|
10304
|
+
label: [{ type: Input }],
|
|
10305
|
+
propertyNamesToToggle: [{ type: Input }],
|
|
10306
|
+
readonly: [{ type: Input }],
|
|
10307
|
+
enableditems: [{ type: Input }],
|
|
10308
|
+
enableditemsChange: [{ type: Output }],
|
|
10309
|
+
onPropertyItemChange: [{ type: Output }],
|
|
10310
|
+
showClass: [{ type: HostBinding, args: ["class.co-multiple-property-toggler",] }]
|
|
10311
|
+
};
|
|
10312
|
+
|
|
10313
|
+
class MultiplePropertyTogglerModule {
|
|
10314
|
+
}
|
|
10315
|
+
MultiplePropertyTogglerModule.decorators = [
|
|
10316
|
+
{ type: NgModule, args: [{
|
|
10317
|
+
imports: [
|
|
10318
|
+
InputCheckboxModule,
|
|
10319
|
+
CommonModule
|
|
10320
|
+
],
|
|
10321
|
+
declarations: [
|
|
10322
|
+
MultiplePropertyTogglerComponent
|
|
10323
|
+
],
|
|
10324
|
+
exports: [
|
|
10325
|
+
MultiplePropertyTogglerComponent
|
|
10326
|
+
]
|
|
10327
|
+
},] }
|
|
10328
|
+
];
|
|
10329
|
+
|
|
10330
|
+
class FileUploadPopupModule {
|
|
10331
|
+
}
|
|
10332
|
+
FileUploadPopupModule.decorators = [
|
|
10333
|
+
{ type: NgModule, args: [{
|
|
10334
|
+
imports: [
|
|
10335
|
+
CoDialogModule,
|
|
10336
|
+
FormModule,
|
|
10337
|
+
LocalizationModule,
|
|
10338
|
+
InputTextModule,
|
|
10339
|
+
ButtonModule,
|
|
10340
|
+
CommonModule,
|
|
10341
|
+
ScreenConfigurationModule,
|
|
10342
|
+
MultiplePropertyTogglerModule
|
|
10343
|
+
],
|
|
10344
|
+
declarations: [
|
|
10345
|
+
FileUploadPopupComponent
|
|
10346
|
+
],
|
|
10347
|
+
exports: [
|
|
10348
|
+
FileUploadPopupComponent
|
|
10349
|
+
],
|
|
10350
|
+
providers: []
|
|
10351
|
+
},] }
|
|
10352
|
+
];
|
|
10353
|
+
|
|
10354
|
+
class AppFileDropzoneModule {
|
|
10355
|
+
}
|
|
10356
|
+
AppFileDropzoneModule.decorators = [
|
|
10357
|
+
{ type: NgModule, args: [{
|
|
10358
|
+
imports: [
|
|
10359
|
+
IconModule,
|
|
10360
|
+
],
|
|
10361
|
+
declarations: [
|
|
10362
|
+
AppFileDropzoneComponent
|
|
10363
|
+
],
|
|
10364
|
+
exports: [
|
|
10365
|
+
AppFileDropzoneComponent
|
|
10366
|
+
],
|
|
10367
|
+
providers: []
|
|
10368
|
+
},] }
|
|
10369
|
+
];
|
|
10370
|
+
|
|
10371
|
+
class FilesUploadModule {
|
|
10372
|
+
}
|
|
10373
|
+
FilesUploadModule.decorators = [
|
|
10374
|
+
{ type: NgModule, args: [{
|
|
10375
|
+
imports: [
|
|
10376
|
+
CoDialogModule,
|
|
10377
|
+
FormModule,
|
|
10378
|
+
InputTextModule,
|
|
10379
|
+
ScreenConfigurationModule,
|
|
10380
|
+
ButtonModule,
|
|
10381
|
+
LocalizationModule,
|
|
10382
|
+
IconModule,
|
|
10383
|
+
ImageDisplayModule,
|
|
10384
|
+
CommonModule,
|
|
10385
|
+
// TagsModule,
|
|
10386
|
+
InputCheckboxModule,
|
|
10387
|
+
FileUploadModule,
|
|
10388
|
+
FileUploadPopupModule,
|
|
10389
|
+
AppFileDropzoneModule
|
|
10390
|
+
],
|
|
10391
|
+
declarations: [
|
|
10392
|
+
FilesUploadComponent,
|
|
10393
|
+
DragDropContainerComponent
|
|
10394
|
+
],
|
|
10395
|
+
exports: [
|
|
10396
|
+
FilesUploadComponent,
|
|
10397
|
+
DragDropContainerComponent
|
|
10398
|
+
],
|
|
10399
|
+
providers: [
|
|
10400
|
+
Overlay,
|
|
10401
|
+
FileTypeImagePipe
|
|
10402
|
+
]
|
|
10403
|
+
},] }
|
|
10404
|
+
];
|
|
10405
|
+
|
|
10406
|
+
class ActivityListComponent {
|
|
10407
|
+
constructor(iconCacheService, _dictionaryService) {
|
|
10408
|
+
this.iconCacheService = iconCacheService;
|
|
10409
|
+
this._dictionaryService = _dictionaryService;
|
|
10410
|
+
this.Icon = Icon;
|
|
10411
|
+
this.RelationKind = RelationKind;
|
|
10412
|
+
this.ActivityType = ActivityType;
|
|
10413
|
+
this.TimeUtils = TimeUtils;
|
|
10414
|
+
this.activities = [];
|
|
10415
|
+
this.remarkIcon = Icon.CommentRegular;
|
|
10416
|
+
this.workIcon = Icon.PersonDiggingRegular;
|
|
10417
|
+
}
|
|
10418
|
+
showClass() {
|
|
10419
|
+
return true;
|
|
10420
|
+
}
|
|
10421
|
+
ngOnInit() {
|
|
10422
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10423
|
+
});
|
|
10424
|
+
}
|
|
10425
|
+
getRelationKind(author) {
|
|
10426
|
+
if (author) {
|
|
10427
|
+
return author.relationType;
|
|
10428
|
+
}
|
|
10429
|
+
else {
|
|
10430
|
+
return null;
|
|
10431
|
+
}
|
|
10432
|
+
}
|
|
10433
|
+
getDateString(date) {
|
|
10434
|
+
return date.getDay().toString() + ' ' + (this._dictionaryService.get(ALL_MONTHS[date.getMonth()])) + ' ' + date.getFullYear();
|
|
10435
|
+
}
|
|
10436
|
+
getActivityIcon(activity) {
|
|
10437
|
+
switch (activity.activityType) {
|
|
10438
|
+
case ActivityType.Remark:
|
|
10439
|
+
return this.remarkIcon;
|
|
10440
|
+
case ActivityType.StateChange:
|
|
10441
|
+
case ActivityType.WorkflowStatus:
|
|
10442
|
+
case ActivityType.Work:
|
|
10443
|
+
case ActivityType.Task:
|
|
10444
|
+
case ActivityType.WorkflowTask:
|
|
10445
|
+
case ActivityType.Form:
|
|
10446
|
+
return this.workIcon;
|
|
10447
|
+
}
|
|
10448
|
+
}
|
|
10449
|
+
showAttachments(activity) {
|
|
10450
|
+
if (activity.documents && activity.documents.length > 0) {
|
|
10451
|
+
return true;
|
|
10452
|
+
}
|
|
10453
|
+
return false;
|
|
10454
|
+
}
|
|
10455
|
+
showWorkedTime(activity) {
|
|
10456
|
+
if ((activity.IsWork && activity.work && activity.work.workedTime) ||
|
|
10457
|
+
(activity.IsTask && activity.task && activity.task.workedTime)) {
|
|
10458
|
+
return true;
|
|
10459
|
+
}
|
|
10460
|
+
return false;
|
|
10461
|
+
}
|
|
10462
|
+
getWorkedTime(activity) {
|
|
10463
|
+
if (activity.IsWork && activity.work && activity.work.workedTime) {
|
|
10464
|
+
return activity.work.workedTime;
|
|
10465
|
+
}
|
|
10466
|
+
else if (activity.IsTask && activity.task && activity.task.workedTime) {
|
|
10467
|
+
return activity.task.workedTime;
|
|
10468
|
+
}
|
|
10469
|
+
return 0;
|
|
10470
|
+
}
|
|
10471
|
+
openActivityPopup(activity) {
|
|
10472
|
+
this.showActivityPopup = true;
|
|
10473
|
+
this.currentActivityDocuments = activity.documents;
|
|
10474
|
+
}
|
|
10475
|
+
}
|
|
10476
|
+
ActivityListComponent.decorators = [
|
|
10477
|
+
{ type: Component, args: [{
|
|
10478
|
+
selector: "co-activity-list",
|
|
10479
|
+
template: `
|
|
10480
|
+
<div class="activity-list-wrapper">
|
|
10481
|
+
<div class="activity-wrapper" [class.customer-reply-wrapper]="(getRelationKind(activity.author) === RelationKind.Customer)" *ngFor="let activity of activities" >
|
|
10482
|
+
<div class="activity-display">
|
|
10483
|
+
<div class="activity-display-title">
|
|
10484
|
+
<span>{{activity.author ? ( activity.author.initials + ' ' + activity.author.familyName) : " "}}</span>
|
|
10485
|
+
<span>{{getDateString(activity.lastActionDateTime)}}</span>
|
|
10486
|
+
<co-icon [iconData]="iconCacheService.getIcon(getActivityIcon(activity))"></co-icon>
|
|
10487
|
+
</div>
|
|
10488
|
+
<div class="activity-display-content" [class.customer-reply-content]="(getRelationKind(activity.author) === RelationKind.Customer)">
|
|
10489
|
+
<div class="activity-display-body">
|
|
10490
|
+
<span>{{activity.subDescription}}</span>
|
|
10491
|
+
</div>
|
|
10492
|
+
<div class="activity-display-footer">
|
|
10493
|
+
<!--TODO discuss with Rob is we can gather the info needed to see which workflow triggers have previously been activated for this trigger-->
|
|
10494
|
+
<!--<div *ngIf="showState(activity)" class="activity-state">
|
|
10495
|
+
<span *ngIf="showAttachments(activity)">{{activity.documents.length}}</span>
|
|
10496
|
+
</div>-->
|
|
10497
|
+
<co-icon *ngIf="showAttachments(activity)" [iconData]="iconCacheService.getIcon(Icon.PaperclipRegular)" (click)="openActivityPopup(activity)"></co-icon>
|
|
10498
|
+
<span *ngIf="showAttachments(activity)">{{activity.documents.length}}</span>
|
|
10499
|
+
<co-icon *ngIf="showWorkedTime(activity)"
|
|
10500
|
+
[iconData]="iconCacheService.getIcon(Icon.ClockRegular)"></co-icon>
|
|
10501
|
+
<span *ngIf="showWorkedTime(activity)" >
|
|
10502
|
+
{{TimeUtils.ConvertToDuration(getWorkedTime(activity))}}</span>
|
|
10503
|
+
</div>
|
|
10504
|
+
</div>
|
|
10505
|
+
</div>
|
|
10506
|
+
</div>
|
|
10507
|
+
</div>
|
|
10508
|
+
<co-dialog *ngIf="showActivityPopup" (closeClick)="showActivityPopup = false">
|
|
10509
|
+
<co-files-upload [documents]="currentActivityDocuments">
|
|
10510
|
+
</co-files-upload>
|
|
10511
|
+
</co-dialog>
|
|
10512
|
+
`,
|
|
10513
|
+
encapsulation: ViewEncapsulation.None
|
|
10514
|
+
},] }
|
|
10515
|
+
];
|
|
10516
|
+
ActivityListComponent.ctorParameters = () => [
|
|
10517
|
+
{ type: IconCacheService },
|
|
10518
|
+
{ type: DictionaryService }
|
|
10519
|
+
];
|
|
10520
|
+
ActivityListComponent.propDecorators = {
|
|
10521
|
+
showClass: [{ type: HostBinding, args: ["class.co-activity-list",] }],
|
|
10522
|
+
activities: [{ type: Input }],
|
|
10523
|
+
remarkIcon: [{ type: Input }],
|
|
10524
|
+
workIcon: [{ type: Input }]
|
|
10525
|
+
};
|
|
10526
|
+
|
|
10527
|
+
class ActivityListModule {
|
|
10528
|
+
}
|
|
10529
|
+
ActivityListModule.decorators = [
|
|
10530
|
+
{ type: NgModule, args: [{
|
|
10531
|
+
imports: [
|
|
10532
|
+
IconModule,
|
|
10533
|
+
CommonModule,
|
|
10534
|
+
CoDialogModule,
|
|
10535
|
+
FilesUploadModule
|
|
10536
|
+
],
|
|
10537
|
+
declarations: [
|
|
10538
|
+
ActivityListComponent
|
|
10539
|
+
],
|
|
10540
|
+
exports: [
|
|
10541
|
+
ActivityListComponent
|
|
10542
|
+
]
|
|
10543
|
+
},] }
|
|
10544
|
+
];
|
|
10545
|
+
|
|
7024
10546
|
/*
|
|
7025
10547
|
* Public API Surface of sharedcomponents
|
|
7026
10548
|
*/
|
|
@@ -7029,5 +10551,5 @@ SimpleTagsModule.decorators = [
|
|
|
7029
10551
|
* Generated bundle index. Do not edit.
|
|
7030
10552
|
*/
|
|
7031
10553
|
|
|
7032
|
-
export { AgendaEvent, AgendaEventPerDay, CalendarView, CoLinearGaugeComponent, CoLinearGaugeModule, DatePlanningComponent, DatePlanningModule, DocsignComponent, DocsignModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, SendMethodDialogComponent, SendMethodDialogModule, SharedService, SimpleTagsComponent, SimpleTagsModule, StatusbarComponent, StatusbarModule, StockComponent, StockModule, Translation, sendMethodsWithIcon, SignatureComponent as ɵa, SignaturesComponent as ɵb, LocalizationModule as ɵba, LocalizePipe as ɵbb, StockInformationComponent as ɵbc, StockInformationGridComponent as ɵbd, StockTransferComponent as ɵbe, StockChangeAmountComponent as ɵbf, StockTabComponent as ɵbg, OrderTabComponent as ɵbh, StockTabsComponent as ɵbi, StockHistoryTabsComponent as ɵbj, OrderStockTabComponent as ɵbk, StockLocationComponent as ɵbl, StockHistoryComponent as ɵbm, OrderSupplyStockHistoryComponent as ɵbn, OrderCommissionStockHistoryComponent as ɵbo, OrderStockHistoryComponent as ɵbp, AllocationStockHistoryComponent as ɵbq, StockPrognoseComponent as ɵbr, SendMethod as ɵbs, Icon as ɵbt, CalendarAllYearsComponent as ɵbu, CalendarAllMonthsComponent as ɵbv, CalendarHeaderComponent as ɵbw, CalendarComponent as ɵbx, CalendarViewComponent as ɵby, LanguageCode as ɵbz, StockService as ɵc, AgendaHeaderComponent as ɵca, AgendaViewComponent as ɵcb, AgendaMonthViewComponent as ɵcc, AgendaBaseViewComponent as ɵcd, AgendaDayViewComponent as ɵce, AgendaWeekViewComponent as ɵcf, AgendaWeekSelectViewComponent as ɵcg, AgendaHourViewComponent as ɵch, AgendaHourCellComponent as ɵci, AgendaHourViewLabelsComponent as ɵcj, AgendaHalfHourCellComponent as ɵck, AgendaEventsComponent as ɵcl, AgendaEventComponent as ɵcm, ViewSelectComponent as ɵcn, AgendaSelectEventComponent as ɵco, MASTER_PIPES as ɵcp, ArrayNumberPipe as ɵcq, UCfirstPipe as ɵcr, SharedConnectorService as ɵd, OptionsService as ɵe, DictionaryService as ɵf, LocalizeService as ɵg, IconCacheService as ɵh, SendMethodService as ɵi, SendMethodEmailModule as ɵj, LayoutSelectionModule as ɵk, LayoutSelectionComponent as ɵl, SignatureButtonModule as ɵm, SignatureButtonComponent as ɵn, SendMethodEmailComponent as ɵo, SendMethodPrinterModule as ɵp, PrinterSelectionModule as ɵq, PrinterSelectionComponent as ɵr, SendMethodPrinterComponent as ɵs, SendMethodPdfModule as ɵt, SendMethodPdfComponent as ɵu, TabBarModule as ɵv, TabBarComponent as ɵw, StatusbarPopupComponent as ɵx, StockStatusbarModule as ɵy, StockStatusbarComponent as ɵz };
|
|
10554
|
+
export { ActivityListComponent, ActivityListModule, AgendaEvent, AgendaEventPerDay, CalendarView, CoLinearGaugeComponent, CoLinearGaugeModule, DatePlanningComponent, DatePlanningModule, DocsignComponent, DocsignModule, FilesUploadComponent, FilesUploadModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, SendMethodDialogComponent, SendMethodDialogModule, SharedService, SimpleTagsComponent, SimpleTagsModule, StatusbarComponent, StatusbarModule, StockComponent, StockModule, Translation, sendMethodsWithIcon, SignatureComponent as ɵa, SignaturesComponent as ɵb, LocalizationModule as ɵba, LocalizePipe as ɵbb, StockInformationComponent as ɵbc, StockInformationGridComponent as ɵbd, StockTransferComponent as ɵbe, StockChangeAmountComponent as ɵbf, StockTabComponent as ɵbg, OrderTabComponent as ɵbh, StockTabsComponent as ɵbi, StockHistoryTabsComponent as ɵbj, OrderStockTabComponent as ɵbk, StockLocationComponent as ɵbl, StockHistoryComponent as ɵbm, OrderSupplyStockHistoryComponent as ɵbn, OrderCommissionStockHistoryComponent as ɵbo, OrderStockHistoryComponent as ɵbp, AllocationStockHistoryComponent as ɵbq, StockPrognoseComponent as ɵbr, SendMethod as ɵbs, Icon as ɵbt, CalendarAllYearsComponent as ɵbu, CalendarAllMonthsComponent as ɵbv, CalendarHeaderComponent as ɵbw, CalendarComponent as ɵbx, CalendarViewComponent as ɵby, LanguageCode as ɵbz, StockService as ɵc, AgendaHeaderComponent as ɵca, AgendaViewComponent as ɵcb, AgendaMonthViewComponent as ɵcc, AgendaBaseViewComponent as ɵcd, AgendaDayViewComponent as ɵce, AgendaWeekViewComponent as ɵcf, AgendaWeekSelectViewComponent as ɵcg, AgendaHourViewComponent as ɵch, AgendaHourCellComponent as ɵci, AgendaHourViewLabelsComponent as ɵcj, AgendaHalfHourCellComponent as ɵck, AgendaEventsComponent as ɵcl, AgendaEventComponent as ɵcm, ViewSelectComponent as ɵcn, AgendaSelectEventComponent as ɵco, MASTER_PIPES as ɵcp, ArrayNumberPipe as ɵcq, UCfirstPipe as ɵcr, FileTypeImagePipe as ɵcs, BaseFileUploadComponent as ɵct, InputBoolean as ɵcu, ImageDisplayModule as ɵcv, ImageDisplayComponent as ɵcw, FileUploadModule as ɵcx, TileRenderModule as ɵcy, TileRenderComponent as ɵcz, SharedConnectorService as ɵd, FileUploadComponent as ɵda, FileUploadPopupModule as ɵdb, MultiplePropertyTogglerModule as ɵdc, MultiplePropertyTogglerComponent as ɵdd, FileUploadPopupComponent as ɵde, AppFileDropzoneModule as ɵdf, AppFileDropzoneComponent as ɵdg, DragDropContainerComponent as ɵdh, DragDropService as ɵdi, OptionsService as ɵe, DictionaryService as ɵf, LocalizeService as ɵg, IconCacheService as ɵh, SendMethodService as ɵi, SendMethodEmailModule as ɵj, LayoutSelectionModule as ɵk, LayoutSelectionComponent as ɵl, SignatureButtonModule as ɵm, SignatureButtonComponent as ɵn, SendMethodEmailComponent as ɵo, SendMethodPrinterModule as ɵp, PrinterSelectionModule as ɵq, PrinterSelectionComponent as ɵr, SendMethodPrinterComponent as ɵs, SendMethodPdfModule as ɵt, SendMethodPdfComponent as ɵu, TabBarModule as ɵv, TabBarComponent as ɵw, StatusbarPopupComponent as ɵx, StockStatusbarModule as ɵy, StockStatusbarComponent as ɵz };
|
|
7033
10555
|
//# sourceMappingURL=colijnit-sharedcomponents.js.map
|