@colijnit/sharedcomponents 1.0.27 → 1.0.29
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 +2714 -73
- package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
- package/colijnit-sharedcomponents.d.ts +24 -0
- package/colijnit-sharedcomponents.metadata.json +1 -1
- package/esm2015/colijnit-sharedcomponents.js +25 -1
- package/esm2015/lib/components/circular-gauge/co-circular-gauge.component.js +6 -5
- package/esm2015/lib/components/date-planning/component/agenda/agenda-base-view.component.js +61 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-day-view.component.js +32 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-event.component.js +54 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-events.component.js +43 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-half-hour-cell.component.js +68 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-header.component.js +232 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-hour-cell.component.js +36 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-hour-view-labels.component.js +50 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-hour-view.component.js +46 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-month-view.component.js +61 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-select-event.component.js +39 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-view.component.js +35 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-week-select-view.component.js +64 -0
- package/esm2015/lib/components/date-planning/component/agenda/agenda-week-view.component.js +48 -0
- package/esm2015/lib/components/date-planning/component/agenda/view-select.component.js +42 -0
- package/esm2015/lib/components/date-planning/component/calendar/calendar-all-months.component.js +34 -0
- package/esm2015/lib/components/date-planning/component/calendar/calendar-all-years.component.js +48 -0
- package/esm2015/lib/components/date-planning/component/calendar/calendar-header.component.js +107 -0
- package/esm2015/lib/components/date-planning/component/calendar/calendar-view.component.js +178 -0
- package/esm2015/lib/components/date-planning/component/calendar/calendar.component.js +34 -0
- package/esm2015/lib/components/date-planning/date-planning.component.js +106 -0
- package/esm2015/lib/components/date-planning/date-planning.module.js +63 -0
- package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +83 -54
- package/esm2015/lib/components/send-method-dialog/send-method-dialog.module.js +6 -3
- package/esm2015/lib/components/send-method-dialog/send-method-params.interface.js +2 -0
- package/esm2015/lib/components/statusbar/statusbar.component.js +4 -2
- package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +7 -4
- package/esm2015/lib/enum/calendar-view.enum.js +8 -0
- package/esm2015/lib/enum/icon.enum.js +6 -1
- package/esm2015/lib/enum/month.enum.js +17 -0
- package/esm2015/lib/enum/thumb-three-way-state.js +19 -0
- package/esm2015/lib/enum/time-period.enum.js +11 -0
- package/esm2015/lib/model/agenda-event-per-day.model.js +6 -0
- package/esm2015/lib/model/agenda-event.model.js +8 -0
- package/esm2015/lib/model/agenda-null-objects.js +11 -0
- package/esm2015/lib/model/constant/all-months.js +17 -0
- package/esm2015/lib/model/date-range.js +5 -0
- package/esm2015/lib/model/day.model.js +7 -0
- package/esm2015/lib/model/icon-svg.js +6 -1
- package/esm2015/lib/model/month.model.js +11 -0
- package/esm2015/lib/model/time-window.bo.js +26 -0
- package/esm2015/lib/model/week.model.js +6 -0
- package/esm2015/lib/model/weekday.model.js +10 -0
- package/esm2015/lib/pipe/array-number.pipe.js +15 -0
- package/esm2015/lib/pipe/master-pipes.js +7 -0
- package/esm2015/lib/pipe/ucfirst.pipe.js +16 -0
- package/esm2015/lib/service/shared-connector.service.js +49 -1
- package/esm2015/lib/service/stock.service.js +16 -5
- package/esm2015/lib/utils/array-utils.js +24 -5
- package/esm2015/lib/utils/calendar.utils.js +69 -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/date-utils.js +264 -0
- package/esm2015/lib/utils/function/not-nill.function.js +5 -0
- package/esm2015/lib/utils/map-utils.js +41 -0
- package/esm2015/lib/utils/number-utils.js +390 -0
- package/esm2015/lib/utils/object-utils.js +278 -0
- package/esm2015/public-api.js +3 -1
- package/fesm2015/colijnit-sharedcomponents.js +2794 -99
- package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
- package/lib/components/circular-gauge/style/_layout.scss +3 -6
- package/lib/components/date-planning/component/agenda/agenda-base-view.component.d.ts +21 -0
- package/lib/components/date-planning/component/agenda/agenda-day-view.component.d.ts +6 -0
- package/lib/components/date-planning/component/agenda/agenda-event.component.d.ts +17 -0
- package/lib/components/date-planning/component/agenda/agenda-events.component.d.ts +12 -0
- package/lib/components/date-planning/component/agenda/agenda-half-hour-cell.component.d.ts +18 -0
- package/lib/components/date-planning/component/agenda/agenda-header.component.d.ts +47 -0
- package/lib/components/date-planning/component/agenda/agenda-hour-cell.component.d.ts +9 -0
- package/lib/components/date-planning/component/agenda/agenda-hour-view-labels.component.d.ts +8 -0
- package/lib/components/date-planning/component/agenda/agenda-hour-view.component.d.ts +7 -0
- package/lib/components/date-planning/component/agenda/agenda-month-view.component.d.ts +10 -0
- package/lib/components/date-planning/component/agenda/agenda-select-event.component.d.ts +12 -0
- package/lib/components/date-planning/component/agenda/agenda-view.component.d.ts +11 -0
- package/lib/components/date-planning/component/agenda/agenda-week-select-view.component.d.ts +10 -0
- package/lib/components/date-planning/component/agenda/agenda-week-view.component.d.ts +8 -0
- package/lib/components/date-planning/component/agenda/view-select.component.d.ts +11 -0
- package/lib/components/date-planning/component/calendar/calendar-all-months.component.d.ts +9 -0
- package/lib/components/date-planning/component/calendar/calendar-all-years.component.d.ts +9 -0
- package/lib/components/date-planning/component/calendar/calendar-header.component.d.ts +23 -0
- package/lib/components/date-planning/component/calendar/calendar-view.component.d.ts +31 -0
- package/lib/components/date-planning/component/calendar/calendar.component.d.ts +10 -0
- package/lib/components/date-planning/date-planning.component.d.ts +25 -0
- package/lib/components/date-planning/date-planning.module.d.ts +2 -0
- package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +24 -7
- package/lib/components/send-method-dialog/send-method-params.interface.d.ts +13 -0
- package/lib/components/send-method-dialog/style/_layout.scss +5 -0
- package/lib/components/statusbar/statusbar.component.d.ts +2 -0
- package/lib/components/statusbar/style/_layout.scss +11 -0
- package/lib/components/tags/component/style/_layout.scss +67 -0
- package/lib/components/tags/component/style/_material-definition.scss +1 -0
- package/lib/components/tags/component/style/_theme.scss +8 -0
- package/lib/components/tags/component/style/material.scss +3 -0
- package/lib/components/tags/component/tag-join-label/style/_layout.scss +97 -0
- package/lib/components/tags/component/tag-join-label/style/_material-definition.scss +4 -0
- package/lib/components/tags/component/tag-join-label/style/_theme.scss +8 -0
- package/lib/components/tags/component/tag-join-label/style/material.scss +3 -0
- package/lib/enum/calendar-view.enum.d.ts +6 -0
- package/lib/enum/icon.enum.d.ts +5 -0
- package/lib/enum/month.enum.d.ts +14 -0
- package/lib/enum/thumb-three-way-state.d.ts +6 -0
- package/lib/enum/time-period.enum.d.ts +8 -0
- package/lib/model/agenda-event-per-day.model.d.ts +5 -0
- package/lib/model/agenda-event.model.d.ts +16 -0
- package/lib/model/agenda-null-objects.d.ts +10 -0
- package/lib/model/constant/all-months.d.ts +2 -0
- package/lib/model/date-range.d.ts +7 -0
- package/lib/model/day.model.d.ts +8 -0
- package/lib/model/month.model.d.ts +5 -0
- package/lib/model/time-window.bo.d.ts +13 -0
- package/lib/model/week.model.d.ts +4 -0
- package/lib/model/weekday.model.d.ts +16 -0
- package/lib/pipe/array-number.pipe.d.ts +4 -0
- package/lib/pipe/master-pipes.d.ts +1 -0
- package/lib/pipe/ucfirst.pipe.d.ts +4 -0
- package/lib/service/shared-connector.service.d.ts +4 -0
- package/lib/service/stock.service.d.ts +6 -2
- package/lib/style/_mixin.scss +5 -0
- package/lib/utils/array-utils.d.ts +6 -0
- package/lib/utils/calendar.utils.d.ts +10 -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/date-utils.d.ts +44 -0
- package/lib/utils/function/not-nill.function.d.ts +1 -0
- package/lib/utils/map-utils.d.ts +16 -0
- package/lib/utils/number-utils.d.ts +125 -0
- package/lib/utils/object-utils.d.ts +40 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('pdf-lib'), require('pdfjs-dist/legacy/build/pdf'), require('pdfjs-dist/build/pdf.worker.entry'), require('@angular/common'), require('signature_pad'), require('@colijnit/
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@colijnit/sharedcomponents', ['exports', '@angular/core', '@angular/animations', 'pdf-lib', 'pdfjs-dist/legacy/build/pdf', 'pdfjs-dist/build/pdf.worker.entry', '@angular/common', 'signature_pad', '@colijnit/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.sharedcomponents = {}), global.ng.core, global.ng.animations, global.pdfLib, global.PDFJS, global.pdfjsWorker, global.ng.common, global.SignaturePad, global.
|
|
5
|
-
})(this, (function (exports, i0, animations, pdfLib, PDFJS, pdfjsWorker, common, SignaturePad,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/animations'), require('pdf-lib'), require('pdfjs-dist/legacy/build/pdf'), require('pdfjs-dist/build/pdf.worker.entry'), require('@angular/common'), require('signature_pad'), require('@colijnit/articleapi/build/articles'), require('@colijnit/sharedapi/build/sharedapi'), require('@colijnit/sharedapi/build/model/report/printer.bo'), require('@colijnit/articleapi/build/utils/function/not-nill.function'), require('@colijnit/articleapi/build/utils/object-utils'), require('@colijnit/articleapi/build/enum/yes-no-db-type.enum'), require('@colijnit/articleapi/build/enum/true-false-db-type.enum'), require('@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum'), require('@colijnit/articleapi/build/enum/db-boolean-value-type.enum'), require('@colijnit/articleapi/build/utils/date-utils'), require('@colijnit/articleapi/build/utils/number-utils'), require('@colijnit/articleapi/build/factory/decorators/map-property.decorator'), require('@colijnit/articleapi/build/factory/decorators/boolean.decorator'), require('@colijnit/articleapi/build/factory/decorators/json.decorator'), require('@colijnit/articleapi/build/factory/decorators/complex-array.decorator'), require('@colijnit/sharedapi/build/model/print-stock-stickers'), require('@colijnit/articleapi/build/model/article-stock.bo'), require('@colijnit/articleapi/build/model/stock-history.bo'), require('@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo'), require('@colijnit/articleapi/build/model/article-details.bo'), require('@colijnit/articleapi/build/model/stock-status.bo'), require('@colijnit/articleapi/build/model/stock-management-warehouses.bo'), require('@colijnit/articleapi/build/model/stock-location.bo'), require('@colijnit/articleapi/build/model/article-transaction.bo'), require('rxjs'), require('@colijnit/sharedapi/build/model/print-price-stickers.bo'), require('@colijnit/articleapi/build/model/get-stock-history-request'), require('@colijnit/articleapi/build/model/article-stock'), require('@colijnit/corecomponents_v12'), require('@angular/platform-browser'), require('@colijnit/articleapi/build/model/article-stock-management'), require('@colijnit/articleapi/build/model/article-transaction'), require('@syncfusion/ej2-angular-circulargauge'), require('moment')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@colijnit/sharedcomponents', ['exports', '@angular/core', '@angular/animations', 'pdf-lib', 'pdfjs-dist/legacy/build/pdf', 'pdfjs-dist/build/pdf.worker.entry', '@angular/common', 'signature_pad', '@colijnit/articleapi/build/articles', '@colijnit/sharedapi/build/sharedapi', '@colijnit/sharedapi/build/model/report/printer.bo', '@colijnit/articleapi/build/utils/function/not-nill.function', '@colijnit/articleapi/build/utils/object-utils', '@colijnit/articleapi/build/enum/yes-no-db-type.enum', '@colijnit/articleapi/build/enum/true-false-db-type.enum', '@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum', '@colijnit/articleapi/build/enum/db-boolean-value-type.enum', '@colijnit/articleapi/build/utils/date-utils', '@colijnit/articleapi/build/utils/number-utils', '@colijnit/articleapi/build/factory/decorators/map-property.decorator', '@colijnit/articleapi/build/factory/decorators/boolean.decorator', '@colijnit/articleapi/build/factory/decorators/json.decorator', '@colijnit/articleapi/build/factory/decorators/complex-array.decorator', '@colijnit/sharedapi/build/model/print-stock-stickers', '@colijnit/articleapi/build/model/article-stock.bo', '@colijnit/articleapi/build/model/stock-history.bo', '@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo', '@colijnit/articleapi/build/model/article-details.bo', '@colijnit/articleapi/build/model/stock-status.bo', '@colijnit/articleapi/build/model/stock-management-warehouses.bo', '@colijnit/articleapi/build/model/stock-location.bo', '@colijnit/articleapi/build/model/article-transaction.bo', 'rxjs', '@colijnit/sharedapi/build/model/print-price-stickers.bo', '@colijnit/articleapi/build/model/get-stock-history-request', '@colijnit/articleapi/build/model/article-stock', '@colijnit/corecomponents_v12', '@angular/platform-browser', '@colijnit/articleapi/build/model/article-stock-management', '@colijnit/articleapi/build/model/article-transaction', '@syncfusion/ej2-angular-circulargauge', 'moment'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.colijnit = global.colijnit || {}, global.colijnit.sharedcomponents = {}), global.ng.core, global.ng.animations, global.pdfLib, global.PDFJS, global.pdfjsWorker, global.ng.common, global.SignaturePad, global.articles, global.sharedapi, global.printer_bo, global.notNill_function, global.objectUtils, global.yesNoDbType_enum, global.trueFalseDbType_enum, global.oneZeroBoolDbType_enum, global.dbBooleanValueType_enum, global.dateUtils, global.numberUtils, global.mapProperty_decorator, global.boolean_decorator, global.json_decorator, global.complexArray_decorator, global.printStockStickers, global.articleStock_bo, global.stockHistory_bo, global.stockStickersPrintLayouts_bo, global.articleDetails_bo, global.stockStatus_bo, global.stockManagementWarehouses_bo, global.stockLocation_bo, global.articleTransaction_bo, global.rxjs, global.printPriceStickers_bo, global.getStockHistoryRequest, global.articleStock, global.corecomponents_v12, global.ng.platformBrowser, global.articleStockManagement, global.articleTransaction, global.ej2AngularCirculargauge, global.moment));
|
|
5
|
+
})(this, (function (exports, i0, animations, pdfLib, PDFJS, pdfjsWorker, common, SignaturePad, articles, sharedapi, printer_bo, notNill_function, objectUtils, yesNoDbType_enum, trueFalseDbType_enum, oneZeroBoolDbType_enum, dbBooleanValueType_enum, dateUtils, numberUtils, mapProperty_decorator, boolean_decorator, json_decorator, complexArray_decorator, printStockStickers, articleStock_bo, stockHistory_bo, stockStickersPrintLayouts_bo, articleDetails_bo, stockStatus_bo, stockManagementWarehouses_bo, stockLocation_bo, articleTransaction_bo, rxjs, printPriceStickers_bo, getStockHistoryRequest, articleStock, corecomponents_v12, i1, articleStockManagement, articleTransaction, ej2AngularCirculargauge, moment) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
var pdfjsWorker__default = /*#__PURE__*/_interopDefaultLegacy(pdfjsWorker);
|
|
30
30
|
var SignaturePad__default = /*#__PURE__*/_interopDefaultLegacy(SignaturePad);
|
|
31
31
|
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
32
|
+
var moment__namespace = /*#__PURE__*/_interopNamespace(moment);
|
|
32
33
|
|
|
33
34
|
/******************************************************************************
|
|
34
35
|
Copyright (c) Microsoft Corporation.
|
|
@@ -1032,6 +1033,703 @@
|
|
|
1032
1033
|
return value === null || value === undefined;
|
|
1033
1034
|
}
|
|
1034
1035
|
|
|
1036
|
+
// @returns true iff given value does not equals null and does not equal undefined
|
|
1037
|
+
function notNill(value) {
|
|
1038
|
+
return value !== null && value !== undefined;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// Static utility function holder related to objects.
|
|
1042
|
+
var ObjectUtils = /** @class */ (function () {
|
|
1043
|
+
function ObjectUtils() {
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Returns whether all given values exist: for all values it holds that they are not null nor undefined. Short-circuit check.
|
|
1047
|
+
* @param {any} values Rest parameters with all objects to check existence for.
|
|
1048
|
+
* @returns {boolean} True if ALL given values are not null nor undefined, otherwise false (if at least one value was null or undefined)
|
|
1049
|
+
*/
|
|
1050
|
+
ObjectUtils.AllExist = function () {
|
|
1051
|
+
var values = [];
|
|
1052
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1053
|
+
values[_i] = arguments[_i];
|
|
1054
|
+
}
|
|
1055
|
+
var allExist = true;
|
|
1056
|
+
for (var i = 0, len = values.length; i < len; i++) {
|
|
1057
|
+
if (isNill(values[i])) {
|
|
1058
|
+
allExist = false;
|
|
1059
|
+
break;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
return allExist;
|
|
1063
|
+
};
|
|
1064
|
+
/**
|
|
1065
|
+
* Copies all properties from object 'from' to object 'to'. Overwrites properties on object 'to' if property already exists.
|
|
1066
|
+
* Does not copy functions, only properties.
|
|
1067
|
+
* @param {Object} from The source object from which to copy all properties of to the 'to' object.
|
|
1068
|
+
* @param {Object} to The object to which the properties of the 'from' object will be copied.
|
|
1069
|
+
* @param {boolean} [allowUndefined = true] wether the 'to' object may be assigned null or undefined values to any of its properties.
|
|
1070
|
+
*/
|
|
1071
|
+
ObjectUtils.CopyPropertiesFrom = function (from, to, allowUndefined) {
|
|
1072
|
+
if (allowUndefined === void 0) { allowUndefined = true; }
|
|
1073
|
+
if (!to) {
|
|
1074
|
+
to = {};
|
|
1075
|
+
}
|
|
1076
|
+
if (!from) {
|
|
1077
|
+
return to;
|
|
1078
|
+
}
|
|
1079
|
+
ObjectUtils.ForOwnProperty(from, function (value, key) {
|
|
1080
|
+
if (allowUndefined || notNill(value)) {
|
|
1081
|
+
to[key] = value;
|
|
1082
|
+
}
|
|
1083
|
+
});
|
|
1084
|
+
return to;
|
|
1085
|
+
};
|
|
1086
|
+
ObjectUtils.DeepEquals = function (actual, expected) {
|
|
1087
|
+
if (actual === expected) {
|
|
1088
|
+
return true;
|
|
1089
|
+
}
|
|
1090
|
+
else if (actual instanceof Date && expected instanceof Date) {
|
|
1091
|
+
return actual.getTime() === expected.getTime();
|
|
1092
|
+
}
|
|
1093
|
+
else if (!actual || !expected || typeof actual !== "object" && typeof expected !== "object") {
|
|
1094
|
+
return actual === expected;
|
|
1095
|
+
}
|
|
1096
|
+
else {
|
|
1097
|
+
return this._objEquiv(actual, expected);
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
// Performs given callback function for each own property of given plain object. Also works on string enums.
|
|
1101
|
+
ObjectUtils.ForOwnProperty = function (plainObject, callback) {
|
|
1102
|
+
if (ObjectUtils.IsPlainObject(plainObject)) {
|
|
1103
|
+
for (var key in plainObject) {
|
|
1104
|
+
if (plainObject.hasOwnProperty(key) && typeof plainObject[key] !== "function") {
|
|
1105
|
+
var response = callback(plainObject[key], key);
|
|
1106
|
+
if (response === false) {
|
|
1107
|
+
break;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1113
|
+
// Returns the class name of given argument. The argument can be an object or a class.
|
|
1114
|
+
ObjectUtils.GetClassName = function (objectOrClass) {
|
|
1115
|
+
if (!objectOrClass) {
|
|
1116
|
+
return undefined;
|
|
1117
|
+
// arg was a class (or a function..)
|
|
1118
|
+
}
|
|
1119
|
+
else if (objectOrClass.constructor === Function) {
|
|
1120
|
+
return objectOrClass.name; // .. which has its readable name stores like this
|
|
1121
|
+
// else arg was an object
|
|
1122
|
+
}
|
|
1123
|
+
else {
|
|
1124
|
+
var constructorString = objectOrClass.constructor.toString();
|
|
1125
|
+
return constructorString.match(/\w+/g)[1];
|
|
1126
|
+
}
|
|
1127
|
+
};
|
|
1128
|
+
// Returns a shallow clone of the given original object. The clone is a SIMPLE OBJECT with the same properties as the original.
|
|
1129
|
+
ObjectUtils.GetShallowClone = function (originalObject, objectClass) {
|
|
1130
|
+
var clonedObject = undefined;
|
|
1131
|
+
if (objectClass) {
|
|
1132
|
+
clonedObject = new objectClass();
|
|
1133
|
+
}
|
|
1134
|
+
else {
|
|
1135
|
+
clonedObject = {};
|
|
1136
|
+
}
|
|
1137
|
+
ObjectUtils.ForOwnProperty(originalObject, function (value, key) {
|
|
1138
|
+
clonedObject[key] = value;
|
|
1139
|
+
});
|
|
1140
|
+
return clonedObject;
|
|
1141
|
+
};
|
|
1142
|
+
ObjectUtils.GetDeepClone = function (originalObject, circular) {
|
|
1143
|
+
if (circular === void 0) { circular = true; }
|
|
1144
|
+
// First create an empty object with
|
|
1145
|
+
// same prototype of our original source
|
|
1146
|
+
var propertyIndex;
|
|
1147
|
+
var descriptor;
|
|
1148
|
+
var keys;
|
|
1149
|
+
var current;
|
|
1150
|
+
var nextSource;
|
|
1151
|
+
var indexOf;
|
|
1152
|
+
var copies = [{
|
|
1153
|
+
source: originalObject,
|
|
1154
|
+
target: Object.create(Object.getPrototypeOf(originalObject))
|
|
1155
|
+
}];
|
|
1156
|
+
var cloneObject = copies[0].target;
|
|
1157
|
+
var sourceReferences = [originalObject];
|
|
1158
|
+
var targetReferences = [cloneObject];
|
|
1159
|
+
// First in, first out
|
|
1160
|
+
while (current = copies.shift()) { //NOSONAR
|
|
1161
|
+
keys = Object.getOwnPropertyNames(current.source);
|
|
1162
|
+
for (propertyIndex = 0; propertyIndex < keys.length; propertyIndex++) {
|
|
1163
|
+
// Save the source's descriptor
|
|
1164
|
+
descriptor = Object.getOwnPropertyDescriptor(current.source, keys[propertyIndex]);
|
|
1165
|
+
if (!descriptor.value || typeof descriptor.value !== "object") {
|
|
1166
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
1167
|
+
continue;
|
|
1168
|
+
}
|
|
1169
|
+
nextSource = descriptor.value;
|
|
1170
|
+
descriptor.value = Array.isArray(nextSource) ?
|
|
1171
|
+
[] :
|
|
1172
|
+
Object.create(Object.getPrototypeOf(nextSource));
|
|
1173
|
+
if (circular) {
|
|
1174
|
+
indexOf = sourceReferences.indexOf(nextSource);
|
|
1175
|
+
if (indexOf !== -1) {
|
|
1176
|
+
// The source is already referenced, just assign reference
|
|
1177
|
+
descriptor.value = targetReferences[indexOf];
|
|
1178
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
1179
|
+
continue;
|
|
1180
|
+
}
|
|
1181
|
+
sourceReferences.push(nextSource);
|
|
1182
|
+
targetReferences.push(descriptor.value);
|
|
1183
|
+
}
|
|
1184
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
1185
|
+
copies.push({ source: nextSource, target: descriptor.value });
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
return cloneObject;
|
|
1189
|
+
};
|
|
1190
|
+
ObjectUtils.IsEmpty = function (obj) {
|
|
1191
|
+
return isNill(obj) || Object.getOwnPropertyNames(obj).length === 0;
|
|
1192
|
+
};
|
|
1193
|
+
// 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.
|
|
1194
|
+
ObjectUtils.IsPlainObject = function (object) {
|
|
1195
|
+
return object !== null && !Array.isArray(object) && typeof object !== "function" && typeof object === "object";
|
|
1196
|
+
};
|
|
1197
|
+
/**
|
|
1198
|
+
* Returns an instance of given class with data of given dataObject. Only works if that class has a default constructor without args.
|
|
1199
|
+
* Does not actually create a new object if it alread is an instance of that class.
|
|
1200
|
+
* @param {any} clazz A class that has a default constructor
|
|
1201
|
+
* @param {any} [dataObject] The object with data to copy to the new instance of the class
|
|
1202
|
+
* @returns {any} An object that is an instance of given class, with given data applied to it.
|
|
1203
|
+
*/
|
|
1204
|
+
ObjectUtils.MakeInstanceOf = function (clazz, dataObject) {
|
|
1205
|
+
// dont make a clone if given dataObject already instance of clazz
|
|
1206
|
+
if (dataObject instanceof clazz) {
|
|
1207
|
+
return dataObject;
|
|
1208
|
+
}
|
|
1209
|
+
else {
|
|
1210
|
+
var asClazz = new clazz();
|
|
1211
|
+
ObjectUtils.CopyPropertiesFrom(dataObject, asClazz);
|
|
1212
|
+
return asClazz;
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
// Returns the value of a random own property of given object.
|
|
1216
|
+
ObjectUtils.PickRandomPropertyValue = function (object) {
|
|
1217
|
+
if (!object) {
|
|
1218
|
+
return;
|
|
1219
|
+
}
|
|
1220
|
+
var result;
|
|
1221
|
+
var count = 0;
|
|
1222
|
+
for (var prop in object) {
|
|
1223
|
+
if (object.hasOwnProperty(prop)) {
|
|
1224
|
+
count++;
|
|
1225
|
+
if (Math.random() < 1 / count) {
|
|
1226
|
+
result = object[prop];
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
return result;
|
|
1231
|
+
};
|
|
1232
|
+
// Returns a default if given value doesn't exist, otherwise just value.
|
|
1233
|
+
ObjectUtils.ValueOrDefault = function (value, defaultReturnVal) {
|
|
1234
|
+
if (defaultReturnVal === void 0) { defaultReturnVal = ""; }
|
|
1235
|
+
return notNill(value) ? value : defaultReturnVal;
|
|
1236
|
+
};
|
|
1237
|
+
ObjectUtils._isArguments = function (x) {
|
|
1238
|
+
var supportsArgsClass = this._supportsArgumentsClass();
|
|
1239
|
+
return supportsArgsClass ? this._isArgumentsWhenArgsClassSupported(x) : this._isArgumentsWhenArgsClassNotSupported(x);
|
|
1240
|
+
};
|
|
1241
|
+
ObjectUtils._isArgumentsWhenArgsClassNotSupported = function (object) {
|
|
1242
|
+
return object &&
|
|
1243
|
+
typeof object === "object" &&
|
|
1244
|
+
typeof object.length === "number" &&
|
|
1245
|
+
Object.prototype.hasOwnProperty.call(object, "callee") &&
|
|
1246
|
+
!Object.prototype.propertyIsEnumerable.call(object, "callee") ||
|
|
1247
|
+
false;
|
|
1248
|
+
};
|
|
1249
|
+
ObjectUtils._isArgumentsWhenArgsClassSupported = function (object) {
|
|
1250
|
+
return Object.prototype.toString.call(object) === "[object Arguments]";
|
|
1251
|
+
};
|
|
1252
|
+
ObjectUtils._isBuffer = function (x) {
|
|
1253
|
+
if (!x || typeof x !== "object" || typeof x.length !== "number") {
|
|
1254
|
+
return false;
|
|
1255
|
+
}
|
|
1256
|
+
if (typeof x.copy !== "function" || typeof x.slice !== "function") {
|
|
1257
|
+
return false;
|
|
1258
|
+
}
|
|
1259
|
+
return !(x.length > 0 && typeof x[0] !== "number");
|
|
1260
|
+
};
|
|
1261
|
+
ObjectUtils._isUndefinedOrNull = function (value) {
|
|
1262
|
+
return value === null || value === undefined;
|
|
1263
|
+
};
|
|
1264
|
+
ObjectUtils._objEquiv = function (a, b) {
|
|
1265
|
+
var i, key;
|
|
1266
|
+
if (this._isUndefinedOrNull(a) || this._isUndefinedOrNull(b)) {
|
|
1267
|
+
return false;
|
|
1268
|
+
}
|
|
1269
|
+
if (a.prototype !== b.prototype) {
|
|
1270
|
+
return false;
|
|
1271
|
+
}
|
|
1272
|
+
if (this._isArguments(a)) {
|
|
1273
|
+
if (!this._isArguments(b)) {
|
|
1274
|
+
return false;
|
|
1275
|
+
}
|
|
1276
|
+
a = Array.prototype.slice.call(a);
|
|
1277
|
+
b = Array.prototype.slice.call(b);
|
|
1278
|
+
return this.DeepEquals(a, b);
|
|
1279
|
+
}
|
|
1280
|
+
if (this._isBuffer(a)) {
|
|
1281
|
+
if (!this._isBuffer(b)) {
|
|
1282
|
+
return false;
|
|
1283
|
+
}
|
|
1284
|
+
if (a.length !== b.length) {
|
|
1285
|
+
return false;
|
|
1286
|
+
}
|
|
1287
|
+
for (i = 0; i < a.length; i++) {
|
|
1288
|
+
if (a[i] !== b[i]) {
|
|
1289
|
+
return false;
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
return true;
|
|
1293
|
+
}
|
|
1294
|
+
var ka;
|
|
1295
|
+
var kb;
|
|
1296
|
+
try {
|
|
1297
|
+
ka = Object.keys(a);
|
|
1298
|
+
kb = Object.keys(b);
|
|
1299
|
+
}
|
|
1300
|
+
catch (e) {
|
|
1301
|
+
return false;
|
|
1302
|
+
}
|
|
1303
|
+
if (ka.length !== kb.length) {
|
|
1304
|
+
return false;
|
|
1305
|
+
}
|
|
1306
|
+
ka.sort();
|
|
1307
|
+
kb.sort();
|
|
1308
|
+
for (i = ka.length - 1; i >= 0; i--) {
|
|
1309
|
+
if (ka[i] !== kb[i]) {
|
|
1310
|
+
return false;
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
for (i = ka.length - 1; i >= 0; i--) {
|
|
1314
|
+
key = ka[i];
|
|
1315
|
+
if (!this.DeepEquals(a[key], b[key])) {
|
|
1316
|
+
return false;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
return typeof a === typeof b;
|
|
1320
|
+
};
|
|
1321
|
+
ObjectUtils._supportsArgumentsClass = function () {
|
|
1322
|
+
return Object.prototype.toString.call(arguments) === "[object Arguments]";
|
|
1323
|
+
};
|
|
1324
|
+
return ObjectUtils;
|
|
1325
|
+
}());
|
|
1326
|
+
|
|
1327
|
+
// Static utility function holder related to numeric variable evaluations and operations.
|
|
1328
|
+
var NumberUtils = /** @class */ (function () {
|
|
1329
|
+
function NumberUtils() {
|
|
1330
|
+
}
|
|
1331
|
+
// For user-typed number input; supports comma's as decimal delimiter.
|
|
1332
|
+
NumberUtils.ParseIntNumberInput = function (arg) {
|
|
1333
|
+
return NumberUtils.ParseInt(NumberUtils._NumberInputToNumberStr(arg));
|
|
1334
|
+
};
|
|
1335
|
+
// Parses given argument to an integer, using a native parseInt() function with a radix of 10. Returns NaN if parsing was not possible.
|
|
1336
|
+
NumberUtils.ParseInt = function (arg) {
|
|
1337
|
+
if (isNill(arg) || Array.isArray(arg)) {
|
|
1338
|
+
return undefined;
|
|
1339
|
+
}
|
|
1340
|
+
return parseInt(arg, 10);
|
|
1341
|
+
};
|
|
1342
|
+
// For user-typed number input; supports comma's as decimal delimiter.
|
|
1343
|
+
NumberUtils.ParseFloatNumberInput = function (arg, decimalPrecision) {
|
|
1344
|
+
if (decimalPrecision === void 0) { decimalPrecision = 2; }
|
|
1345
|
+
return NumberUtils.ParseFloat(NumberUtils._NumberInputToNumberStr(arg), decimalPrecision);
|
|
1346
|
+
};
|
|
1347
|
+
NumberUtils.ParseFloatNumberInputKeepPrecision = function (arg) {
|
|
1348
|
+
var correctedInputStr = NumberUtils._NumberInputToNumberStr(arg);
|
|
1349
|
+
var decimalPrecision = this.GetDecimalPlaces(correctedInputStr);
|
|
1350
|
+
return NumberUtils.ParseFloat(correctedInputStr, decimalPrecision);
|
|
1351
|
+
};
|
|
1352
|
+
/**
|
|
1353
|
+
* Returns given arg as a float number with given decimal precision, if possible. Returns NaN if parse conversion failed.
|
|
1354
|
+
*
|
|
1355
|
+
* @param {any} arg The argument to parse to a float
|
|
1356
|
+
* @param {number} decimalPrecision The number of decimals, or the precision, the parsed return float should have
|
|
1357
|
+
* @returns {number} NaN if not possible, else the parsed float value
|
|
1358
|
+
*/
|
|
1359
|
+
NumberUtils.ParseFloat = function (arg, decimalPrecision) {
|
|
1360
|
+
if (decimalPrecision === void 0) { decimalPrecision = 2; }
|
|
1361
|
+
if (!ObjectUtils.AllExist(arg, decimalPrecision) || Array.isArray(arg)) {
|
|
1362
|
+
return NaN;
|
|
1363
|
+
}
|
|
1364
|
+
if (!NumberUtils.IsInteger(decimalPrecision) || decimalPrecision < 0) {
|
|
1365
|
+
decimalPrecision = 2;
|
|
1366
|
+
// toFixed() can only handle up until 20
|
|
1367
|
+
}
|
|
1368
|
+
else if (decimalPrecision > 20) {
|
|
1369
|
+
decimalPrecision = 20;
|
|
1370
|
+
}
|
|
1371
|
+
return parseFloat(parseFloat(arg).toFixed(decimalPrecision));
|
|
1372
|
+
};
|
|
1373
|
+
/**
|
|
1374
|
+
* Returns given arg as a float number with given decimal precision, if possible. Returns NaN if parse conversion failed.
|
|
1375
|
+
*
|
|
1376
|
+
* @param arg The argument to parse to a float
|
|
1377
|
+
* @returns {number} The argument as a float with its original decimal precision intact
|
|
1378
|
+
*/
|
|
1379
|
+
NumberUtils.ParseFloatKeepPrecision = function (arg) {
|
|
1380
|
+
var decimalPrecision = this.GetDecimalPlaces(arg);
|
|
1381
|
+
return this.ParseFloat(arg, decimalPrecision);
|
|
1382
|
+
};
|
|
1383
|
+
/**
|
|
1384
|
+
* Returns the given argument as a number. Returns given defaultValue if conversion of argument was impossible.
|
|
1385
|
+
* @param arg
|
|
1386
|
+
* @param {number} [defaultValue = 0]
|
|
1387
|
+
* @returns {number}
|
|
1388
|
+
*/
|
|
1389
|
+
NumberUtils.ParseNumberOrDefault = function (arg, defaultValue) {
|
|
1390
|
+
if (defaultValue === void 0) { defaultValue = 0; }
|
|
1391
|
+
if (Array.isArray(arg)) {
|
|
1392
|
+
return defaultValue;
|
|
1393
|
+
}
|
|
1394
|
+
if (!NumberUtils.IsNumber(arg)) {
|
|
1395
|
+
arg = parseFloat(arg);
|
|
1396
|
+
arg = isNaN(arg) ? defaultValue : arg;
|
|
1397
|
+
}
|
|
1398
|
+
return arg;
|
|
1399
|
+
};
|
|
1400
|
+
// Returns true iff given argument is an integer number. Returns false on non-numbers or numbers with significant decimals.
|
|
1401
|
+
NumberUtils.IsInteger = function (arg) {
|
|
1402
|
+
if (isNaN(arg) || Array.isArray(arg)) {
|
|
1403
|
+
return false;
|
|
1404
|
+
}
|
|
1405
|
+
var argAsFloat = parseFloat(arg);
|
|
1406
|
+
return ((argAsFloat | 0) === argAsFloat); // returns whether 'arg converted to an integer equals arg'
|
|
1407
|
+
};
|
|
1408
|
+
// Returns the number of decimal places of the given number. Returns 0 if no decimals whatsoever could be found on given arg.
|
|
1409
|
+
NumberUtils.GetDecimalPlaces = function (arg, maxAnswer) {
|
|
1410
|
+
if (maxAnswer === void 0) { maxAnswer = 1000; }
|
|
1411
|
+
var match = ("" + arg).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
|
|
1412
|
+
if (!match) {
|
|
1413
|
+
return 0;
|
|
1414
|
+
}
|
|
1415
|
+
var answer = Math.max(0,
|
|
1416
|
+
// number of digits right of decimal point.
|
|
1417
|
+
(match[1] ? match[1].length : 0)
|
|
1418
|
+
// adjust for scientific notation
|
|
1419
|
+
- (match[2] ? +match[2] : 0));
|
|
1420
|
+
if (answer > maxAnswer) {
|
|
1421
|
+
answer = maxAnswer;
|
|
1422
|
+
}
|
|
1423
|
+
return answer;
|
|
1424
|
+
};
|
|
1425
|
+
// Parses given numberInput to a number, or returns given defaultValue if parse not possible. Allows ',' char as decimal delimiter.
|
|
1426
|
+
NumberUtils.ParseNumberInputOrDefault = function (numberInput, defaultValue) {
|
|
1427
|
+
if (defaultValue === void 0) { defaultValue = 0; }
|
|
1428
|
+
return NumberUtils.ParseNumberOrDefault(NumberUtils._NumberInputToNumberStr(numberInput), defaultValue);
|
|
1429
|
+
};
|
|
1430
|
+
// Returns whether the type of given argument is 'number'.
|
|
1431
|
+
NumberUtils.IsNumber = function (arg) {
|
|
1432
|
+
return typeof arg === "number" && !isNaN(arg);
|
|
1433
|
+
};
|
|
1434
|
+
/**
|
|
1435
|
+
* Returns whether given arg is indeed not a number (it's NaN or it has another type than 'number')
|
|
1436
|
+
* Our exact copy of AS Flex'es isNaN(arg) function. Always use this method for copying Flex isNaN(..) occurences into TypeScript.
|
|
1437
|
+
* @param arg
|
|
1438
|
+
* @returns {boolean}
|
|
1439
|
+
* @constructor
|
|
1440
|
+
*/
|
|
1441
|
+
NumberUtils.IsNaN = function (arg) {
|
|
1442
|
+
return isNaN(arg) || !NumberUtils.IsNumber(arg);
|
|
1443
|
+
};
|
|
1444
|
+
// Our copy of CoMath.NaN. Returns number, or substitute if NumberUtils.IsNaN(number) holds true.
|
|
1445
|
+
NumberUtils.NaN = function (number, substitute) {
|
|
1446
|
+
if (substitute === void 0) { substitute = 0; }
|
|
1447
|
+
return NumberUtils.IsNaN(number) ? substitute : number;
|
|
1448
|
+
};
|
|
1449
|
+
// Returns whether the value is parasable as a number.
|
|
1450
|
+
NumberUtils.IsParsableNumber = function (arg) {
|
|
1451
|
+
if (Array.isArray(arg)) {
|
|
1452
|
+
return false;
|
|
1453
|
+
}
|
|
1454
|
+
return !isNaN(parseFloat(arg));
|
|
1455
|
+
};
|
|
1456
|
+
NumberUtils.IsParsableNumberInput = function (numberInput) {
|
|
1457
|
+
return NumberUtils.IsParsableNumber(NumberUtils._NumberInputToNumberStr(numberInput));
|
|
1458
|
+
};
|
|
1459
|
+
/**
|
|
1460
|
+
* Returns whether given arg is parseable as a number, and whether the lengts of its number parse result is equal to its original length.
|
|
1461
|
+
* I.e. this function returns FALSE with given number-parsable strings, but that have non-numeric appendices, eg '2233ff'. That arg
|
|
1462
|
+
* IS number-parseable, but not a strict 'string number', the latter being what this method actually checks for.
|
|
1463
|
+
*/
|
|
1464
|
+
NumberUtils.IsStringNumber = function (arg) {
|
|
1465
|
+
if (!NumberUtils.IsParsableNumber(arg)) {
|
|
1466
|
+
return false;
|
|
1467
|
+
}
|
|
1468
|
+
else {
|
|
1469
|
+
return arg.toString().length === parseFloat(arg).toString().length;
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
NumberUtils.IsListOfNumbers = function (arg, separator) {
|
|
1473
|
+
if (separator === void 0) { separator = ","; }
|
|
1474
|
+
var nrs = arg.split(separator);
|
|
1475
|
+
if (nrs.length === 0) {
|
|
1476
|
+
return false;
|
|
1477
|
+
}
|
|
1478
|
+
return nrs.filter(function (s) { return NumberUtils.IsStringNumber(s); }).length === nrs.length;
|
|
1479
|
+
};
|
|
1480
|
+
// Returns given argument as a string representation of a number parse, e.g. "1" for a number parse result of arg to 1.
|
|
1481
|
+
NumberUtils.ParseStringNumber = function (arg) {
|
|
1482
|
+
if (!this.IsStringNumber(arg)) {
|
|
1483
|
+
return NaN;
|
|
1484
|
+
}
|
|
1485
|
+
return NumberUtils.ParseFloatKeepPrecision(arg);
|
|
1486
|
+
};
|
|
1487
|
+
NumberUtils.ParseStringNumberDefault = function (arg, defaultValue) {
|
|
1488
|
+
if (defaultValue === void 0) { defaultValue = 0; }
|
|
1489
|
+
return NumberUtils.NaN(NumberUtils.ParseStringNumber(arg), defaultValue);
|
|
1490
|
+
};
|
|
1491
|
+
/**
|
|
1492
|
+
* Returns a random integer in range [lowerBound .. upperBound], an inclusive range. Returns NaN if not possible.
|
|
1493
|
+
* Given bounds are truncated first, before serving as the true lower- and upper bounds for the random int.
|
|
1494
|
+
*/
|
|
1495
|
+
NumberUtils.RandomInt = function (lowerBoundInt, upperBoundInt) {
|
|
1496
|
+
if (!NumberUtils.IsNumber(lowerBoundInt) || !NumberUtils.IsNumber(upperBoundInt) || lowerBoundInt > upperBoundInt) {
|
|
1497
|
+
return NaN;
|
|
1498
|
+
}
|
|
1499
|
+
lowerBoundInt = Math.trunc(lowerBoundInt);
|
|
1500
|
+
upperBoundInt = Math.trunc(upperBoundInt);
|
|
1501
|
+
if (lowerBoundInt === upperBoundInt) {
|
|
1502
|
+
return lowerBoundInt;
|
|
1503
|
+
}
|
|
1504
|
+
var delta = upperBoundInt - lowerBoundInt;
|
|
1505
|
+
return (Math.round(Math.random() * delta) + lowerBoundInt);
|
|
1506
|
+
};
|
|
1507
|
+
// Adds thousands comma's to given value, E.g. '1000' to '1,000'. Returns empty string if value was undefined.
|
|
1508
|
+
NumberUtils.AddThousandsCommasTo = function (value) {
|
|
1509
|
+
if (isNill(value)) {
|
|
1510
|
+
return "";
|
|
1511
|
+
}
|
|
1512
|
+
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
1513
|
+
};
|
|
1514
|
+
/**
|
|
1515
|
+
* Function used to check wether a given number is composed of another number, power-of-two wise.
|
|
1516
|
+
* Example usage: NumberUtils.NumIsComposedOf(articleListObject.publication, ArticlePublication.Selector).
|
|
1517
|
+
* This would return whether or not that articleListObject was publicated for selector or not, where articleListObject.publication
|
|
1518
|
+
* was possibly a 'COMPOSITE that was made out of (including)' ArticlePublication.Selector.
|
|
1519
|
+
*/
|
|
1520
|
+
NumberUtils.NumIsComposedOfOtherPowTwoNum = function (bigNrToCheck, powTwoNumItShouldBeComposedOf) {
|
|
1521
|
+
if (!bigNrToCheck) {
|
|
1522
|
+
return false;
|
|
1523
|
+
}
|
|
1524
|
+
else if (!powTwoNumItShouldBeComposedOf) {
|
|
1525
|
+
return true;
|
|
1526
|
+
}
|
|
1527
|
+
else {
|
|
1528
|
+
return ((bigNrToCheck & powTwoNumItShouldBeComposedOf) === powTwoNumItShouldBeComposedOf);
|
|
1529
|
+
}
|
|
1530
|
+
};
|
|
1531
|
+
/**
|
|
1532
|
+
* Returns given nr, or the given default number (default 0) if the nr number was undefined or otherwise not a number.
|
|
1533
|
+
* Same as CoMath.NaN from AS code (used as its substitute in transaction logic)
|
|
1534
|
+
* @param nr
|
|
1535
|
+
* @param defaultNr
|
|
1536
|
+
* @returns {number}
|
|
1537
|
+
*/
|
|
1538
|
+
NumberUtils.NrOrDefault = function (nr, defaultNr) {
|
|
1539
|
+
if (defaultNr === void 0) { defaultNr = 0; }
|
|
1540
|
+
if (notNill(nr) && NumberUtils.IsNumber(nr)) {
|
|
1541
|
+
return nr;
|
|
1542
|
+
}
|
|
1543
|
+
else {
|
|
1544
|
+
return defaultNr;
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
/**
|
|
1548
|
+
* Returns whether given nrToCheck is within the given precision and scale limits. Precision and scale, here, are Oracle DB terms.
|
|
1549
|
+
* This function can thus be used to check whether the given number is safe to send to the 'database' beforehand, if we know the
|
|
1550
|
+
* precision and scale of the number in the db declaration.
|
|
1551
|
+
*
|
|
1552
|
+
* I.e. A number declared in the Oracle DB as number(5, 2) has a precision of 5 and a scale of 2.
|
|
1553
|
+
*
|
|
1554
|
+
* @param {number} nrToCheck
|
|
1555
|
+
* @param {number} precision The number of significant digits, including possibly negative scale. E.g. 3 in '123' and 5 in '51.123'
|
|
1556
|
+
* @param {number} [scale = 0] The number of significant digits AFTER the decimal point. E.g. 1 in 5432.1 and 3 in 54000.003
|
|
1557
|
+
* @returns {CheckPrecisionAndScaleResult} Whether given nrToCheck is ok for given precision and scale, and if not, the
|
|
1558
|
+
* nearest number that IS ok for those constraints.
|
|
1559
|
+
*/
|
|
1560
|
+
NumberUtils.CheckPrecisionAndScale = function (nrToCheck, precision, scale) {
|
|
1561
|
+
if (scale === void 0) { scale = 0; }
|
|
1562
|
+
// let's say any undefined number is checked OK, and all numbers are checked OK for an undefined precision
|
|
1563
|
+
if (!ObjectUtils.AllExist(nrToCheck, precision, scale)) {
|
|
1564
|
+
return { isOk: true, nearestOkNr: NaN };
|
|
1565
|
+
}
|
|
1566
|
+
// no number can have 0 or less than 0 significant digits, in our universe
|
|
1567
|
+
if (precision < 1 || precision - scale < 1) {
|
|
1568
|
+
return { isOk: false, nearestOkNr: NaN };
|
|
1569
|
+
}
|
|
1570
|
+
// begin check
|
|
1571
|
+
var isNegative = (nrToCheck < 0);
|
|
1572
|
+
var nrParts = nrToCheck.toString().split(".");
|
|
1573
|
+
// remove minus sign if negative
|
|
1574
|
+
if (isNegative) {
|
|
1575
|
+
nrParts[0] = nrParts[0].slice(1);
|
|
1576
|
+
}
|
|
1577
|
+
var numCountBeforeDot = nrParts[0].length;
|
|
1578
|
+
var allowedNumCountBeforeDot = precision - scale;
|
|
1579
|
+
if (numCountBeforeDot <= allowedNumCountBeforeDot) {
|
|
1580
|
+
return { isOk: true, nearestOkNr: nrToCheck };
|
|
1581
|
+
}
|
|
1582
|
+
else {
|
|
1583
|
+
// cut a part from the "before decimal number" so that the number is not too big anymore
|
|
1584
|
+
var numCountToRemove = numCountBeforeDot - allowedNumCountBeforeDot;
|
|
1585
|
+
// remove the right-most numbers before the decimal dot
|
|
1586
|
+
nrParts[0] = nrParts[0].slice(0, -1 * numCountToRemove);
|
|
1587
|
+
// add minus sign again if it was negative
|
|
1588
|
+
if (isNegative) {
|
|
1589
|
+
nrParts[0] = "-" + nrParts[0];
|
|
1590
|
+
}
|
|
1591
|
+
// build and return composite number again
|
|
1592
|
+
var nearestOkNr = void 0;
|
|
1593
|
+
if (nrParts[1]) {
|
|
1594
|
+
nearestOkNr = Number(nrParts[0] + "." + nrParts[1]);
|
|
1595
|
+
}
|
|
1596
|
+
else {
|
|
1597
|
+
nearestOkNr = Number(nrParts[0]);
|
|
1598
|
+
}
|
|
1599
|
+
return { isOk: false, nearestOkNr: nearestOkNr };
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
/**
|
|
1603
|
+
* Returns whether given x is OK within the given min, max and step boundaries, where it should hold that nrToCheck = min + N * step,
|
|
1604
|
+
* with N integer or 0.
|
|
1605
|
+
* @param {number} nrToCheck Number to check whether it's within the given bounds
|
|
1606
|
+
* @param min Inclusive
|
|
1607
|
+
* @param max Inclusive
|
|
1608
|
+
* @param stepSize
|
|
1609
|
+
* @returns {CheckWithinSteppedBounds} Returns remainder of undefined when nrToCheck was OUTSIDE [min, max], else full result object.
|
|
1610
|
+
*/
|
|
1611
|
+
NumberUtils.CheckWithinSteppedBounds = function (nrToCheck, min, max, stepSize) {
|
|
1612
|
+
if (stepSize === void 0) { stepSize = 1; }
|
|
1613
|
+
if (nrToCheck < min || nrToCheck > max) {
|
|
1614
|
+
return { isOk: false, remainder: undefined };
|
|
1615
|
+
}
|
|
1616
|
+
// we're in [min, max], but still check if nrToCheck = min + N * step holds (for N integer or 0)
|
|
1617
|
+
var remainder = (nrToCheck - min) % stepSize;
|
|
1618
|
+
// correct float for largest precision amongst input numbers
|
|
1619
|
+
remainder = NumberUtils.ParseFloat(remainder, NumberUtils._GetLargestDecimalPrecisionOf(nrToCheck, min, stepSize));
|
|
1620
|
+
return { isOk: (remainder === 0), remainder: remainder };
|
|
1621
|
+
};
|
|
1622
|
+
/**
|
|
1623
|
+
* Finds the number closest to the originalNumber, that adheres to the given bounds. That is, for which it holds that
|
|
1624
|
+
* nr = min + N * step with N integer or 0.
|
|
1625
|
+
* @param {number} originalNr Find closest answer to this number
|
|
1626
|
+
* @param min Inclusive
|
|
1627
|
+
* @param max Inclusive
|
|
1628
|
+
* @param stepSize
|
|
1629
|
+
* @returns {boolean} The closest OK number for bounds.
|
|
1630
|
+
*/
|
|
1631
|
+
NumberUtils.GetNearestNumberWithinSteppedBounds = function (originalNr, min, max, stepSize) {
|
|
1632
|
+
if (stepSize === void 0) { stepSize = 1; }
|
|
1633
|
+
if (originalNr < min) {
|
|
1634
|
+
return min;
|
|
1635
|
+
}
|
|
1636
|
+
else if (originalNr > max) {
|
|
1637
|
+
return NumberUtils.GetTrueSteppedBoundsMax(min, max, stepSize);
|
|
1638
|
+
}
|
|
1639
|
+
var boundsCheck = NumberUtils.CheckWithinSteppedBounds(originalNr, min, max, stepSize);
|
|
1640
|
+
if (boundsCheck.isOk) {
|
|
1641
|
+
return originalNr;
|
|
1642
|
+
}
|
|
1643
|
+
var answer;
|
|
1644
|
+
var remainder = boundsCheck.remainder;
|
|
1645
|
+
if (remainder) {
|
|
1646
|
+
// round up or down?
|
|
1647
|
+
if ((remainder / stepSize) < 0.5) {
|
|
1648
|
+
// round down, but not below min
|
|
1649
|
+
answer = (originalNr - remainder >= min ? originalNr - remainder : min);
|
|
1650
|
+
}
|
|
1651
|
+
else {
|
|
1652
|
+
// round up, but not above max
|
|
1653
|
+
answer = (originalNr + stepSize - remainder <= max ? originalNr + stepSize - remainder :
|
|
1654
|
+
NumberUtils.GetTrueSteppedBoundsMax(min, max, stepSize));
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
else {
|
|
1658
|
+
// is this real life, why wasn't our stepped bounds check OK?
|
|
1659
|
+
answer = originalNr;
|
|
1660
|
+
}
|
|
1661
|
+
// 'correct' float errors
|
|
1662
|
+
answer = NumberUtils.ParseFloat(answer, NumberUtils._GetLargestDecimalPrecisionOf(originalNr, min, max, stepSize));
|
|
1663
|
+
return answer;
|
|
1664
|
+
};
|
|
1665
|
+
/**
|
|
1666
|
+
* Returns the true maximum allowed value for the given "stepped bounds": min, stepSize and max, for which it holds that each allowed
|
|
1667
|
+
* value Y = min + stepSize * N, for any INTEGER or 0 N where it also holds, of course, that Y <= max.
|
|
1668
|
+
* @param min
|
|
1669
|
+
* @param max
|
|
1670
|
+
* @param stepSize
|
|
1671
|
+
*/
|
|
1672
|
+
NumberUtils.GetTrueSteppedBoundsMax = function (min, max, stepSize) {
|
|
1673
|
+
if (stepSize === void 0) { stepSize = 1; }
|
|
1674
|
+
// solve max integer X in formula min + X * step <= max, and return min + X * stepSize for that X
|
|
1675
|
+
var maxSteps = Math.floor((max - min) / stepSize);
|
|
1676
|
+
// 'correct' float errors
|
|
1677
|
+
return NumberUtils.ParseFloat(min + maxSteps * stepSize, NumberUtils._GetLargestDecimalPrecisionOf(min, min, max));
|
|
1678
|
+
};
|
|
1679
|
+
// Returns the nearest number, relative to the given originalNr, that is within the given [min, max] inclusive bounds.
|
|
1680
|
+
NumberUtils.GetNearestNumberWithinBounds = function (originalNr, min, max) {
|
|
1681
|
+
var answer = originalNr;
|
|
1682
|
+
if (originalNr < min) {
|
|
1683
|
+
answer = min;
|
|
1684
|
+
}
|
|
1685
|
+
else if (originalNr > max) {
|
|
1686
|
+
answer = max;
|
|
1687
|
+
}
|
|
1688
|
+
return answer;
|
|
1689
|
+
};
|
|
1690
|
+
// Returns the string representation of given number. If it's not a number, returns the empty string.
|
|
1691
|
+
NumberUtils.ToString = function (nr) {
|
|
1692
|
+
if (!NumberUtils.IsNaN(nr)) {
|
|
1693
|
+
return "" + nr;
|
|
1694
|
+
}
|
|
1695
|
+
else {
|
|
1696
|
+
return "";
|
|
1697
|
+
}
|
|
1698
|
+
};
|
|
1699
|
+
NumberUtils.DecimalsToStepIncrement = function (numberOfDecimals) {
|
|
1700
|
+
return Math.pow(10, -1 * numberOfDecimals);
|
|
1701
|
+
};
|
|
1702
|
+
NumberUtils.Round = function (value, decimals) {
|
|
1703
|
+
var factor = Math.pow(10, decimals);
|
|
1704
|
+
return Math.round(value * factor) / factor;
|
|
1705
|
+
};
|
|
1706
|
+
// @returns The inclusive max value
|
|
1707
|
+
NumberUtils.PrecisionScaleToMaxValue = function (precision, scale) {
|
|
1708
|
+
var oneStep = this.DecimalsToStepIncrement(scale);
|
|
1709
|
+
var maxExclusive = Math.pow(10, precision - scale);
|
|
1710
|
+
return maxExclusive - oneStep;
|
|
1711
|
+
};
|
|
1712
|
+
// @returns the difference between given 2 numbers
|
|
1713
|
+
NumberUtils.DifferenceBetweenNumbers = function (numberA, numberB) {
|
|
1714
|
+
return Math.abs(numberA - numberB);
|
|
1715
|
+
};
|
|
1716
|
+
NumberUtils._GetLargestDecimalPrecisionOf = function () {
|
|
1717
|
+
var args = [];
|
|
1718
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1719
|
+
args[_i] = arguments[_i];
|
|
1720
|
+
}
|
|
1721
|
+
var result = ArrayUtils.GetMaxCalculatedValue(args, function (arg) {
|
|
1722
|
+
return NumberUtils.GetDecimalPlaces(arg);
|
|
1723
|
+
});
|
|
1724
|
+
return result;
|
|
1725
|
+
};
|
|
1726
|
+
// Returns given number input as a number that's useable by Javascript. Allows for incoming ',' decimal delimiter.
|
|
1727
|
+
NumberUtils._NumberInputToNumberStr = function (numberInput) {
|
|
1728
|
+
return (numberInput + "").replace(",", ".");
|
|
1729
|
+
};
|
|
1730
|
+
return NumberUtils;
|
|
1731
|
+
}());
|
|
1732
|
+
|
|
1035
1733
|
var ArrayUtils = /** @class */ (function () {
|
|
1036
1734
|
function ArrayUtils() {
|
|
1037
1735
|
}
|
|
@@ -1046,7 +1744,7 @@
|
|
|
1046
1744
|
if (!array || !finder) {
|
|
1047
1745
|
return false;
|
|
1048
1746
|
}
|
|
1049
|
-
return
|
|
1747
|
+
return notNill(this.Find(array, finder));
|
|
1050
1748
|
};
|
|
1051
1749
|
/**
|
|
1052
1750
|
* Cross-browser Array.find() function. Returns the first item in given array for which the foundBy function returns true. Returns
|
|
@@ -1109,10 +1807,10 @@
|
|
|
1109
1807
|
if (array) {
|
|
1110
1808
|
for (var i = 0, len = array.length; i < len; i++) {
|
|
1111
1809
|
if (deepClone) {
|
|
1112
|
-
cloneArray.push(
|
|
1810
|
+
cloneArray.push(ObjectUtils.GetDeepClone(array[i]));
|
|
1113
1811
|
}
|
|
1114
1812
|
else {
|
|
1115
|
-
cloneArray.push(
|
|
1813
|
+
cloneArray.push(ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
|
|
1116
1814
|
}
|
|
1117
1815
|
}
|
|
1118
1816
|
}
|
|
@@ -1130,7 +1828,7 @@
|
|
|
1130
1828
|
* @returns {boolean} True if and only if the element on given index is succesfully removed from given array.
|
|
1131
1829
|
*/
|
|
1132
1830
|
ArrayUtils.RemoveElementAtIndex = function (index, array) {
|
|
1133
|
-
if (
|
|
1831
|
+
if (NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
|
|
1134
1832
|
return false;
|
|
1135
1833
|
}
|
|
1136
1834
|
if (index in array) {
|
|
@@ -1158,7 +1856,7 @@
|
|
|
1158
1856
|
};
|
|
1159
1857
|
// 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.
|
|
1160
1858
|
ArrayUtils.IsArrayWithElements = function (arrayToCheck, classItemsMustBeInstanceOf) {
|
|
1161
|
-
if (
|
|
1859
|
+
if (isNill(arrayToCheck)) {
|
|
1162
1860
|
return false;
|
|
1163
1861
|
}
|
|
1164
1862
|
if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
|
|
@@ -1190,11 +1888,11 @@
|
|
|
1190
1888
|
return atLeastOneRemoved;
|
|
1191
1889
|
};
|
|
1192
1890
|
ArrayUtils.MoveElement = function (element, toIndex, array) {
|
|
1193
|
-
if (!Array.isArray(array) ||
|
|
1891
|
+
if (!Array.isArray(array) || isNill(toIndex)) {
|
|
1194
1892
|
return false;
|
|
1195
1893
|
}
|
|
1196
1894
|
var fromIndex = array.indexOf(element);
|
|
1197
|
-
var toIndexCorrected =
|
|
1895
|
+
var toIndexCorrected = NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
|
|
1198
1896
|
if (fromIndex === -1 || array[toIndexCorrected] === element) {
|
|
1199
1897
|
// element did not exist in given array, or already existed on given toIndex
|
|
1200
1898
|
return false;
|
|
@@ -1212,6 +1910,25 @@
|
|
|
1212
1910
|
}
|
|
1213
1911
|
}
|
|
1214
1912
|
};
|
|
1913
|
+
/**
|
|
1914
|
+
* Returns max value from all resulting values from applying given itemValueFunction to all items of given array.
|
|
1915
|
+
* @param array
|
|
1916
|
+
* @param itemValueFunction The function applied to each array item that gives it a numerical value. The max num val found is returned.
|
|
1917
|
+
*/
|
|
1918
|
+
ArrayUtils.GetMaxCalculatedValue = function (array, itemValueFunction) {
|
|
1919
|
+
if (!array || !itemValueFunction) {
|
|
1920
|
+
return NaN;
|
|
1921
|
+
}
|
|
1922
|
+
var max = undefined;
|
|
1923
|
+
var len = array.length;
|
|
1924
|
+
for (var i = 0; i < len; i++) {
|
|
1925
|
+
var valueCur = itemValueFunction.call(this);
|
|
1926
|
+
if (valueCur > max) {
|
|
1927
|
+
max = valueCur;
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
return max;
|
|
1931
|
+
};
|
|
1215
1932
|
return ArrayUtils;
|
|
1216
1933
|
}());
|
|
1217
1934
|
|
|
@@ -1408,13 +2125,13 @@
|
|
|
1408
2125
|
return BusinessObjectFactory;
|
|
1409
2126
|
}());
|
|
1410
2127
|
|
|
1411
|
-
|
|
2128
|
+
exports["ɵr"] = void 0;
|
|
1412
2129
|
(function (LanguageCode) {
|
|
1413
2130
|
LanguageCode["Dutch"] = "nl-NL";
|
|
1414
2131
|
LanguageCode["English"] = "en-GB";
|
|
1415
2132
|
LanguageCode["German"] = "de-DE";
|
|
1416
2133
|
LanguageCode["French"] = "fr-FR";
|
|
1417
|
-
})(
|
|
2134
|
+
})(exports["ɵr"] || (exports["ɵr"] = {}));
|
|
1418
2135
|
|
|
1419
2136
|
// Static utility functions holder related to strings.
|
|
1420
2137
|
var StringUtils = /** @class */ (function () {
|
|
@@ -1528,7 +2245,7 @@
|
|
|
1528
2245
|
DictionaryService.prototype.setDictionary = function (language) {
|
|
1529
2246
|
return __awaiter(this, void 0, void 0, function () {
|
|
1530
2247
|
return __generator(this, function (_a) {
|
|
1531
|
-
this._language = language ||
|
|
2248
|
+
this._language = language || exports["ɵr"].Dutch;
|
|
1532
2249
|
this._loadDictionary();
|
|
1533
2250
|
return [2 /*return*/];
|
|
1534
2251
|
});
|
|
@@ -1561,7 +2278,7 @@
|
|
|
1561
2278
|
return key || "";
|
|
1562
2279
|
}
|
|
1563
2280
|
if (this.language === undefined) {
|
|
1564
|
-
this._language =
|
|
2281
|
+
this._language = exports["ɵr"].Dutch;
|
|
1565
2282
|
this._loadDictionary();
|
|
1566
2283
|
}
|
|
1567
2284
|
var text = this._dictionaries.get(this.language)[key];
|
|
@@ -1849,15 +2566,15 @@
|
|
|
1849
2566
|
});
|
|
1850
2567
|
});
|
|
1851
2568
|
};
|
|
1852
|
-
SharedConnectorService.prototype.
|
|
2569
|
+
SharedConnectorService.prototype.getOrderConfirmationDefaultSendMethod = function (relationId) {
|
|
1853
2570
|
return __awaiter(this, void 0, void 0, function () {
|
|
1854
2571
|
var _this = this;
|
|
1855
2572
|
return __generator(this, function (_a) {
|
|
1856
2573
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
1857
|
-
return _this.
|
|
2574
|
+
return _this.sharedConnector.getOrderConfirmationDefaultSendMethod(relationId).then(function (result) {
|
|
1858
2575
|
if (result.validationResult && result.validationResult.success) {
|
|
1859
|
-
if (result.
|
|
1860
|
-
resolve(
|
|
2576
|
+
if (result.resultObject) {
|
|
2577
|
+
resolve(result.resultObject);
|
|
1861
2578
|
}
|
|
1862
2579
|
}
|
|
1863
2580
|
else {
|
|
@@ -1868,31 +2585,88 @@
|
|
|
1868
2585
|
});
|
|
1869
2586
|
});
|
|
1870
2587
|
};
|
|
1871
|
-
SharedConnectorService.prototype.
|
|
2588
|
+
SharedConnectorService.prototype.getDefaultEmailAddressListForOrderConfirmation = function (transactionUUID) {
|
|
1872
2589
|
return __awaiter(this, void 0, void 0, function () {
|
|
1873
2590
|
var _this = this;
|
|
1874
2591
|
return __generator(this, function (_a) {
|
|
1875
2592
|
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
1876
|
-
return _this.
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
if (!(result.validationResult && result.validationResult.success)) return [3 /*break*/, 2];
|
|
1881
|
-
return [4 /*yield*/, this.commit()];
|
|
1882
|
-
case 1:
|
|
1883
|
-
_a.sent();
|
|
1884
|
-
resolve(true);
|
|
1885
|
-
return [3 /*break*/, 3];
|
|
1886
|
-
case 2:
|
|
1887
|
-
reject(result.validationMessagesAsString);
|
|
1888
|
-
_a.label = 3;
|
|
1889
|
-
case 3: return [2 /*return*/];
|
|
2593
|
+
return _this.sharedConnector.getDefaultEmailAddressListForOrderConfirmation(transactionUUID).then(function (result) {
|
|
2594
|
+
if (result.validationResult && result.validationResult.success) {
|
|
2595
|
+
if (result.resultObject) {
|
|
2596
|
+
resolve(result.resultObject);
|
|
1890
2597
|
}
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
2598
|
+
}
|
|
2599
|
+
else {
|
|
2600
|
+
reject(result.validationMessagesAsString);
|
|
2601
|
+
}
|
|
2602
|
+
});
|
|
2603
|
+
})];
|
|
2604
|
+
});
|
|
2605
|
+
});
|
|
2606
|
+
};
|
|
2607
|
+
SharedConnectorService.prototype.getPurchaseOrderEmailLayouts = function (transactionUUID) {
|
|
2608
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2609
|
+
var _this = this;
|
|
2610
|
+
return __generator(this, function (_a) {
|
|
2611
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
2612
|
+
return _this.sharedConnector.getPurchaseOrderEmailLayouts(transactionUUID).then(function (result) {
|
|
2613
|
+
if (result.validationResult && result.validationResult.success) {
|
|
2614
|
+
if (result.resultObject) {
|
|
2615
|
+
resolve(result.resultObject);
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
else {
|
|
2619
|
+
reject(result.validationMessagesAsString);
|
|
2620
|
+
}
|
|
2621
|
+
});
|
|
2622
|
+
})];
|
|
2623
|
+
});
|
|
2624
|
+
});
|
|
2625
|
+
};
|
|
2626
|
+
SharedConnectorService.prototype.getArticleDetails = function (data) {
|
|
2627
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2628
|
+
var _this = this;
|
|
2629
|
+
return __generator(this, function (_a) {
|
|
2630
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
2631
|
+
return _this.articleConnector.getArticleDetails(data).then(function (result) {
|
|
2632
|
+
if (result.validationResult && result.validationResult.success) {
|
|
2633
|
+
if (result.resultObjects) {
|
|
2634
|
+
resolve(_this._boFactory.makeBOArrayFromRawBackendDataArray(articleDetails_bo.ArticleDetailsBo, result.resultObjects));
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
else {
|
|
2638
|
+
reject(result.validationMessagesAsString);
|
|
2639
|
+
}
|
|
2640
|
+
});
|
|
2641
|
+
})];
|
|
2642
|
+
});
|
|
2643
|
+
});
|
|
2644
|
+
};
|
|
2645
|
+
SharedConnectorService.prototype.updateArticleDetails = function (data) {
|
|
2646
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2647
|
+
var _this = this;
|
|
2648
|
+
return __generator(this, function (_a) {
|
|
2649
|
+
return [2 /*return*/, new Promise(function (resolve, reject) {
|
|
2650
|
+
return _this.articleConnector.updateArticleDetails(data).then(function (result) { return __awaiter(_this, void 0, void 0, function () {
|
|
2651
|
+
return __generator(this, function (_a) {
|
|
2652
|
+
switch (_a.label) {
|
|
2653
|
+
case 0:
|
|
2654
|
+
if (!(result.validationResult && result.validationResult.success)) return [3 /*break*/, 2];
|
|
2655
|
+
return [4 /*yield*/, this.commit()];
|
|
2656
|
+
case 1:
|
|
2657
|
+
_a.sent();
|
|
2658
|
+
resolve(true);
|
|
2659
|
+
return [3 /*break*/, 3];
|
|
2660
|
+
case 2:
|
|
2661
|
+
reject(result.validationMessagesAsString);
|
|
2662
|
+
_a.label = 3;
|
|
2663
|
+
case 3: return [2 /*return*/];
|
|
2664
|
+
}
|
|
2665
|
+
});
|
|
2666
|
+
}); });
|
|
2667
|
+
})];
|
|
2668
|
+
});
|
|
2669
|
+
});
|
|
1896
2670
|
};
|
|
1897
2671
|
SharedConnectorService.prototype.lockArticleDetails = function (data) {
|
|
1898
2672
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1995,8 +2769,6 @@
|
|
|
1995
2769
|
var StockService = /** @class */ (function () {
|
|
1996
2770
|
function StockService(_sharedService) {
|
|
1997
2771
|
this._sharedService = _sharedService;
|
|
1998
|
-
this.printSticker = new printStockStickers.PrintStockStickers();
|
|
1999
|
-
this.printPriceSticker = new printPriceStickers_bo.PrintPriceStickers();
|
|
2000
2772
|
}
|
|
2001
2773
|
StockService.prototype.getPrintStockStickers = function (data) {
|
|
2002
2774
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2116,6 +2888,36 @@
|
|
|
2116
2888
|
});
|
|
2117
2889
|
});
|
|
2118
2890
|
};
|
|
2891
|
+
StockService.prototype.getOrderConfirmationDefaultSendMethod = function (relationId) {
|
|
2892
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2893
|
+
return __generator(this, function (_a) {
|
|
2894
|
+
switch (_a.label) {
|
|
2895
|
+
case 0: return [4 /*yield*/, this._sharedService.getOrderConfirmationDefaultSendMethod(relationId)];
|
|
2896
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
2897
|
+
}
|
|
2898
|
+
});
|
|
2899
|
+
});
|
|
2900
|
+
};
|
|
2901
|
+
StockService.prototype.getDefaultEmailAddressListForOrderConfirmation = function (transactionUUID) {
|
|
2902
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2903
|
+
return __generator(this, function (_a) {
|
|
2904
|
+
switch (_a.label) {
|
|
2905
|
+
case 0: return [4 /*yield*/, this._sharedService.getDefaultEmailAddressListForOrderConfirmation(transactionUUID)];
|
|
2906
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
2907
|
+
}
|
|
2908
|
+
});
|
|
2909
|
+
});
|
|
2910
|
+
};
|
|
2911
|
+
StockService.prototype.getPurchaseOrderEmailLayouts = function (transactionUUID) {
|
|
2912
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2913
|
+
return __generator(this, function (_a) {
|
|
2914
|
+
switch (_a.label) {
|
|
2915
|
+
case 0: return [4 /*yield*/, this._sharedService.getPurchaseOrderEmailLayouts(transactionUUID)];
|
|
2916
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
2917
|
+
}
|
|
2918
|
+
});
|
|
2919
|
+
});
|
|
2920
|
+
};
|
|
2119
2921
|
StockService.prototype.getArticleTransaction = function (data) {
|
|
2120
2922
|
return __awaiter(this, void 0, void 0, function () {
|
|
2121
2923
|
return __generator(this, function (_a) {
|
|
@@ -2327,8 +3129,13 @@
|
|
|
2327
3129
|
"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>",
|
|
2328
3130
|
"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>",
|
|
2329
3131
|
"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>",
|
|
3132
|
+
"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>",
|
|
3133
|
+
"file_pdf_regular": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><path d=\"M320 464C328.8 464 336 456.8 336 448V416H384V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V416H48V448C48 456.8 55.16 464 64 464H320zM256 160C238.3 160 224 145.7 224 128V48H64C55.16 48 48 55.16 48 64V192H0V64C0 28.65 28.65 0 64 0H229.5C246.5 0 262.7 6.743 274.7 18.75L365.3 109.3C377.3 121.3 384 137.5 384 154.5V192H336V160H256zM88 224C118.9 224 144 249.1 144 280C144 310.9 118.9 336 88 336H80V368C80 376.8 72.84 384 64 384C55.16 384 48 376.8 48 368V240C48 231.2 55.16 224 64 224H88zM112 280C112 266.7 101.3 256 88 256H80V304H88C101.3 304 112 293.3 112 280zM160 240C160 231.2 167.2 224 176 224H200C226.5 224 248 245.5 248 272V336C248 362.5 226.5 384 200 384H176C167.2 384 160 376.8 160 368V240zM192 352H200C208.8 352 216 344.8 216 336V272C216 263.2 208.8 256 200 256H192V352zM336 224C344.8 224 352 231.2 352 240C352 248.8 344.8 256 336 256H304V288H336C344.8 288 352 295.2 352 304C352 312.8 344.8 320 336 320H304V368C304 376.8 296.8 384 288 384C279.2 384 272 376.8 272 368V240C272 231.2 279.2 224 288 224H336z\"/></svg>",
|
|
3134
|
+
"file_pdf_solid": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\"><path d=\"M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM64 224H88c30.9 0 56 25.1 56 56s-25.1 56-56 56H80v32c0 8.8-7.2 16-16 16s-16-7.2-16-16V320 240c0-8.8 7.2-16 16-16zm24 80c13.3 0 24-10.7 24-24s-10.7-24-24-24H80v48h8zm72-64c0-8.8 7.2-16 16-16h24c26.5 0 48 21.5 48 48v64c0 26.5-21.5 48-48 48H176c-8.8 0-16-7.2-16-16V240zm32 112h8c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16h-8v96zm96-128h48c8.8 0 16 7.2 16 16s-7.2 16-16 16H304v32h32c8.8 0 16 7.2 16 16s-7.2 16-16 16H304v48c0 8.8-7.2 16-16 16s-16-7.2-16-16V304 240c0-8.8 7.2-16 16-16z\"/></svg>",
|
|
2330
3135
|
"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>",
|
|
2331
3136
|
"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>",
|
|
3137
|
+
"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>",
|
|
3138
|
+
"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>",
|
|
2332
3139
|
"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>",
|
|
2333
3140
|
"xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 50 50\"><path d=\"M31.42,40.17H13.87c-2.15,0-2.71-.56-2.71-2.72V12.88c0-2.15.56-2.71,2.71-2.71H25.48l8.66,8.88v3.43H32.8V19.6l-7.88-8.09H13.87c-1.37,0-1.37,0-1.37,1.37V37.45c0,1.37,0,1.37,1.37,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=\"M25.2,10.84v6.44c0,1.78.27,2,2,2h6.23Z\" fill=\"#484f60\"/><path d=\"M19.14,24.27v9h19.7v-9Zm5.36,7.41-1.3-2-1.3,2H20.48l2-3.06-1.81-2.8h1.38l1.18,1.88,1.15-1.88h1.37l-1.83,2.85,2,3Zm7.67,0h-1.1V27.07l-1.16,4.61H28.77l-1.16-4.61v4.61H26.52V25.82h1.76l1.07,4,1-4h1.77Zm5.33,0H33.38V25.87h1.18v4.82H37.5Z\" fill=\"#484f60\"/></svg>"
|
|
2334
3141
|
};
|
|
@@ -2397,8 +3204,13 @@
|
|
|
2397
3204
|
Icon["DeleteLeftRegular"] = "delete_left_regular";
|
|
2398
3205
|
Icon["DeliveryTruck"] = "delivery_truck";
|
|
2399
3206
|
Icon["Email"] = "email";
|
|
3207
|
+
Icon["EnvelopeRegular"] = "envelope_regular";
|
|
3208
|
+
Icon["FilePdfRegular"] = "file_pdf_regular";
|
|
3209
|
+
Icon["FilePdfSolid"] = "file_pdf_solid";
|
|
2400
3210
|
Icon["Pdf"] = "pdf";
|
|
2401
3211
|
Icon["Print"] = "print";
|
|
3212
|
+
Icon["PrintRegular"] = "print_regular";
|
|
3213
|
+
Icon["PrintSolid"] = "print_solid";
|
|
2402
3214
|
Icon["SignatureField"] = "signature_field";
|
|
2403
3215
|
Icon["Xml"] = "xml";
|
|
2404
3216
|
})(Icon || (Icon = {}));
|
|
@@ -2490,12 +3302,14 @@
|
|
|
2490
3302
|
});
|
|
2491
3303
|
};
|
|
2492
3304
|
StockInformationGridComponent.prototype.openSendMethodDialog = function (data) {
|
|
2493
|
-
this._stockService.
|
|
2494
|
-
|
|
3305
|
+
if (!(this._stockService.printLayoutParams instanceof printPriceStickers_bo.PrintPriceStickers)) {
|
|
3306
|
+
this._stockService.printLayoutParams.goodId = data.goodId;
|
|
3307
|
+
this._stockService.printLayoutParams.warehouse = data.warehouseNo;
|
|
3308
|
+
}
|
|
2495
3309
|
this.showSendMethodDialog = !this.showSendMethodDialog;
|
|
2496
3310
|
};
|
|
2497
3311
|
StockInformationGridComponent.prototype.printStockStickers = function () {
|
|
2498
|
-
this._stockService.getPrintStockStickers(this._stockService.
|
|
3312
|
+
this._stockService.getPrintStockStickers(this._stockService.printLayoutParams);
|
|
2499
3313
|
};
|
|
2500
3314
|
StockInformationGridComponent.prototype.onOkClick = function () {
|
|
2501
3315
|
};
|
|
@@ -2732,42 +3546,57 @@
|
|
|
2732
3546
|
this.showPrintOption = true;
|
|
2733
3547
|
this.showPdfOption = true;
|
|
2734
3548
|
this.showXmlOption = true;
|
|
2735
|
-
this.showPrintPriceStickers =
|
|
2736
|
-
this.showPrintStockStickers = true;
|
|
3549
|
+
this.showPrintPriceStickers = true;
|
|
2737
3550
|
this.sendOptions = [
|
|
2738
3551
|
{ option: SendOption.Email,
|
|
2739
|
-
iconName: this.icons.
|
|
3552
|
+
iconName: this.icons.EnvelopeRegular,
|
|
2740
3553
|
},
|
|
2741
3554
|
{ option: SendOption.Print,
|
|
2742
|
-
iconName: this.icons.
|
|
3555
|
+
iconName: this.icons.PrintRegular,
|
|
2743
3556
|
},
|
|
2744
3557
|
{ option: SendOption.Pdf,
|
|
2745
|
-
iconName: this.icons.
|
|
3558
|
+
iconName: this.icons.FilePdfRegular,
|
|
2746
3559
|
},
|
|
2747
3560
|
{ option: SendOption.Xml,
|
|
2748
|
-
iconName: this.icons.
|
|
3561
|
+
iconName: this.icons.FilePdfRegular,
|
|
2749
3562
|
}
|
|
2750
3563
|
];
|
|
2751
3564
|
this.activeSendOption = SendOption.Email;
|
|
2752
3565
|
this.showStandardPrinterOptions = false;
|
|
2753
3566
|
this.showPrinterSelections = false;
|
|
2754
3567
|
this.showExitButton = true;
|
|
3568
|
+
this.printTemplates = [];
|
|
2755
3569
|
this.printTemplatesField = { text: "name", value: "reportId" };
|
|
3570
|
+
this.emailLayoutField = { text: "name", value: "reportId" };
|
|
2756
3571
|
this.priceListDataField = { text: "name", value: "priceListCode" };
|
|
2757
3572
|
this.upAndLoaded = false;
|
|
2758
|
-
this.emails = ['lars.vdv@colijn-it.nl', 'david@colijn-it.nl', 'ruben@colijn-it.nl'];
|
|
2759
3573
|
this.models = [false, false, true];
|
|
2760
|
-
this.layouts = ['Layout 1', 'Layout 2', 'Layout 3'];
|
|
2761
3574
|
this.showDialog = false;
|
|
3575
|
+
this.emailAdresses = [];
|
|
3576
|
+
this.printLayouts = [];
|
|
3577
|
+
this.isDocSignEnabled = false;
|
|
3578
|
+
this.docSign = false;
|
|
2762
3579
|
this.startSignatureClicked = new i0.EventEmitter();
|
|
3580
|
+
this.sendEmailClicked = new i0.EventEmitter();
|
|
2763
3581
|
this.printButtonClicked = new i0.EventEmitter();
|
|
3582
|
+
this.emailLayoutClicked = new i0.EventEmitter();
|
|
3583
|
+
this.printTemplatesClicked = new i0.EventEmitter();
|
|
3584
|
+
this.defaultSendMethodClicked = new i0.EventEmitter();
|
|
3585
|
+
this.printLayoutParams = new i0.EventEmitter();
|
|
3586
|
+
this.sendMethodParams = new /** @class */ (function () {
|
|
3587
|
+
function class_1() {
|
|
3588
|
+
}
|
|
3589
|
+
return class_1;
|
|
3590
|
+
}());
|
|
2764
3591
|
this._subscriptions = [];
|
|
2765
3592
|
this._subscriptions.push(this._optionsService.optionsLoaded.subscribe(function (loaded) { return _this._handleSettingsLoaded(loaded); }));
|
|
2766
3593
|
}
|
|
2767
3594
|
Object.defineProperty(SendMethodDialogComponent.prototype, "articleData", {
|
|
2768
3595
|
set: function (data) {
|
|
2769
|
-
this.
|
|
2770
|
-
|
|
3596
|
+
if (!(this.printLayoutParams instanceof printPriceStickers_bo.PrintPriceStickers)) {
|
|
3597
|
+
this.sendMethodParams.goodId = data.goodId;
|
|
3598
|
+
this.sendMethodParams.warehouse = data.warehouseNo;
|
|
3599
|
+
}
|
|
2771
3600
|
},
|
|
2772
3601
|
enumerable: false,
|
|
2773
3602
|
configurable: true
|
|
@@ -2776,6 +3605,10 @@
|
|
|
2776
3605
|
SendMethodDialogComponent.prototype.showClass = function () {
|
|
2777
3606
|
return true;
|
|
2778
3607
|
};
|
|
3608
|
+
SendMethodDialogComponent.prototype.ngOnInit = function () {
|
|
3609
|
+
this.getDefaultSendMethod();
|
|
3610
|
+
this.getDefaultEmailLayouts();
|
|
3611
|
+
};
|
|
2779
3612
|
SendMethodDialogComponent.prototype.ngOnDestroy = function () {
|
|
2780
3613
|
this._subscriptions.forEach(function (subscription) { return subscription.unsubscribe(); });
|
|
2781
3614
|
};
|
|
@@ -2793,12 +3626,16 @@
|
|
|
2793
3626
|
this.showDialog = false;
|
|
2794
3627
|
};
|
|
2795
3628
|
SendMethodDialogComponent.prototype.handleSignatureStart = function () {
|
|
3629
|
+
this.docSign = !this.docSign;
|
|
2796
3630
|
this.startSignatureClicked.emit();
|
|
2797
3631
|
};
|
|
3632
|
+
SendMethodDialogComponent.prototype.sendEmail = function () {
|
|
3633
|
+
this.sendEmailClicked.emit();
|
|
3634
|
+
this.printLayoutParams.emit(this.sendMethodParams);
|
|
3635
|
+
};
|
|
2798
3636
|
SendMethodDialogComponent.prototype.handlePrintClicked = function () {
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
this.stockService.getPrintStockStickers(this.stockService.printSticker);
|
|
3637
|
+
if (this.sendMethodParams.printerName) {
|
|
3638
|
+
this.printButtonClicked.emit();
|
|
2802
3639
|
}
|
|
2803
3640
|
};
|
|
2804
3641
|
SendMethodDialogComponent.prototype.togglePrinterSelection = function () {
|
|
@@ -2814,17 +3651,22 @@
|
|
|
2814
3651
|
};
|
|
2815
3652
|
SendMethodDialogComponent.prototype.onPrinterClicked = function (printer) {
|
|
2816
3653
|
this.defaultPrinter = printer.name;
|
|
2817
|
-
this.
|
|
3654
|
+
this.sendMethodParams.printerName = printer.name;
|
|
2818
3655
|
this.showPrinterSelections = !this.showPrinterSelections;
|
|
2819
3656
|
};
|
|
2820
3657
|
SendMethodDialogComponent.prototype.getPrintTemplates = function () {
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
3658
|
+
this.printTemplatesClicked.emit();
|
|
3659
|
+
};
|
|
3660
|
+
SendMethodDialogComponent.prototype.getDefaultSendMethod = function () {
|
|
3661
|
+
this.defaultSendMethodClicked.emit();
|
|
3662
|
+
};
|
|
3663
|
+
SendMethodDialogComponent.prototype.getDefaultEmailLayouts = function () {
|
|
3664
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3665
|
+
return __generator(this, function (_a) {
|
|
3666
|
+
this.emailLayoutClicked.emit();
|
|
3667
|
+
return [2 /*return*/];
|
|
2826
3668
|
});
|
|
2827
|
-
}
|
|
3669
|
+
});
|
|
2828
3670
|
};
|
|
2829
3671
|
SendMethodDialogComponent.prototype._handleSettingsLoaded = function (loaded) {
|
|
2830
3672
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -2868,7 +3710,7 @@
|
|
|
2868
3710
|
SendMethodDialogComponent.decorators = [
|
|
2869
3711
|
{ type: i0.Component, args: [{
|
|
2870
3712
|
selector: "ione-send-method-dialog",
|
|
2871
|
-
template: "\n <div class=\"send-method-dialog-wrapper\">\n <co-dialog
|
|
3713
|
+
template: "\n <div class=\"send-method-dialog-wrapper\">\n <co-dialog id=\"sendOptionsDialog\" [headerTemplate]=\"headerTemplate\" *ngIf=\"showDialog\" [showCloseIcon]=\"showExitButton\" (closeClick)=\"closeDialogClick()\">\n <ng-template #headerTemplate>\n <h2 [textContent]=\"headerTitle\"></h2>\n </ng-template>\n <div class=\"dialog-content-wrapper\">\n <div class=\"main-content-container\" *ngIf=\"!showPrinterSelections\">\n <div class=\"send-options-wrapper\">\n <div class=\"custom-button-wrapper\"\n *ngFor=\"let sendOption of sendOptions\"\n [class.selected-option]=\"sendOption.option === activeSendOption\"\n (click)=\"activeSendOption = sendOption.option\">\n <co-icon [iconData]=\"iconCacheService.getIcon(sendOption.iconName)\"></co-icon>\n </div>\n </div>\n\n <div class=\"email-option-content\" *ngIf=\"activeSendOption === sendOption.Email || activeSendOption === sendOption.Pdf\">\n <div class=\"emails-container\" *ngIf=\"activeSendOption === sendOption.Email\">\n <co-input-checkbox\n *ngFor=\"let email of emailAdresses\"\n [(model)]=\"email.name\"\n [label]=\"email\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n </div>\n\n <div class=\"lov-wrapper\" (click)=\"getDefaultEmailLayouts()\">\n <co-input-combo-box\n [(model)]=\"sendMethodParams.reportId\"\n [collection]=\"emailLayouts\"\n [fields]=\"emailLayoutField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n\n <div *ngIf=\"isDocSignEnabled\" class=\"signature-button-wrapper\">\n <div class=\"custom-button-wrapper signature-button\" (click)=\"handleSignatureStart()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.SignatureField)\"></co-icon>\n </div>\n <div class=\"custom-button-wrapper send-button\" (click)=\"sendEmail()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.Email)\"></co-icon>\n </div>\n </div>\n\n <ione-docsign *ngIf=\"docSign\"></ione-docsign>\n </div>\n\n <div class=\"email-option-content\" *ngIf=\"activeSendOption === sendOption.Print\" (click)=\"getPrintTemplates()\">\n <div *ngIf=\"showPrintPriceStickers\">\n <div class=\"lov-wrapper\">\n <co-input-combo-box\n [(model)]=\"sendMethodParams.reportId\"\n [collection]=\"printLayouts\"\n [fields]=\"printTemplatesField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n <div class=\"lov-wrapper\" *ngIf=\"priceListCodeData\">\n <co-input-combo-box\n [(model)]=\"sendMethodParams.priceListCode\"\n [collection]=\"priceListCodeData\"\n [fields]=\"priceListDataField\"\n placeholder=\"Layout\"\n ></co-input-combo-box>\n </div>\n </div>\n\n <div class=\"lov-wrapper clickable\" (click)=\"togglePrinterSelection()\">\n <div class=\"selected-printer-wrapper\">\n <div class=\"printer-option-list-item\">\n <co-icon class=\"printer-icon\" [iconData]=\"iconCacheService.getIcon(icons.PrintRegular)\"></co-icon>\n <div class=\"printer-details\" *ngIf=\"printerList\">\n <span class=\"printer-name\" [textContent]=\"defaultPrinter\"></span>\n <span class=\"printer-status\" [textContent]=\"defaultPrinter.acceptingJobs\"></span>\n </div>\n </div>\n <co-icon class=\"select-printer-arrow\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\"></co-icon>\n </div>\n </div>\n\n <div class=\"standard-printer-wrapper\">\n <div class=\"standard-printer-link\" (click)=\"showStandardPrinterOptions = !showStandardPrinterOptions\">\n <co-icon class=\"arrow-icon\" [iconData]=\"iconCacheService.getIcon(icons.ArrowFatRight)\"></co-icon>\n <span class=\"standard-printer-message\" [textContent]=\"'Standaard printer voor lay-out instellen'\"></span>\n </div>\n\n <div class=\"standard-printer-selections\" *ngIf=\"showStandardPrinterOptions\">\n <co-input-checkbox\n [(model)]=\"models[0]\"\n [label]=\"'Per gebruiker instellen'\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n <co-input-checkbox\n [(model)]=\"models[1]\"\n [label]=\"'Voor alle gebruikers instellen'\"\n [cssClass]=\"'input-checkbox-wrapper'\"\n ></co-input-checkbox>\n </div>\n </div>\n\n <div class=\"print-footer-wrapper\">\n <div class=\"input-number-wrapper\">\n <co-input-number-picker class=\"number-picker\"\n [step]=\"1\" [(model)]=\"sendMethodParams.amount\" [min]=\"1\"\n [ngModelOptions]=\"{debounce: 1}\">\n </co-input-number-picker>\n </div>\n <div class=\"custom-button-wrapper print-button\" (click)=\"handlePrintClicked()\">\n <span [textContent]=\"'Print'\"></span>\n </div>\n <div class=\"custom-button-wrapper signature-button\" (click)=\"handleSignatureStart()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.SignatureField)\"></co-icon>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"printer-content-container\" @slideInOut *ngIf=\"showPrinterSelections\">\n <div class=\"selected-printer-wrapper selection clickable\" *ngFor=\"let printers of printerList\" (click)=\"onPrinterClicked(printers)\">\n <div class=\"printer-option-list-item\">\n <co-icon class=\"printer-icon\" [iconData]=\"iconCacheService.getIcon(icons.PrintRegular)\"></co-icon>\n <div class=\"printer-details\">\n <span class=\"printer-name\" [textContent]=\"printers.name\"></span>\n <span class=\"printer-status\" [textContent]=\"printers.acceptingJobs\"></span>\n </div>\n </div>\n <co-icon class=\"select-printer-arrow\" *ngIf=\"!showPrinterSelections\"\n [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\"></co-icon>\n </div>\n </div>\n </div>\n </co-dialog>\n </div>\n ",
|
|
2872
3714
|
encapsulation: i0.ViewEncapsulation.None,
|
|
2873
3715
|
animations: [
|
|
2874
3716
|
animations.trigger('slideInOut', [
|
|
@@ -2892,15 +3734,28 @@
|
|
|
2892
3734
|
showPdfOption: [{ type: i0.Input }],
|
|
2893
3735
|
showXmlOption: [{ type: i0.Input }],
|
|
2894
3736
|
showPrintPriceStickers: [{ type: i0.Input }],
|
|
2895
|
-
showPrintStockStickers: [{ type: i0.Input }],
|
|
2896
3737
|
priceListCodeData: [{ type: i0.Input }],
|
|
3738
|
+
transactionUUID: [{ type: i0.Input }],
|
|
2897
3739
|
showDialog: [{ type: i0.Input }],
|
|
2898
3740
|
headerTitle: [{ type: i0.Input }],
|
|
2899
3741
|
printerList: [{ type: i0.Input }],
|
|
3742
|
+
relationId: [{ type: i0.Input }],
|
|
3743
|
+
emailAdresses: [{ type: i0.Input }],
|
|
3744
|
+
emailLayouts: [{ type: i0.Input }],
|
|
3745
|
+
printLayouts: [{ type: i0.Input }],
|
|
3746
|
+
defaultSendMethod: [{ type: i0.Input }],
|
|
3747
|
+
defaultEmailAdresses: [{ type: i0.Input }],
|
|
3748
|
+
isDocSignEnabled: [{ type: i0.Input }],
|
|
3749
|
+
docSign: [{ type: i0.Input }],
|
|
2900
3750
|
articleData: [{ type: i0.Input }],
|
|
2901
3751
|
startSignatureClicked: [{ type: i0.Output }],
|
|
3752
|
+
sendEmailClicked: [{ type: i0.Output }],
|
|
2902
3753
|
printButtonClicked: [{ type: i0.Output }],
|
|
2903
|
-
|
|
3754
|
+
emailLayoutClicked: [{ type: i0.Output }],
|
|
3755
|
+
showClass: [{ type: i0.HostBinding, args: ["class.ione-send-method-dialog",] }],
|
|
3756
|
+
printTemplatesClicked: [{ type: i0.Output }],
|
|
3757
|
+
defaultSendMethodClicked: [{ type: i0.Output }],
|
|
3758
|
+
printLayoutParams: [{ type: i0.Output }]
|
|
2904
3759
|
};
|
|
2905
3760
|
|
|
2906
3761
|
var SendMethodDialogModule = /** @class */ (function () {
|
|
@@ -2921,7 +3776,9 @@
|
|
|
2921
3776
|
corecomponents_v12.IconModule,
|
|
2922
3777
|
corecomponents_v12.InputNumberPickerModule,
|
|
2923
3778
|
corecomponents_v12.CoDialogWizardModule,
|
|
2924
|
-
corecomponents_v12.ButtonModule
|
|
3779
|
+
corecomponents_v12.ButtonModule,
|
|
3780
|
+
DocsignModule,
|
|
3781
|
+
corecomponents_v12.CoDialogModule
|
|
2925
3782
|
],
|
|
2926
3783
|
exports: [
|
|
2927
3784
|
SendMethodDialogComponent
|
|
@@ -3417,11 +4274,12 @@
|
|
|
3417
4274
|
};
|
|
3418
4275
|
;
|
|
3419
4276
|
CoCircularGaugeComponent.prototype.getAnnotations = function () {
|
|
3420
|
-
if (this.value
|
|
3421
|
-
var label = this.value ? this.value + "%" : "0%";
|
|
4277
|
+
if (this.value) {
|
|
3422
4278
|
return [{
|
|
3423
|
-
content: '<div class="annotation"
|
|
3424
|
-
|
|
4279
|
+
content: '<div class="annotation">' +
|
|
4280
|
+
this.value + '%</div>',
|
|
4281
|
+
angle: 90,
|
|
4282
|
+
radius: '50%',
|
|
3425
4283
|
zIndex: '10',
|
|
3426
4284
|
}];
|
|
3427
4285
|
}
|
|
@@ -3590,7 +4448,7 @@
|
|
|
3590
4448
|
StatusbarComponent.decorators = [
|
|
3591
4449
|
{ type: i0.Component, args: [{
|
|
3592
4450
|
selector: "co-statusbar",
|
|
3593
|
-
template: "\n <div class=\"co-statusbar-wrapper\"\n *ngIf=\"statusbarData\"\n (mouseover)=\"onHover($event)\"\n (mouseleave)=\"onLeave()\"\n (click)=\"onStatusbarClick()\">\n <div class=\"statuses\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status\">\n <co-linear-gauge [value]=\"data.percentage\" [count]=\"
|
|
4451
|
+
template: "\n <div class=\"co-statusbar-wrapper\"\n *ngIf=\"statusbarData\"\n (mouseover)=\"onHover($event)\"\n (mouseleave)=\"onLeave()\"\n (click)=\"onStatusbarClick()\">\n <div class=\"statuses\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status\">\n <co-linear-gauge [class.focused-status]=\"focusedStatusIndex !== undefined && focusedStatusIndex === index\"\n [value]=\"data.percentage\" [count]=\"data.count ? data.count : undefined\"></co-linear-gauge>\n </div>\n </div>\n <div class=status-description-popup *ngIf=\"showPopup\" @showHidePopup [ngClass]=\"popupClass\">\n <div class=\"status-descriptions\">\n <div *ngFor=\"let data of statusbarData; let index = index\" class=\"status-description\">\n <co-circular-gauge [value]=\"data.percentage\"></co-circular-gauge>\n <span [textContent]=\"data.label\"></span>\n </div>\n </div>\n </div>\n </div>\n ",
|
|
3594
4452
|
animations: [
|
|
3595
4453
|
animations.trigger("showHidePopup", [
|
|
3596
4454
|
animations.state("void", animations.style({ opacity: 0 })),
|
|
@@ -3604,6 +4462,7 @@
|
|
|
3604
4462
|
StatusbarComponent.ctorParameters = function () { return []; };
|
|
3605
4463
|
StatusbarComponent.propDecorators = {
|
|
3606
4464
|
statusbarData: [{ type: i0.Input }],
|
|
4465
|
+
focusedStatusIndex: [{ type: i0.Input }],
|
|
3607
4466
|
statusbarClick: [{ type: i0.Output }],
|
|
3608
4467
|
showClass: [{ type: i0.HostBinding, args: ["class.co-statusbar",] }]
|
|
3609
4468
|
};
|
|
@@ -3629,6 +4488,1763 @@
|
|
|
3629
4488
|
},] }
|
|
3630
4489
|
];
|
|
3631
4490
|
|
|
4491
|
+
var DatePlanningComponent = /** @class */ (function () {
|
|
4492
|
+
function DatePlanningComponent(_changeDetector, renderer) {
|
|
4493
|
+
this._changeDetector = _changeDetector;
|
|
4494
|
+
this.renderer = renderer;
|
|
4495
|
+
this.calendarNavigation = false;
|
|
4496
|
+
this.showButton = false;
|
|
4497
|
+
this.buttonLabel = "";
|
|
4498
|
+
this.eventsPerDay = [];
|
|
4499
|
+
this.eventChecked = new i0.EventEmitter();
|
|
4500
|
+
this.selectedDateChange = new i0.EventEmitter();
|
|
4501
|
+
this.rangeChange = new i0.EventEmitter();
|
|
4502
|
+
this.viewChange = new i0.EventEmitter();
|
|
4503
|
+
this.buttonClick = new i0.EventEmitter();
|
|
4504
|
+
this.days = [];
|
|
4505
|
+
this._selectedDate = new Date();
|
|
4506
|
+
}
|
|
4507
|
+
DatePlanningComponent.prototype.doChangeSelectedDate = function (date, rangeChanged) {
|
|
4508
|
+
if (rangeChanged === void 0) { rangeChanged = false; }
|
|
4509
|
+
this.selectedDate = new Date(date);
|
|
4510
|
+
if (rangeChanged) {
|
|
4511
|
+
this.rangeChange.next(this.selectedDate);
|
|
4512
|
+
}
|
|
4513
|
+
else {
|
|
4514
|
+
this.selectedDateChange.next(this.selectedDate);
|
|
4515
|
+
}
|
|
4516
|
+
this._changeDetector.detectChanges();
|
|
4517
|
+
};
|
|
4518
|
+
DatePlanningComponent.prototype.doChangeView = function (view) {
|
|
4519
|
+
this.view = view;
|
|
4520
|
+
this.viewChange.next(this.view);
|
|
4521
|
+
};
|
|
4522
|
+
DatePlanningComponent.prototype.scrollToDayStart = function () {
|
|
4523
|
+
if (this.dayStart !== undefined) {
|
|
4524
|
+
var dayStart_1 = this.renderer.selectRootElement("#dayStart");
|
|
4525
|
+
if (dayStart_1) {
|
|
4526
|
+
setTimeout(function () {
|
|
4527
|
+
dayStart_1.scrollIntoView({ behavior: "instant", block: "center" });
|
|
4528
|
+
});
|
|
4529
|
+
}
|
|
4530
|
+
}
|
|
4531
|
+
};
|
|
4532
|
+
return DatePlanningComponent;
|
|
4533
|
+
}());
|
|
4534
|
+
DatePlanningComponent.decorators = [
|
|
4535
|
+
{ type: i0.Component, args: [{
|
|
4536
|
+
selector: "sc-date-planning",
|
|
4537
|
+
template: "\n <div class=\"sc-agenda\">\n <div class=\"content-wrapper\">\n <calendar *ngIf=\"calendarNavigation\"\n [view]=\"view\"\n [(days)]=\"days\"\n [selectedDate]=\"selectedDate\" (selectedDateChange)=\"doChangeSelectedDate($event)\"></calendar>\n <div class=\"agenda-content-wrapper mini-scrollbar\">\n <div class=\"agenda-content\">\n <agenda-header [view]=\"view\" (viewChange)=\"doChangeView($event)\"\n [firstAvailableDate]=\"firstAvailableDate\"\n [eventsPerDay]=\"eventsPerDay\"\n [selectedDate]=\"selectedDate\"\n (selectedDateChange)=\"doChangeSelectedDate($event)\"\n (rangeChange)=\"doChangeSelectedDate($event, true)\"></agenda-header>\n <agenda-view [view]=\"view\"\n [selectedDate]=\"selectedDate\"\n [eventsPerDay]=\"eventsPerDay\"\n (eventChecked)=\"eventChecked.emit($event)\"></agenda-view>\n </div>\n </div>\n </div>\n </div>\n <co-button *ngIf=\"showButton && eventsPerDay.length > 0\" class=\"text-only select-agenda-button\"\n [label]=\"buttonLabel\"\n (click)=\"buttonClick.emit($event)\">\n </co-button>\n ",
|
|
4538
|
+
animations: [
|
|
4539
|
+
animations.trigger("showHideWindow", [
|
|
4540
|
+
animations.state("void", animations.style({ transform: "scaleY(0)" })),
|
|
4541
|
+
animations.state("*", animations.style({ transform: "scaleY(1)" })),
|
|
4542
|
+
animations.transition(":enter, :leave", [
|
|
4543
|
+
animations.animate("200ms ease-in-out")
|
|
4544
|
+
])
|
|
4545
|
+
])
|
|
4546
|
+
],
|
|
4547
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
4548
|
+
},] }
|
|
4549
|
+
];
|
|
4550
|
+
DatePlanningComponent.ctorParameters = function () { return [
|
|
4551
|
+
{ type: i0.ChangeDetectorRef },
|
|
4552
|
+
{ type: i0.Renderer2 }
|
|
4553
|
+
]; };
|
|
4554
|
+
DatePlanningComponent.propDecorators = {
|
|
4555
|
+
calendarNavigation: [{ type: i0.Input }],
|
|
4556
|
+
showButton: [{ type: i0.Input }],
|
|
4557
|
+
selectedDate: [{ type: i0.Input }],
|
|
4558
|
+
firstAvailableDate: [{ type: i0.Input }],
|
|
4559
|
+
buttonLabel: [{ type: i0.Input }],
|
|
4560
|
+
eventsPerDay: [{ type: i0.Input }],
|
|
4561
|
+
view: [{ type: i0.Input }],
|
|
4562
|
+
eventChecked: [{ type: i0.Output }],
|
|
4563
|
+
selectedDateChange: [{ type: i0.Output }],
|
|
4564
|
+
rangeChange: [{ type: i0.Output }],
|
|
4565
|
+
viewChange: [{ type: i0.Output }],
|
|
4566
|
+
buttonClick: [{ type: i0.Output }],
|
|
4567
|
+
dayStart: [{ type: i0.ViewChild, args: ["dayStart", { static: true },] }]
|
|
4568
|
+
};
|
|
4569
|
+
|
|
4570
|
+
var CalendarAllYearsComponent = /** @class */ (function () {
|
|
4571
|
+
function CalendarAllYearsComponent() {
|
|
4572
|
+
this.yearChange = new i0.EventEmitter();
|
|
4573
|
+
this.years = [];
|
|
4574
|
+
}
|
|
4575
|
+
CalendarAllYearsComponent.prototype.ngOnInit = function () {
|
|
4576
|
+
this.years.length = 0;
|
|
4577
|
+
var start = this._determineStart();
|
|
4578
|
+
var end = start + 11;
|
|
4579
|
+
while (start < end) {
|
|
4580
|
+
this.years.push(start);
|
|
4581
|
+
start++;
|
|
4582
|
+
}
|
|
4583
|
+
};
|
|
4584
|
+
CalendarAllYearsComponent.prototype._determineStart = function () {
|
|
4585
|
+
if (this.year > 0) {
|
|
4586
|
+
var thisYear = this.year;
|
|
4587
|
+
var thisYearLastDigit = parseInt(thisYear.toString().split("").pop());
|
|
4588
|
+
while (thisYearLastDigit > 0) {
|
|
4589
|
+
thisYear--;
|
|
4590
|
+
thisYearLastDigit = parseInt(thisYear.toString().split("").pop());
|
|
4591
|
+
}
|
|
4592
|
+
return thisYear;
|
|
4593
|
+
}
|
|
4594
|
+
return 0;
|
|
4595
|
+
};
|
|
4596
|
+
return CalendarAllYearsComponent;
|
|
4597
|
+
}());
|
|
4598
|
+
CalendarAllYearsComponent.decorators = [
|
|
4599
|
+
{ type: i0.Component, args: [{
|
|
4600
|
+
selector: "calendar-all-years",
|
|
4601
|
+
template: "\n <div *ngFor=\"let currentYear of years\"\n [textContent]=\"currentYear\"\n [class.selected-year]=\"currentYear === year\"\n class=\"pointer-hover\"\n (click)=\"year = currentYear; yearChange.emit(year)\"\n ></div>\n ",
|
|
4602
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
4603
|
+
},] }
|
|
4604
|
+
];
|
|
4605
|
+
CalendarAllYearsComponent.ctorParameters = function () { return []; };
|
|
4606
|
+
CalendarAllYearsComponent.propDecorators = {
|
|
4607
|
+
year: [{ type: i0.Input }],
|
|
4608
|
+
yearChange: [{ type: i0.Output }]
|
|
4609
|
+
};
|
|
4610
|
+
|
|
4611
|
+
// All the months. Values are corresponding dictionary keys in text_nl.
|
|
4612
|
+
var Month$1;
|
|
4613
|
+
(function (Month) {
|
|
4614
|
+
Month["January"] = "JANUARY";
|
|
4615
|
+
Month["Februrary"] = "FEBRUARY";
|
|
4616
|
+
Month["March"] = "MARCH";
|
|
4617
|
+
Month["April"] = "APRIL";
|
|
4618
|
+
Month["May"] = "MAY";
|
|
4619
|
+
Month["June"] = "JUNE";
|
|
4620
|
+
Month["July"] = "JULY";
|
|
4621
|
+
Month["August"] = "AUGUST";
|
|
4622
|
+
Month["September"] = "SEPTEMBER";
|
|
4623
|
+
Month["October"] = "OCTOBER";
|
|
4624
|
+
Month["November"] = "NOVEMBER";
|
|
4625
|
+
Month["December"] = "DECEMBER";
|
|
4626
|
+
})(Month$1 || (Month$1 = {}));
|
|
4627
|
+
|
|
4628
|
+
// All the months in a year. The order is important, and should remain January - to December!
|
|
4629
|
+
var ALL_MONTHS = [
|
|
4630
|
+
Month$1.January,
|
|
4631
|
+
Month$1.Februrary,
|
|
4632
|
+
Month$1.March,
|
|
4633
|
+
Month$1.April,
|
|
4634
|
+
Month$1.May,
|
|
4635
|
+
Month$1.June,
|
|
4636
|
+
Month$1.July,
|
|
4637
|
+
Month$1.August,
|
|
4638
|
+
Month$1.September,
|
|
4639
|
+
Month$1.October,
|
|
4640
|
+
Month$1.November,
|
|
4641
|
+
Month$1.December
|
|
4642
|
+
];
|
|
4643
|
+
|
|
4644
|
+
var CalendarAllMonthsComponent = /** @class */ (function () {
|
|
4645
|
+
function CalendarAllMonthsComponent() {
|
|
4646
|
+
this.shortDescriptions = false;
|
|
4647
|
+
this.monthChange = new i0.EventEmitter();
|
|
4648
|
+
this.months = [];
|
|
4649
|
+
}
|
|
4650
|
+
CalendarAllMonthsComponent.prototype.ngOnInit = function () {
|
|
4651
|
+
this.months.length = 0;
|
|
4652
|
+
this.months = ALL_MONTHS;
|
|
4653
|
+
};
|
|
4654
|
+
return CalendarAllMonthsComponent;
|
|
4655
|
+
}());
|
|
4656
|
+
CalendarAllMonthsComponent.decorators = [
|
|
4657
|
+
{ type: i0.Component, args: [{
|
|
4658
|
+
selector: "calendar-all-months",
|
|
4659
|
+
template: "\n <div *ngFor=\"let currentMonth of months; let index = index\"\n [class.selected-month]=\"month === index\"\n [textContent]=\"currentMonth\"\n class=\"pointer-hover\"\n (click)=\"month = index; monthChange.emit(month)\"\n ></div>\n ",
|
|
4660
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
4661
|
+
},] }
|
|
4662
|
+
];
|
|
4663
|
+
CalendarAllMonthsComponent.ctorParameters = function () { return []; };
|
|
4664
|
+
CalendarAllMonthsComponent.propDecorators = {
|
|
4665
|
+
month: [{ type: i0.Input }],
|
|
4666
|
+
shortDescriptions: [{ type: i0.Input }],
|
|
4667
|
+
monthChange: [{ type: i0.Output }]
|
|
4668
|
+
};
|
|
4669
|
+
|
|
4670
|
+
var CalendarHeaderComponent = /** @class */ (function () {
|
|
4671
|
+
function CalendarHeaderComponent(iconCacheService) {
|
|
4672
|
+
this.iconCacheService = iconCacheService;
|
|
4673
|
+
this.selectedDate = new Date();
|
|
4674
|
+
this.selectedDateChange = new i0.EventEmitter();
|
|
4675
|
+
this.icons = Icon;
|
|
4676
|
+
this.showMonthYearSelect = false;
|
|
4677
|
+
this.expanded = false;
|
|
4678
|
+
}
|
|
4679
|
+
CalendarHeaderComponent.prototype.ngDoCheck = function () {
|
|
4680
|
+
if (this.selectedDate) {
|
|
4681
|
+
this.currentMonth = ALL_MONTHS[this.selectedDate.getMonth()];
|
|
4682
|
+
this.currentYear = this.selectedDate.getFullYear();
|
|
4683
|
+
}
|
|
4684
|
+
};
|
|
4685
|
+
CalendarHeaderComponent.prototype.subMonth = function () {
|
|
4686
|
+
var newDate = new Date(this.selectedDate);
|
|
4687
|
+
newDate.setMonth(newDate.getMonth() - 1);
|
|
4688
|
+
this.selectedDate = newDate;
|
|
4689
|
+
this.selectedDateChange.emit(this.selectedDate);
|
|
4690
|
+
};
|
|
4691
|
+
CalendarHeaderComponent.prototype.addMonth = function () {
|
|
4692
|
+
var newDate = new Date(this.selectedDate);
|
|
4693
|
+
newDate.setMonth(newDate.getMonth() + 1);
|
|
4694
|
+
this.selectedDate = newDate;
|
|
4695
|
+
this.selectedDateChange.emit(this.selectedDate);
|
|
4696
|
+
};
|
|
4697
|
+
CalendarHeaderComponent.prototype.hideMonthYearSelection = function () {
|
|
4698
|
+
this.expanded = false;
|
|
4699
|
+
this.showMonthYearSelect = false;
|
|
4700
|
+
};
|
|
4701
|
+
CalendarHeaderComponent.prototype.setNewMonth = function (month) {
|
|
4702
|
+
this.selectedMonth = month;
|
|
4703
|
+
};
|
|
4704
|
+
CalendarHeaderComponent.prototype.setNewYear = function (year) {
|
|
4705
|
+
this.selectedYear = year;
|
|
4706
|
+
};
|
|
4707
|
+
CalendarHeaderComponent.prototype.changeMonthYear = function () {
|
|
4708
|
+
this.hideMonthYearSelection();
|
|
4709
|
+
var newDate = new Date(this.selectedDate);
|
|
4710
|
+
newDate.setMonth(this.selectedMonth);
|
|
4711
|
+
newDate.setFullYear(this.selectedYear);
|
|
4712
|
+
this.selectedDate = newDate;
|
|
4713
|
+
this.selectedDateChange.emit(this.selectedDate);
|
|
4714
|
+
};
|
|
4715
|
+
return CalendarHeaderComponent;
|
|
4716
|
+
}());
|
|
4717
|
+
CalendarHeaderComponent.decorators = [
|
|
4718
|
+
{ type: i0.Component, args: [{
|
|
4719
|
+
selector: "calendar-header",
|
|
4720
|
+
template: "\n <div #monthYearSelect class=\"calendar-header-row\">\n <co-icon class=\"pointer-hover\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subMonth()\"></co-icon>\n <div (click)=\"showMonthYearSelect = true\">\n <div class=\"month\" [textContent]=\"currentMonth\"></div>\n <div class=\"year\" [textContent]=\"currentYear\"></div>\n </div>\n <co-icon class=\"pointer-hover\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addMonth()\"></co-icon>\n </div>\n <ng-template #template>\n <div *ngIf=\"showMonthYearSelect\"\n (clickOutside)=\"hideMonthYearSelection()\"\n class=\"select-month-year-window\" [class.expanded]=\"expanded\" @showMonthYearSelect\n >\n <div>\n <calendar-all-months [month]=\"currentMonth\" (monthChange)=\"setNewMonth($event)\" shortDescriptions></calendar-all-months>\n <div class=\"vertical-divider\"></div>\n <calendar-all-years [year]=\"currentYear\" (yearChange)=\"setNewYear($event)\"></calendar-all-years>\n </div>\n<!-- <default-ok-cancel-buttons-->\n<!-- (okClick)=\"changeMonthYear()\"-->\n<!-- (cancelClick)=\"showMonthYearSelect = false\"-->\n<!-- >-->\n<!-- </default-ok-cancel-buttons>-->\n </div>\n </ng-template>\n ",
|
|
4721
|
+
encapsulation: i0.ViewEncapsulation.None,
|
|
4722
|
+
animations: [
|
|
4723
|
+
animations.trigger("showMonthYearSelect", [
|
|
4724
|
+
animations.state("void", animations.style({
|
|
4725
|
+
"transform-origin": "top center",
|
|
4726
|
+
transform: "scaleY(0)"
|
|
4727
|
+
})),
|
|
4728
|
+
animations.state("*", animations.style({
|
|
4729
|
+
"transform-origin": "top center",
|
|
4730
|
+
transform: "scaleY(1)"
|
|
4731
|
+
})),
|
|
4732
|
+
animations.transition(":enter, :leave", [
|
|
4733
|
+
animations.animate("200ms ease-in-out")
|
|
4734
|
+
])
|
|
4735
|
+
])
|
|
4736
|
+
]
|
|
4737
|
+
},] }
|
|
4738
|
+
];
|
|
4739
|
+
CalendarHeaderComponent.ctorParameters = function () { return [
|
|
4740
|
+
{ type: IconCacheService }
|
|
4741
|
+
]; };
|
|
4742
|
+
CalendarHeaderComponent.propDecorators = {
|
|
4743
|
+
selectedDate: [{ type: i0.Input }],
|
|
4744
|
+
selectedDateChange: [{ type: i0.Output }]
|
|
4745
|
+
};
|
|
4746
|
+
|
|
4747
|
+
var CalendarView;
|
|
4748
|
+
(function (CalendarView) {
|
|
4749
|
+
CalendarView["DayView"] = "DAY";
|
|
4750
|
+
CalendarView["WeekView"] = "WEEK";
|
|
4751
|
+
CalendarView["WeekSelectView"] = "WEEK_SELECT";
|
|
4752
|
+
CalendarView["MonthView"] = "MONTH";
|
|
4753
|
+
})(CalendarView || (CalendarView = {}));
|
|
4754
|
+
|
|
4755
|
+
var CalendarComponent = /** @class */ (function () {
|
|
4756
|
+
function CalendarComponent() {
|
|
4757
|
+
this.view = CalendarView.WeekView;
|
|
4758
|
+
this.selectedDate = new Date();
|
|
4759
|
+
this.days = [];
|
|
4760
|
+
this.selectedDateChange = new i0.EventEmitter();
|
|
4761
|
+
}
|
|
4762
|
+
CalendarComponent.prototype.changeSelectedDate = function (date) {
|
|
4763
|
+
this.selectedDate = date;
|
|
4764
|
+
this.selectedDateChange.emit(this.selectedDate);
|
|
4765
|
+
};
|
|
4766
|
+
return CalendarComponent;
|
|
4767
|
+
}());
|
|
4768
|
+
CalendarComponent.decorators = [
|
|
4769
|
+
{ type: i0.Component, args: [{
|
|
4770
|
+
selector: "calendar",
|
|
4771
|
+
template: "\n <div class=\"sc-calendar\">\n <calendar-header [selectedDate]=\"selectedDate\" (selectedDateChange)=\"changeSelectedDate($event)\"></calendar-header>\n <calendar-view [view]=\"view\" [selectedDate]=\"selectedDate\" (selectedDateChange)=\"changeSelectedDate($event)\"></calendar-view>\n </div>\n ",
|
|
4772
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
4773
|
+
},] }
|
|
4774
|
+
];
|
|
4775
|
+
CalendarComponent.ctorParameters = function () { return []; };
|
|
4776
|
+
CalendarComponent.propDecorators = {
|
|
4777
|
+
view: [{ type: i0.Input }],
|
|
4778
|
+
selectedDate: [{ type: i0.Input }],
|
|
4779
|
+
days: [{ type: i0.Input }],
|
|
4780
|
+
selectedDateChange: [{ type: i0.Output }]
|
|
4781
|
+
};
|
|
4782
|
+
|
|
4783
|
+
var ArrayNumberPipe = /** @class */ (function () {
|
|
4784
|
+
function ArrayNumberPipe() {
|
|
4785
|
+
}
|
|
4786
|
+
ArrayNumberPipe.prototype.transform = function (length, offset) {
|
|
4787
|
+
if (offset === void 0) { offset = 0; }
|
|
4788
|
+
if (!length || length < 0) {
|
|
4789
|
+
return [];
|
|
4790
|
+
}
|
|
4791
|
+
return Array.from({ length: Math.round(length) }, function (x, i) { return i + offset; });
|
|
4792
|
+
};
|
|
4793
|
+
return ArrayNumberPipe;
|
|
4794
|
+
}());
|
|
4795
|
+
ArrayNumberPipe.decorators = [
|
|
4796
|
+
{ type: i0.Pipe, args: [{
|
|
4797
|
+
name: "arrayNumber"
|
|
4798
|
+
},] }
|
|
4799
|
+
];
|
|
4800
|
+
|
|
4801
|
+
var DateRange = /** @class */ (function () {
|
|
4802
|
+
function DateRange() {
|
|
4803
|
+
}
|
|
4804
|
+
return DateRange;
|
|
4805
|
+
}());
|
|
4806
|
+
|
|
4807
|
+
Date.prototype.toJSON = function () {
|
|
4808
|
+
return moment__namespace(this).format('YYYY-MM-DD[T]HH:mm:ss');
|
|
4809
|
+
};
|
|
4810
|
+
// static utility function holder related to dates
|
|
4811
|
+
var DateUtils = /** @class */ (function () {
|
|
4812
|
+
function DateUtils() {
|
|
4813
|
+
}
|
|
4814
|
+
DateUtils.NowAsString = function () {
|
|
4815
|
+
return DateUtils.ParseDate(new Date(), DateUtils.BACKEND_DATE_FORMAT);
|
|
4816
|
+
};
|
|
4817
|
+
DateUtils.ParseDate = function (date, format) {
|
|
4818
|
+
if (format === void 0) { format = "d-m-y"; }
|
|
4819
|
+
if (!date) {
|
|
4820
|
+
return "";
|
|
4821
|
+
}
|
|
4822
|
+
var day = ("0" + date.getDate()).slice(-2);
|
|
4823
|
+
var month = ("0" + (date.getMonth() + 1)).slice(-2);
|
|
4824
|
+
var year = date.getFullYear() + "";
|
|
4825
|
+
var formatParts = format.split("-");
|
|
4826
|
+
var dateParts = [];
|
|
4827
|
+
for (var i = 0, l = formatParts.length; i < l; i++) {
|
|
4828
|
+
switch (formatParts[i]) {
|
|
4829
|
+
case "d":
|
|
4830
|
+
case "DD":
|
|
4831
|
+
dateParts.push(day);
|
|
4832
|
+
break;
|
|
4833
|
+
case "m":
|
|
4834
|
+
case "MM":
|
|
4835
|
+
dateParts.push(month);
|
|
4836
|
+
break;
|
|
4837
|
+
case "y":
|
|
4838
|
+
case "YYYY":
|
|
4839
|
+
dateParts.push(year);
|
|
4840
|
+
break;
|
|
4841
|
+
default:
|
|
4842
|
+
break;
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4845
|
+
return dateParts.join("-");
|
|
4846
|
+
};
|
|
4847
|
+
DateUtils.GetWeekNumber = function (date) {
|
|
4848
|
+
date = new Date(date.getTime());
|
|
4849
|
+
date.setHours(0, 0, 0, 0);
|
|
4850
|
+
date.setDate(date.getDate() + 4 - (date.getDay() || 7));
|
|
4851
|
+
return Math.ceil((((date.getTime() - new Date(date.getFullYear(), 0, 1).getTime()) / 8.64e7) + 1) / 7);
|
|
4852
|
+
};
|
|
4853
|
+
// Returns the number of days from now, for the given date in the future. Returns negative days if given date is in the past from now.
|
|
4854
|
+
DateUtils.GetDaysFromNow = function (date) {
|
|
4855
|
+
return DateUtils.GetDayDifference(new Date(Date.now()), date);
|
|
4856
|
+
};
|
|
4857
|
+
DateUtils.StringAsDate = function (str, format) {
|
|
4858
|
+
if (format === void 0) { format = DateUtils.BACKEND_DATE_FORMAT; }
|
|
4859
|
+
if (notNill(str)) {
|
|
4860
|
+
if (!isNaN(Number(str))) {
|
|
4861
|
+
return new Date(str);
|
|
4862
|
+
}
|
|
4863
|
+
else {
|
|
4864
|
+
var time = moment__namespace(str, format, true);
|
|
4865
|
+
return time.isValid() ? new Date(time) : undefined;
|
|
4866
|
+
}
|
|
4867
|
+
}
|
|
4868
|
+
else {
|
|
4869
|
+
return undefined;
|
|
4870
|
+
}
|
|
4871
|
+
};
|
|
4872
|
+
DateUtils.MomentToDate = function (time) {
|
|
4873
|
+
if (!time || !time.isValid()) {
|
|
4874
|
+
return undefined;
|
|
4875
|
+
}
|
|
4876
|
+
var d = new Date(time.format(DateUtils.BACKEND_DATE_FORMAT));
|
|
4877
|
+
d.setHours(time.hours());
|
|
4878
|
+
d.setMinutes(time.minutes());
|
|
4879
|
+
d.setSeconds(time.seconds());
|
|
4880
|
+
return d;
|
|
4881
|
+
};
|
|
4882
|
+
DateUtils.GetCurrentMonth = function () {
|
|
4883
|
+
return ALL_MONTHS[new Date().getMonth()];
|
|
4884
|
+
};
|
|
4885
|
+
// @returns e.g. ["FEBRUARI", "MARCH", ..] if it's Februari today, otherwise e.g. ["APRIL", "MAY", ...] if it's April today
|
|
4886
|
+
DateUtils.Get12MonthsArrayWithFirstMonthIsCurrentMonth = function () {
|
|
4887
|
+
var answer = [];
|
|
4888
|
+
var monthNrToAdd = new Date().getMonth();
|
|
4889
|
+
for (var i = 0; i < 12; i++) {
|
|
4890
|
+
answer.push(ALL_MONTHS[monthNrToAdd]);
|
|
4891
|
+
monthNrToAdd = (monthNrToAdd + 1) % ALL_MONTHS.length;
|
|
4892
|
+
}
|
|
4893
|
+
return answer;
|
|
4894
|
+
};
|
|
4895
|
+
DateUtils.GetFirstDayOfWeek = function (date) {
|
|
4896
|
+
if (!DateUtils._ValidDate(date)) {
|
|
4897
|
+
return null;
|
|
4898
|
+
}
|
|
4899
|
+
var firstDay;
|
|
4900
|
+
var dayOfWeek = date.getDay() || 7;
|
|
4901
|
+
if (dayOfWeek === 1) {
|
|
4902
|
+
firstDay = new Date(date);
|
|
4903
|
+
}
|
|
4904
|
+
else {
|
|
4905
|
+
firstDay = new Date(date);
|
|
4906
|
+
firstDay.setHours(-24 * (dayOfWeek - 1));
|
|
4907
|
+
}
|
|
4908
|
+
return firstDay;
|
|
4909
|
+
};
|
|
4910
|
+
DateUtils.GetLastDayOfWeek = function (date) {
|
|
4911
|
+
var firstDayOfWeek = DateUtils.GetFirstDayOfWeek(date);
|
|
4912
|
+
var lastDayOfWeek = new Date(firstDayOfWeek);
|
|
4913
|
+
lastDayOfWeek.setDate(firstDayOfWeek.getDate() + 6);
|
|
4914
|
+
return lastDayOfWeek;
|
|
4915
|
+
};
|
|
4916
|
+
DateUtils.GetFirstDayOfMonth = function (date) {
|
|
4917
|
+
if (!DateUtils._ValidDate(date)) {
|
|
4918
|
+
return null;
|
|
4919
|
+
}
|
|
4920
|
+
var year = date.getFullYear();
|
|
4921
|
+
var month = date.getMonth();
|
|
4922
|
+
return new Date(year, month, 1);
|
|
4923
|
+
};
|
|
4924
|
+
DateUtils.GetLastDayOfMonth = function (date) {
|
|
4925
|
+
if (!DateUtils._ValidDate(date)) {
|
|
4926
|
+
return null;
|
|
4927
|
+
}
|
|
4928
|
+
var year = date.getFullYear();
|
|
4929
|
+
var month = date.getMonth();
|
|
4930
|
+
return new Date(year, month + 1, 0);
|
|
4931
|
+
};
|
|
4932
|
+
DateUtils.DatesEqual = function (date1, date2) {
|
|
4933
|
+
var result = false;
|
|
4934
|
+
if (DateUtils._ValidDate(date1) && DateUtils._ValidDate(date2)) {
|
|
4935
|
+
result =
|
|
4936
|
+
date1.getDate() === date2.getDate() &&
|
|
4937
|
+
date1.getMonth() === date2.getMonth() &&
|
|
4938
|
+
date1.getFullYear() === date2.getFullYear();
|
|
4939
|
+
}
|
|
4940
|
+
return result;
|
|
4941
|
+
};
|
|
4942
|
+
DateUtils.DateRangeEqual = function (dates1, dates2) {
|
|
4943
|
+
return (this.DatesEqual(dates1.startDate, dates2.startDate) &&
|
|
4944
|
+
this.DatesEqual(dates1.endDate, dates2.endDate));
|
|
4945
|
+
};
|
|
4946
|
+
DateUtils.AddMinutes = function (date, minutes) {
|
|
4947
|
+
return new Date(date.getTime() + (minutes * 60000));
|
|
4948
|
+
};
|
|
4949
|
+
DateUtils.AddDays = function (date, days) {
|
|
4950
|
+
var result = new Date(date);
|
|
4951
|
+
result.setDate(result.getDate() + days);
|
|
4952
|
+
return result;
|
|
4953
|
+
};
|
|
4954
|
+
DateUtils.AddMonths = function (date, months) {
|
|
4955
|
+
var result = new Date(date);
|
|
4956
|
+
result.setMonth(result.getMonth() + months);
|
|
4957
|
+
return result;
|
|
4958
|
+
};
|
|
4959
|
+
DateUtils.DetermineDSTBreakpoints = function () {
|
|
4960
|
+
var endOfYear = new Date(new Date().getFullYear(), 11, 1);
|
|
4961
|
+
var checkDate = new Date(new Date().getFullYear(), 0, 1);
|
|
4962
|
+
var offset = checkDate.getTimezoneOffset();
|
|
4963
|
+
var periodStart = new Date();
|
|
4964
|
+
var periodStartSet = false;
|
|
4965
|
+
var periodEnd = new Date();
|
|
4966
|
+
var periodEndSet = false;
|
|
4967
|
+
while (checkDate.getTime() < endOfYear.getTime()) {
|
|
4968
|
+
checkDate = this.AddMinutes(checkDate, 60);
|
|
4969
|
+
if (offset < checkDate.getTimezoneOffset()) {
|
|
4970
|
+
periodEnd.setTime(checkDate.getTime());
|
|
4971
|
+
periodEndSet = true;
|
|
4972
|
+
}
|
|
4973
|
+
else if (offset > checkDate.getTimezoneOffset()) {
|
|
4974
|
+
periodStart.setTime(checkDate.getTime());
|
|
4975
|
+
periodStartSet = true;
|
|
4976
|
+
}
|
|
4977
|
+
offset = checkDate.getTimezoneOffset();
|
|
4978
|
+
if (periodStartSet && periodEndSet) {
|
|
4979
|
+
break;
|
|
4980
|
+
}
|
|
4981
|
+
}
|
|
4982
|
+
if (periodStartSet && periodEndSet) {
|
|
4983
|
+
return {
|
|
4984
|
+
start: this._DateToTimeStringWithDateFormat(periodStart),
|
|
4985
|
+
end: this._DateToTimeStringWithDateFormat(periodEnd)
|
|
4986
|
+
};
|
|
4987
|
+
}
|
|
4988
|
+
else {
|
|
4989
|
+
return { start: undefined, end: undefined }; // important otherwise we return new Date() for both
|
|
4990
|
+
}
|
|
4991
|
+
};
|
|
4992
|
+
DateUtils._ValidDate = function (date) {
|
|
4993
|
+
return date !== null && date !== undefined;
|
|
4994
|
+
};
|
|
4995
|
+
/**
|
|
4996
|
+
* Returns the difference between the two given days as the number of days, in float precision (date to - date from).
|
|
4997
|
+
* Returns negative values of the 'from' date is later than in time than the 'to' date.
|
|
4998
|
+
*/
|
|
4999
|
+
DateUtils.GetDayDifference = function (from, to) {
|
|
5000
|
+
if (!from || !to) {
|
|
5001
|
+
return NaN;
|
|
5002
|
+
}
|
|
5003
|
+
return ((to.getTime() - from.getTime()) / 1000 / 60 / 60 / 24);
|
|
5004
|
+
};
|
|
5005
|
+
DateUtils.IsSameDay = function (dateOne, dateTwo) {
|
|
5006
|
+
return (dateOne && dateTwo &&
|
|
5007
|
+
dateOne.getDate() === dateTwo.getDate()
|
|
5008
|
+
&& dateOne.getMonth() === dateTwo.getMonth()
|
|
5009
|
+
&& dateOne.getFullYear() === dateTwo.getFullYear());
|
|
5010
|
+
};
|
|
5011
|
+
DateUtils.IsInBetween = function (date, startDate, endDate, withTime) {
|
|
5012
|
+
if (withTime === void 0) { withTime = true; }
|
|
5013
|
+
if (startDate && endDate) {
|
|
5014
|
+
if (withTime) {
|
|
5015
|
+
return (date > startDate && date < endDate);
|
|
5016
|
+
}
|
|
5017
|
+
else {
|
|
5018
|
+
var dateWithoutTime = new Date(date).setHours(0, 0, 0, 0), dateFromWithoutTime = new Date(startDate).setHours(0, 0, 0, 0), dateToWithoutTime = new Date(endDate).setHours(0, 0, 0, 0);
|
|
5019
|
+
return dateWithoutTime >= dateFromWithoutTime && dateWithoutTime <= dateToWithoutTime;
|
|
5020
|
+
}
|
|
5021
|
+
}
|
|
5022
|
+
};
|
|
5023
|
+
DateUtils.IsMonday = function (date) {
|
|
5024
|
+
return date.getDay() === 1;
|
|
5025
|
+
};
|
|
5026
|
+
DateUtils.IsSunday = function (date) {
|
|
5027
|
+
return date.getDay() === 0;
|
|
5028
|
+
};
|
|
5029
|
+
DateUtils.IsToday = function (date) {
|
|
5030
|
+
var today = new Date();
|
|
5031
|
+
return DateUtils.IsSameDay(today, date);
|
|
5032
|
+
};
|
|
5033
|
+
// Returns date format like it would when using a pipe in the templete, ie: "1 okt. 2020"
|
|
5034
|
+
DateUtils.ParseDateInShortDateFormat = function (date, locale) {
|
|
5035
|
+
this.datePipe = new common.DatePipe(locale);
|
|
5036
|
+
var parsedDate = this.datePipe.transform(date);
|
|
5037
|
+
return parsedDate;
|
|
5038
|
+
};
|
|
5039
|
+
// Transforms a string that is formatted like "'17-08-2014'<=?<='17-08-2021'" into "'17-08-2014' Untill '17-08-2021'"
|
|
5040
|
+
DateUtils.getFormattedDateRangeString = function (dateRangeString, separator) {
|
|
5041
|
+
if (separator === void 0) { separator = " - "; }
|
|
5042
|
+
var newString = dateRangeString;
|
|
5043
|
+
newString = newString.replace("<=?<=", " " + separator + " ");
|
|
5044
|
+
newString = newString.replace(/'/g, "");
|
|
5045
|
+
return newString;
|
|
5046
|
+
};
|
|
5047
|
+
DateUtils.SetDateOrDateRangeObjectHoursZero = function (date) {
|
|
5048
|
+
if (date instanceof DateRange) {
|
|
5049
|
+
if (date.startDate) {
|
|
5050
|
+
date.startDate.setHours(0, 0, 0);
|
|
5051
|
+
}
|
|
5052
|
+
if (date.endDate) {
|
|
5053
|
+
date.endDate.setHours(0, 0, 0);
|
|
5054
|
+
}
|
|
5055
|
+
}
|
|
5056
|
+
else if (!!date && (date instanceof Date)) {
|
|
5057
|
+
date.setHours(0, 0, 0, 0);
|
|
5058
|
+
}
|
|
5059
|
+
};
|
|
5060
|
+
DateUtils._DateToTimeStringWithDateFormat = function (value, dateFormat) {
|
|
5061
|
+
if (dateFormat === void 0) { dateFormat = "d-m-y"; }
|
|
5062
|
+
if (!value) {
|
|
5063
|
+
return "";
|
|
5064
|
+
}
|
|
5065
|
+
var hours = value.getHours() < 10 ? "0" + value.getHours() : "" + value.getHours();
|
|
5066
|
+
var minutes = value.getMinutes() < 10 ? "0" + value.getMinutes() : "" + value.getMinutes();
|
|
5067
|
+
return this.ParseDate(value, dateFormat) + " " + [hours, minutes].join(":");
|
|
5068
|
+
};
|
|
5069
|
+
return DateUtils;
|
|
5070
|
+
}());
|
|
5071
|
+
DateUtils.BACKEND_DATE_FORMAT = 'YYYY-MM-DD[T]HH:mm:ss';
|
|
5072
|
+
DateUtils.datePipe = new common.DatePipe('shortDate');
|
|
5073
|
+
|
|
5074
|
+
//fixme we don't have a todayDayStamp field but our template references it
|
|
5075
|
+
var CalendarViewComponent = /** @class */ (function () {
|
|
5076
|
+
function CalendarViewComponent(_locale) {
|
|
5077
|
+
this._locale = _locale;
|
|
5078
|
+
this.selectedDateChange = new i0.EventEmitter();
|
|
5079
|
+
this.trackByStamp = function (index, stamp) {
|
|
5080
|
+
return stamp && stamp.timestamp || index;
|
|
5081
|
+
};
|
|
5082
|
+
this.trackByWeek = function (index, week) {
|
|
5083
|
+
return week && week[0].week || index;
|
|
5084
|
+
};
|
|
5085
|
+
this.weekDayLabel = [];
|
|
5086
|
+
this.weeks = [];
|
|
5087
|
+
this._selectedDate = new Date();
|
|
5088
|
+
this._view = CalendarView.WeekView;
|
|
5089
|
+
this.selectedDate.setHours(0, 0, 0, 0);
|
|
5090
|
+
this._setLabels();
|
|
5091
|
+
}
|
|
5092
|
+
Object.defineProperty(CalendarViewComponent.prototype, "view", {
|
|
5093
|
+
get: function () {
|
|
5094
|
+
return this._view;
|
|
5095
|
+
},
|
|
5096
|
+
set: function (value) {
|
|
5097
|
+
this._view = value;
|
|
5098
|
+
this._selectDays();
|
|
5099
|
+
},
|
|
5100
|
+
enumerable: false,
|
|
5101
|
+
configurable: true
|
|
5102
|
+
});
|
|
5103
|
+
Object.defineProperty(CalendarViewComponent.prototype, "selectedDate", {
|
|
5104
|
+
get: function () {
|
|
5105
|
+
return this._selectedDate;
|
|
5106
|
+
},
|
|
5107
|
+
set: function (value) {
|
|
5108
|
+
this._selectedDate = value;
|
|
5109
|
+
this._selectedDate.setHours(0, 0, 0, 0);
|
|
5110
|
+
this._prepareWeeks();
|
|
5111
|
+
},
|
|
5112
|
+
enumerable: false,
|
|
5113
|
+
configurable: true
|
|
5114
|
+
});
|
|
5115
|
+
CalendarViewComponent.prototype.onDateClick = function (date) {
|
|
5116
|
+
this.selectedDate = new Date(date.timestamp);
|
|
5117
|
+
this.selectedDateChange.emit(this.selectedDate);
|
|
5118
|
+
this._selectDays();
|
|
5119
|
+
};
|
|
5120
|
+
CalendarViewComponent.prototype._setLabels = function () {
|
|
5121
|
+
var datePipe = new common.DatePipe(this._locale);
|
|
5122
|
+
var currentDay = this.selectedDate.getDay();
|
|
5123
|
+
var startWeekDate = new Date(this.selectedDate.getTime());
|
|
5124
|
+
startWeekDate.setDate(startWeekDate.getDate() - currentDay - 1);
|
|
5125
|
+
this.weekDayLabel = new ArrayNumberPipe().transform(7).map(function () {
|
|
5126
|
+
startWeekDate.setDate(startWeekDate.getDate() + 1);
|
|
5127
|
+
return datePipe.transform(startWeekDate, "E");
|
|
5128
|
+
});
|
|
5129
|
+
this.weekDayLabel.push(this.weekDayLabel.shift());
|
|
5130
|
+
};
|
|
5131
|
+
CalendarViewComponent.prototype._prepareWeeks = function () {
|
|
5132
|
+
this.weeks.length = 0;
|
|
5133
|
+
var date = new Date(this.selectedDate.getTime());
|
|
5134
|
+
date.setHours(0, 0, 0, 0);
|
|
5135
|
+
// go to last day of month
|
|
5136
|
+
date.setMonth(date.getMonth() + 1);
|
|
5137
|
+
date.setDate(0);
|
|
5138
|
+
var monthEndDay = date.getDay();
|
|
5139
|
+
var monthEndDate = date.getDate();
|
|
5140
|
+
// days after end of month
|
|
5141
|
+
var daysAfter = !monthEndDay ? 0 : 7 - monthEndDay;
|
|
5142
|
+
// go to first day of month
|
|
5143
|
+
date.setDate(1);
|
|
5144
|
+
var monthBeginDay = date.getDay();
|
|
5145
|
+
// days before start of month
|
|
5146
|
+
var daysBefore = !monthBeginDay ? 6 : monthBeginDay - 1;
|
|
5147
|
+
// go to start of calendar view
|
|
5148
|
+
date.setDate(-daysBefore + 1);
|
|
5149
|
+
// amount of weeks to display
|
|
5150
|
+
var weekCount = Math.ceil((daysBefore + daysAfter + monthEndDate) / 7);
|
|
5151
|
+
var weekStart = DateUtils.GetWeekNumber(date);
|
|
5152
|
+
var weekEnd = weekStart + weekCount - 1;
|
|
5153
|
+
// iterate over week count
|
|
5154
|
+
for (var i = weekStart; i <= weekEnd; i++) {
|
|
5155
|
+
var week = i;
|
|
5156
|
+
// only recalculate week when it's necessary
|
|
5157
|
+
if (weekStart > 50) {
|
|
5158
|
+
week = DateUtils.GetWeekNumber(date);
|
|
5159
|
+
}
|
|
5160
|
+
var days = [];
|
|
5161
|
+
// iterate over 7 days
|
|
5162
|
+
for (var ii = 1; ii <= 7; ii++) {
|
|
5163
|
+
// check if we are in the current month
|
|
5164
|
+
var inMonth = true;
|
|
5165
|
+
if (i === weekStart) {
|
|
5166
|
+
inMonth = ii > daysBefore;
|
|
5167
|
+
}
|
|
5168
|
+
else if (i === weekEnd) {
|
|
5169
|
+
inMonth = ii <= 7 - daysAfter;
|
|
5170
|
+
}
|
|
5171
|
+
var timestamp = date.getTime();
|
|
5172
|
+
// add dateStamp to date array
|
|
5173
|
+
days.push({
|
|
5174
|
+
week: week,
|
|
5175
|
+
inMonth: inMonth,
|
|
5176
|
+
day: date.getDate(),
|
|
5177
|
+
timestamp: timestamp,
|
|
5178
|
+
selected: this.selectedDate.getTime() === timestamp
|
|
5179
|
+
});
|
|
5180
|
+
// go one day further
|
|
5181
|
+
date.setDate(date.getDate() + 1);
|
|
5182
|
+
}
|
|
5183
|
+
this.weeks.push(days);
|
|
5184
|
+
}
|
|
5185
|
+
this._selectDays();
|
|
5186
|
+
};
|
|
5187
|
+
CalendarViewComponent.prototype._selectDays = function () {
|
|
5188
|
+
this._resetSelection();
|
|
5189
|
+
if (!this.selectedDate) {
|
|
5190
|
+
return;
|
|
5191
|
+
}
|
|
5192
|
+
var weekNumber = DateUtils.GetWeekNumber(this.selectedDate);
|
|
5193
|
+
var len = this.weeks.length;
|
|
5194
|
+
for (var i = 0; i < len; i++) {
|
|
5195
|
+
var leni = this.weeks[i].length;
|
|
5196
|
+
for (var ii = 0; ii < leni; ii++) {
|
|
5197
|
+
if (this.weeks[i][ii].inMonth && this.view === CalendarView.MonthView) {
|
|
5198
|
+
this.weeks[i][ii].selected = true;
|
|
5199
|
+
}
|
|
5200
|
+
else if (this.weeks[i][ii].week === weekNumber && this.view === CalendarView.WeekView) {
|
|
5201
|
+
this.weeks[i][ii].selected = true;
|
|
5202
|
+
}
|
|
5203
|
+
else if (this.weeks[i][ii].timestamp === this.selectedDate.getTime() && this.view === CalendarView.WeekSelectView) {
|
|
5204
|
+
this.weeks[i][ii].selected = true;
|
|
5205
|
+
}
|
|
5206
|
+
else if (this.weeks[i][ii].timestamp === this.selectedDate.getTime() && this.view === CalendarView.DayView) {
|
|
5207
|
+
this.weeks[i][ii].selected = true;
|
|
5208
|
+
}
|
|
5209
|
+
}
|
|
5210
|
+
}
|
|
5211
|
+
};
|
|
5212
|
+
CalendarViewComponent.prototype._resetSelection = function () {
|
|
5213
|
+
var len = this.weeks.length;
|
|
5214
|
+
for (var i = 0; i < len; i++) {
|
|
5215
|
+
var leni = this.weeks[i].length;
|
|
5216
|
+
for (var ii = 0; ii < leni; ii++) {
|
|
5217
|
+
this.weeks[i][ii].selected = false;
|
|
5218
|
+
}
|
|
5219
|
+
}
|
|
5220
|
+
};
|
|
5221
|
+
return CalendarViewComponent;
|
|
5222
|
+
}());
|
|
5223
|
+
CalendarViewComponent.decorators = [
|
|
5224
|
+
{ type: i0.Component, args: [{
|
|
5225
|
+
selector: "calendar-view",
|
|
5226
|
+
template: "\n <div class=\"calendar-content\">\n <div>\n <div class=\"week-day-header week-row\">\n <div class=\"week-acronym\"></div>\n <div *ngFor=\"let weekDay of weekDayLabel\" [textContent]=\"weekDay | ucfirst\"\n class=\"week-day-label\"></div>\n </div>\n <div class=\"week-row\" *ngFor=\"let week of weeks;trackBy:trackByWeek\">\n <div [textContent]=\"week[0].week\" class=\"week-number\"></div>\n <div *ngFor=\"let date of week;trackBy:trackByStamp\" class=\"week-day\"\n (click)=\"onDateClick(date)\" [textContent]=\"date.day\">\n </div>\n </div>\n </div>\n </div>\n ",
|
|
5227
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5228
|
+
},] }
|
|
5229
|
+
];
|
|
5230
|
+
CalendarViewComponent.ctorParameters = function () { return [
|
|
5231
|
+
{ type: exports["ɵr"], decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }
|
|
5232
|
+
]; };
|
|
5233
|
+
CalendarViewComponent.propDecorators = {
|
|
5234
|
+
view: [{ type: i0.Input }],
|
|
5235
|
+
selectedDate: [{ type: i0.Input }],
|
|
5236
|
+
selectedDateChange: [{ type: i0.Output }]
|
|
5237
|
+
};
|
|
5238
|
+
|
|
5239
|
+
var Weekday = /** @class */ (function () {
|
|
5240
|
+
function Weekday() {
|
|
5241
|
+
this.inView = true;
|
|
5242
|
+
this.newMonth = false;
|
|
5243
|
+
this.weekdaySelected = false;
|
|
5244
|
+
this.datesByTheHour = [];
|
|
5245
|
+
this.events = [];
|
|
5246
|
+
}
|
|
5247
|
+
return Weekday;
|
|
5248
|
+
}());
|
|
5249
|
+
|
|
5250
|
+
var Week = /** @class */ (function () {
|
|
5251
|
+
function Week() {
|
|
5252
|
+
this.weekDays = [];
|
|
5253
|
+
}
|
|
5254
|
+
return Week;
|
|
5255
|
+
}());
|
|
5256
|
+
|
|
5257
|
+
var CalendarUtils = /** @class */ (function () {
|
|
5258
|
+
function CalendarUtils(_locale) {
|
|
5259
|
+
this._locale = _locale;
|
|
5260
|
+
CalendarUtils.Locale = _locale;
|
|
5261
|
+
}
|
|
5262
|
+
// public static GetCurrentYear(): number {
|
|
5263
|
+
// return this.Now.getFullYear();
|
|
5264
|
+
// }
|
|
5265
|
+
//
|
|
5266
|
+
// public static GetCurrentMonth(): number {
|
|
5267
|
+
// return this.Now.getUTCMonth() + 1;
|
|
5268
|
+
// }
|
|
5269
|
+
CalendarUtils.GetDayHours = function (day) {
|
|
5270
|
+
var datesByTheHour = [];
|
|
5271
|
+
if (day) {
|
|
5272
|
+
var newDate = new Date(day);
|
|
5273
|
+
newDate.setHours(0, 0, 0, 0);
|
|
5274
|
+
datesByTheHour.push(newDate);
|
|
5275
|
+
for (var i = 0; i < 23; i++) {
|
|
5276
|
+
newDate = new Date(newDate);
|
|
5277
|
+
newDate.setHours(newDate.getHours() + 1);
|
|
5278
|
+
datesByTheHour.push(newDate);
|
|
5279
|
+
}
|
|
5280
|
+
}
|
|
5281
|
+
return datesByTheHour;
|
|
5282
|
+
};
|
|
5283
|
+
CalendarUtils.GetDaysOfWeek = function (date) {
|
|
5284
|
+
var day = DateUtils.GetFirstDayOfWeek(date);
|
|
5285
|
+
var daysOfWeek = [];
|
|
5286
|
+
var options;
|
|
5287
|
+
var month;
|
|
5288
|
+
for (var i = 0; i < 7; i++) {
|
|
5289
|
+
var dayPerWeek = new Weekday();
|
|
5290
|
+
var dayHours = CalendarUtils.GetDayHours(day);
|
|
5291
|
+
dayPerWeek.newMonth = day.getMonth() !== month;
|
|
5292
|
+
dayPerWeek.weekdaySelected = day.getDay() === date.getDay();
|
|
5293
|
+
dayPerWeek.weekdayDay = day.getDate();
|
|
5294
|
+
options = { weekday: "short" };
|
|
5295
|
+
dayPerWeek.weekdayShort = day.toLocaleDateString(CalendarUtils.Locale, options);
|
|
5296
|
+
options = { weekday: "long" };
|
|
5297
|
+
dayPerWeek.weekdayLong = day.toLocaleDateString(CalendarUtils.Locale, options);
|
|
5298
|
+
options = { month: "short" };
|
|
5299
|
+
dayPerWeek.weekdayMonthShort = day.toLocaleDateString(CalendarUtils.Locale, options);
|
|
5300
|
+
options = { month: "long" };
|
|
5301
|
+
dayPerWeek.weekdayMonthLong = day.toLocaleDateString(CalendarUtils.Locale, options);
|
|
5302
|
+
dayPerWeek.weekdayYear = day.getFullYear();
|
|
5303
|
+
dayPerWeek.date = new Date(day);
|
|
5304
|
+
dayPerWeek.datesByTheHour = dayHours;
|
|
5305
|
+
daysOfWeek.push(dayPerWeek);
|
|
5306
|
+
month = day.getMonth();
|
|
5307
|
+
day = new Date(day);
|
|
5308
|
+
day.setDate(day.getDate() + 1);
|
|
5309
|
+
}
|
|
5310
|
+
var week = new Week();
|
|
5311
|
+
week.weekDays = daysOfWeek;
|
|
5312
|
+
return week;
|
|
5313
|
+
};
|
|
5314
|
+
return CalendarUtils;
|
|
5315
|
+
}());
|
|
5316
|
+
CalendarUtils.Locale = undefined;
|
|
5317
|
+
CalendarUtils.Now = new Date();
|
|
5318
|
+
CalendarUtils.ctorParameters = function () { return [
|
|
5319
|
+
{ type: exports["ɵr"], decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] }
|
|
5320
|
+
]; };
|
|
5321
|
+
|
|
5322
|
+
var AgendaEvent = /** @class */ (function () {
|
|
5323
|
+
function AgendaEvent() {
|
|
5324
|
+
this.checked = false;
|
|
5325
|
+
this.showCheckbox = false;
|
|
5326
|
+
this.draggable = false;
|
|
5327
|
+
}
|
|
5328
|
+
return AgendaEvent;
|
|
5329
|
+
}());
|
|
5330
|
+
|
|
5331
|
+
var AgendaEventPerDay = /** @class */ (function () {
|
|
5332
|
+
function AgendaEventPerDay() {
|
|
5333
|
+
this.events = [];
|
|
5334
|
+
}
|
|
5335
|
+
return AgendaEventPerDay;
|
|
5336
|
+
}());
|
|
5337
|
+
|
|
5338
|
+
var Month = /** @class */ (function () {
|
|
5339
|
+
function Month() {
|
|
5340
|
+
this.weeks = [];
|
|
5341
|
+
}
|
|
5342
|
+
Object.defineProperty(Month.prototype, "firstWeek", {
|
|
5343
|
+
get: function () {
|
|
5344
|
+
if (this.weeks && this.weeks.length > 0) {
|
|
5345
|
+
return this.weeks[0];
|
|
5346
|
+
}
|
|
5347
|
+
},
|
|
5348
|
+
enumerable: false,
|
|
5349
|
+
configurable: true
|
|
5350
|
+
});
|
|
5351
|
+
return Month;
|
|
5352
|
+
}());
|
|
5353
|
+
|
|
5354
|
+
var Day = /** @class */ (function () {
|
|
5355
|
+
function Day() {
|
|
5356
|
+
this.datesByTheHour = [];
|
|
5357
|
+
this.events = [];
|
|
5358
|
+
}
|
|
5359
|
+
return Day;
|
|
5360
|
+
}());
|
|
5361
|
+
|
|
5362
|
+
var NULL_AGENDA_EVENT = new AgendaEvent();
|
|
5363
|
+
var NULL_AGENDA_EVENT_PER_DAY = new AgendaEventPerDay();
|
|
5364
|
+
var NULL_MONTH = new Month();
|
|
5365
|
+
var NULL_WEEK = new Week();
|
|
5366
|
+
var NULL_DAY = new Day();
|
|
5367
|
+
|
|
5368
|
+
var AgendaHeaderComponent = /** @class */ (function () {
|
|
5369
|
+
function AgendaHeaderComponent(_locale, _elementRef, _renderer, _ngZone, iconCacheService) {
|
|
5370
|
+
var _this = this;
|
|
5371
|
+
this._locale = _locale;
|
|
5372
|
+
this._elementRef = _elementRef;
|
|
5373
|
+
this._renderer = _renderer;
|
|
5374
|
+
this._ngZone = _ngZone;
|
|
5375
|
+
this.iconCacheService = iconCacheService;
|
|
5376
|
+
this.icons = Icon;
|
|
5377
|
+
this.viewTypes = CalendarView;
|
|
5378
|
+
this.scrollbarWidth = 15;
|
|
5379
|
+
this.view = CalendarView.WeekSelectView;
|
|
5380
|
+
this.viewChange = new i0.EventEmitter();
|
|
5381
|
+
this.selectedDateChange = new i0.EventEmitter();
|
|
5382
|
+
this.rangeChange = new i0.EventEmitter();
|
|
5383
|
+
this.weekDays = [];
|
|
5384
|
+
this.day = NULL_DAY;
|
|
5385
|
+
this.showBackButton = true;
|
|
5386
|
+
this._eventsPerDay = [];
|
|
5387
|
+
this._onResize = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
5388
|
+
return __generator(this, function (_a) {
|
|
5389
|
+
this._resizeHost();
|
|
5390
|
+
return [2 /*return*/];
|
|
5391
|
+
});
|
|
5392
|
+
}); };
|
|
5393
|
+
}
|
|
5394
|
+
Object.defineProperty(AgendaHeaderComponent.prototype, "selectedDate", {
|
|
5395
|
+
get: function () {
|
|
5396
|
+
return this._selectedDate;
|
|
5397
|
+
},
|
|
5398
|
+
set: function (value) {
|
|
5399
|
+
this._selectedDate = new Date(value);
|
|
5400
|
+
this._prepareHeaderData();
|
|
5401
|
+
},
|
|
5402
|
+
enumerable: false,
|
|
5403
|
+
configurable: true
|
|
5404
|
+
});
|
|
5405
|
+
Object.defineProperty(AgendaHeaderComponent.prototype, "firstAvailableDate", {
|
|
5406
|
+
get: function () {
|
|
5407
|
+
return this._firstAvailableDate;
|
|
5408
|
+
},
|
|
5409
|
+
set: function (value) {
|
|
5410
|
+
if (value) {
|
|
5411
|
+
this._firstAvailableDate = new Date(value);
|
|
5412
|
+
this._prepareHeaderData();
|
|
5413
|
+
}
|
|
5414
|
+
},
|
|
5415
|
+
enumerable: false,
|
|
5416
|
+
configurable: true
|
|
5417
|
+
});
|
|
5418
|
+
Object.defineProperty(AgendaHeaderComponent.prototype, "eventsPerDay", {
|
|
5419
|
+
set: function (value) {
|
|
5420
|
+
this._eventsPerDay = value;
|
|
5421
|
+
this._prepareHeaderData();
|
|
5422
|
+
},
|
|
5423
|
+
enumerable: false,
|
|
5424
|
+
configurable: true
|
|
5425
|
+
});
|
|
5426
|
+
AgendaHeaderComponent.prototype.ngOnDestroy = function () {
|
|
5427
|
+
window.removeEventListener("resize", this._onResize);
|
|
5428
|
+
this._elementRef = undefined;
|
|
5429
|
+
};
|
|
5430
|
+
AgendaHeaderComponent.prototype.ngOnInit = function () {
|
|
5431
|
+
var _this = this;
|
|
5432
|
+
this._ngZone.runOutsideAngular(function () {
|
|
5433
|
+
window.addEventListener("resize", _this._onResize);
|
|
5434
|
+
});
|
|
5435
|
+
};
|
|
5436
|
+
AgendaHeaderComponent.prototype.ngAfterContentChecked = function () {
|
|
5437
|
+
this._resizeHost();
|
|
5438
|
+
};
|
|
5439
|
+
AgendaHeaderComponent.prototype.subUnit = function () {
|
|
5440
|
+
if (this.selectedDate) {
|
|
5441
|
+
var newDate = new Date(this.selectedDate);
|
|
5442
|
+
switch (this.view) {
|
|
5443
|
+
case CalendarView.DayView:
|
|
5444
|
+
newDate.setDate(this.selectedDate.getDate() - 1);
|
|
5445
|
+
break;
|
|
5446
|
+
case CalendarView.WeekView:
|
|
5447
|
+
newDate.setDate(this.selectedDate.getDate() - 7);
|
|
5448
|
+
break;
|
|
5449
|
+
case CalendarView.WeekSelectView:
|
|
5450
|
+
newDate.setDate(this.selectedDate.getDate() - 7);
|
|
5451
|
+
break;
|
|
5452
|
+
case CalendarView.MonthView:
|
|
5453
|
+
newDate.setMonth(this.selectedDate.getMonth() - 1);
|
|
5454
|
+
break;
|
|
5455
|
+
}
|
|
5456
|
+
this.selectedDate = newDate;
|
|
5457
|
+
this.rangeChange.emit(this.selectedDate);
|
|
5458
|
+
}
|
|
5459
|
+
};
|
|
5460
|
+
AgendaHeaderComponent.prototype.addUnit = function () {
|
|
5461
|
+
if (this.selectedDate) {
|
|
5462
|
+
var newDate = new Date(this.selectedDate);
|
|
5463
|
+
switch (this.view) {
|
|
5464
|
+
case CalendarView.DayView:
|
|
5465
|
+
newDate.setDate(this.selectedDate.getDate() + 1);
|
|
5466
|
+
break;
|
|
5467
|
+
case CalendarView.WeekView:
|
|
5468
|
+
newDate.setDate(this.selectedDate.getDate() + 7);
|
|
5469
|
+
break;
|
|
5470
|
+
case CalendarView.WeekSelectView:
|
|
5471
|
+
newDate.setDate(this.selectedDate.getDate() + 7);
|
|
5472
|
+
break;
|
|
5473
|
+
case CalendarView.MonthView:
|
|
5474
|
+
newDate.setMonth(this.selectedDate.getMonth() + 1);
|
|
5475
|
+
break;
|
|
5476
|
+
}
|
|
5477
|
+
this.selectedDate = newDate;
|
|
5478
|
+
this.rangeChange.emit(this.selectedDate);
|
|
5479
|
+
}
|
|
5480
|
+
};
|
|
5481
|
+
AgendaHeaderComponent.prototype.setUnit = function (weekDay) {
|
|
5482
|
+
this.selectedDate = weekDay.date;
|
|
5483
|
+
this.selectedDateChange.emit(this.selectedDate);
|
|
5484
|
+
};
|
|
5485
|
+
AgendaHeaderComponent.prototype.changeTheView = function (view) {
|
|
5486
|
+
this.view = view;
|
|
5487
|
+
this.viewChange.emit(view);
|
|
5488
|
+
this._prepareHeaderData();
|
|
5489
|
+
};
|
|
5490
|
+
/**
|
|
5491
|
+
* Need to resize the host component to size it's fixed positioned child through css
|
|
5492
|
+
*/
|
|
5493
|
+
AgendaHeaderComponent.prototype._resizeHost = function () {
|
|
5494
|
+
if (this._elementRef) {
|
|
5495
|
+
this._renderer.setStyle(this._elementRef.nativeElement, "width", this._elementRef.nativeElement.parentElement.clientWidth - this.scrollbarWidth + "px");
|
|
5496
|
+
}
|
|
5497
|
+
};
|
|
5498
|
+
AgendaHeaderComponent.prototype._prepareHeaderData = function () {
|
|
5499
|
+
var _this = this;
|
|
5500
|
+
if (this.selectedDate) {
|
|
5501
|
+
switch (this.view) {
|
|
5502
|
+
case CalendarView.DayView:
|
|
5503
|
+
var day = new Day();
|
|
5504
|
+
day.date = new Date(this.selectedDate);
|
|
5505
|
+
var options = { year: "numeric", month: "long", day: "numeric" };
|
|
5506
|
+
day.description = this.selectedDate.toLocaleDateString(this._locale, options);
|
|
5507
|
+
this.day = day;
|
|
5508
|
+
break;
|
|
5509
|
+
case CalendarView.WeekView:
|
|
5510
|
+
var weekView = CalendarUtils.GetDaysOfWeek(this.selectedDate);
|
|
5511
|
+
this.weekDays = weekView.weekDays;
|
|
5512
|
+
if (this.firstAvailableDate) {
|
|
5513
|
+
this.showBackButton = this.weekDays.find(function (wd) { return DateUtils.DatesEqual(_this.firstAvailableDate, wd.date); }) === undefined;
|
|
5514
|
+
}
|
|
5515
|
+
break;
|
|
5516
|
+
case CalendarView.WeekSelectView:
|
|
5517
|
+
var weekSelectView = CalendarUtils.GetDaysOfWeek(this.selectedDate);
|
|
5518
|
+
this.weekDays = weekSelectView.weekDays;
|
|
5519
|
+
this.weekDays.forEach(function (wd) {
|
|
5520
|
+
var evPerDay = _this._eventsPerDay && _this._eventsPerDay.length > 0 ? _this._eventsPerDay.find(function (e) { return DateUtils.DatesEqual(e.date, wd.date); }) : null;
|
|
5521
|
+
if (evPerDay) {
|
|
5522
|
+
wd.events = evPerDay.events;
|
|
5523
|
+
}
|
|
5524
|
+
else {
|
|
5525
|
+
wd.weekdaySelected = false;
|
|
5526
|
+
}
|
|
5527
|
+
});
|
|
5528
|
+
if (this.firstAvailableDate) {
|
|
5529
|
+
this.showBackButton = this.weekDays.find(function (wd) { return DateUtils.DatesEqual(_this.firstAvailableDate, wd.date); }) === undefined;
|
|
5530
|
+
}
|
|
5531
|
+
break;
|
|
5532
|
+
case CalendarView.MonthView:
|
|
5533
|
+
var weekOfMonth = CalendarUtils.GetDaysOfWeek(this.selectedDate);
|
|
5534
|
+
this.weekDays = weekOfMonth.weekDays;
|
|
5535
|
+
if (this.firstAvailableDate) {
|
|
5536
|
+
this.showBackButton = this.weekDays.find(function (wd) { return DateUtils.DatesEqual(_this.firstAvailableDate, wd.date); }) === undefined;
|
|
5537
|
+
}
|
|
5538
|
+
break;
|
|
5539
|
+
}
|
|
5540
|
+
}
|
|
5541
|
+
};
|
|
5542
|
+
return AgendaHeaderComponent;
|
|
5543
|
+
}());
|
|
5544
|
+
AgendaHeaderComponent.decorators = [
|
|
5545
|
+
{ type: i0.Component, args: [{
|
|
5546
|
+
selector: "agenda-header",
|
|
5547
|
+
template: "\n <div class=\"agenda-header-wrapper\" *ngIf=\"view === viewTypes.DayView\">\n <div class=\"hour-label-placeholder\">\n <view-select [selectedView]=\"view\" (selectedViewChange)=\"changeTheView($event)\"></view-select>\n </div>\n <div class=\"week-day-label\">\n <co-icon class=\"pointer-hover no-user-select sub-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subUnit()\"></co-icon>\n <div class=\"day-description\" [textContent]=\"day.description\"></div>\n <co-icon class=\"pointer-hover no-user-select add-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addUnit()\"></co-icon>\n </div>\n </div>\n <div class=\"agenda-header-wrapper\" *ngIf=\"view === viewTypes.WeekView\">\n <div class=\"hour-label-placeholder\">\n <view-select [selectedView]=\"view\" (selectedViewChange)=\"changeTheView($event)\"></view-select>\n </div>\n <div class=\"week-day-label\" *ngFor=\"let weekDay of weekDays; let index = index\" [class.selected]=\"weekDay.weekdaySelected\" (click)=\"setUnit(weekDay)\">\n <co-icon *ngIf=\"index === 0 && showBackButton\" class=\"pointer-hover no-user-select sub-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subUnit()\"></co-icon>\n <div *ngIf=\"weekDay.newMonth\" [textContent]=\"weekDay.weekdayMonthLong + ' ' + weekDay.weekdayYear\" class=\"month-description\"></div>\n <div class=\"weekday-value\" [textContent]=\"weekDay.weekdayDay\"></div>\n <div class=\"weekday-description\" [textContent]=\"weekDay.weekdayShort\"></div>\n <co-icon *ngIf=\"index === 6\" class=\"pointer-hover no-user-select add-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addUnit()\"></co-icon>\n </div>\n </div>\n <div class=\"agenda-header-wrapper\" *ngIf=\"view === viewTypes.WeekSelectView\">\n <div class=\"week-day-label\" *ngFor=\"let weekDay of weekDays; let index = index\"\n [class.selected]=\"weekDay.weekdaySelected\"\n [class.selectable]=\"weekDay.events && weekDay.events.length > 0\"\n (click)=\"setUnit(weekDay)\">\n <co-icon *ngIf=\"index === 0 && showBackButton\" class=\"pointer-hover no-user-select sub-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subUnit()\"></co-icon>\n <div class=\"weekday-description\" [textContent]=\"weekDay.weekdayShort\"></div>\n <div class=\"weekday-value\" [textContent]=\"weekDay.weekdayDay + ' ' + weekDay.weekdayMonthShort\"></div>\n <co-icon *ngIf=\"index === 6\" class=\"pointer-hover no-user-select add-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addUnit()\"></co-icon>\n </div>\n </div>\n <div class=\"agenda-header-wrapper\" *ngIf=\"view === viewTypes.MonthView\">\n <div class=\"week-day-label\" *ngFor=\"let weekDay of weekDays; let index = index\">\n <co-icon *ngIf=\"index === 0 && showBackButton\" class=\"pointer-hover no-user-select sub-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointLeft)\" (click)=\"subUnit()\"></co-icon>\n <div class=\"weekday-description\" [textContent]=\"weekDay.weekdayShort\"></div>\n <co-icon *ngIf=\"index === 6\" class=\"pointer-hover no-user-select add-unit-icon dark\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" (click)=\"addUnit()\"></co-icon>\n </div>\n </div>\n ",
|
|
5548
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5549
|
+
},] }
|
|
5550
|
+
];
|
|
5551
|
+
AgendaHeaderComponent.ctorParameters = function () { return [
|
|
5552
|
+
{ type: exports["ɵr"], decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] },
|
|
5553
|
+
{ type: i0.ElementRef },
|
|
5554
|
+
{ type: i0.Renderer2 },
|
|
5555
|
+
{ type: i0.NgZone },
|
|
5556
|
+
{ type: IconCacheService }
|
|
5557
|
+
]; };
|
|
5558
|
+
AgendaHeaderComponent.propDecorators = {
|
|
5559
|
+
selectedDate: [{ type: i0.Input }],
|
|
5560
|
+
view: [{ type: i0.Input }],
|
|
5561
|
+
firstAvailableDate: [{ type: i0.Input }],
|
|
5562
|
+
eventsPerDay: [{ type: i0.Input }],
|
|
5563
|
+
viewChange: [{ type: i0.Output }],
|
|
5564
|
+
selectedDateChange: [{ type: i0.Output }],
|
|
5565
|
+
rangeChange: [{ type: i0.Output }]
|
|
5566
|
+
};
|
|
5567
|
+
|
|
5568
|
+
var AgendaViewComponent = /** @class */ (function () {
|
|
5569
|
+
function AgendaViewComponent() {
|
|
5570
|
+
this.view = CalendarView.WeekView;
|
|
5571
|
+
this.eventsPerDay = [];
|
|
5572
|
+
this.eventChecked = new i0.EventEmitter();
|
|
5573
|
+
this.viewTypes = CalendarView;
|
|
5574
|
+
}
|
|
5575
|
+
return AgendaViewComponent;
|
|
5576
|
+
}());
|
|
5577
|
+
AgendaViewComponent.decorators = [
|
|
5578
|
+
{ type: i0.Component, args: [{
|
|
5579
|
+
selector: "agenda-view",
|
|
5580
|
+
template: "\n <div class=\"view-wrapper mini-scrollbar\" [ngSwitch]=\"view\">\n <agenda-day-view *ngSwitchCase=\"viewTypes.DayView\"\n [selectedDate]=\"selectedDate\" [eventsPerDay]=\"eventsPerDay\" (eventChecked)=\"eventChecked.emit($event)\"></agenda-day-view>\n <agenda-week-view *ngSwitchCase=\"viewTypes.WeekView\"\n [view]=\"view\" [selectedDate]=\"selectedDate\" [eventsPerDay]=\"eventsPerDay\" (eventChecked)=\"eventChecked.emit($event)\"></agenda-week-view>\n <agenda-week-select-view *ngSwitchCase=\"viewTypes.WeekSelectView\"\n [view]=\"view\" [selectedDate]=\"selectedDate\" [eventsPerDay]=\"eventsPerDay\" (eventChecked)=\"eventChecked.emit($event)\"></agenda-week-select-view>\n <agenda-month-view *ngSwitchCase=\"viewTypes.MonthView\"\n [selectedDate]=\"selectedDate\" [eventsPerDay]=\"eventsPerDay\" (eventChecked)=\"eventChecked.emit($event)\"></agenda-month-view>\n </div>\n ",
|
|
5581
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5582
|
+
},] }
|
|
5583
|
+
];
|
|
5584
|
+
AgendaViewComponent.propDecorators = {
|
|
5585
|
+
view: [{ type: i0.Input }],
|
|
5586
|
+
selectedDate: [{ type: i0.Input }],
|
|
5587
|
+
eventsPerDay: [{ type: i0.Input }],
|
|
5588
|
+
eventChecked: [{ type: i0.Output }]
|
|
5589
|
+
};
|
|
5590
|
+
|
|
5591
|
+
var AgendaBaseViewComponent = /** @class */ (function () {
|
|
5592
|
+
function AgendaBaseViewComponent(locale, iconCacheService) {
|
|
5593
|
+
this.locale = locale;
|
|
5594
|
+
this.iconCacheService = iconCacheService;
|
|
5595
|
+
this.eventChecked = new i0.EventEmitter();
|
|
5596
|
+
this._eventsPerDay = [];
|
|
5597
|
+
}
|
|
5598
|
+
Object.defineProperty(AgendaBaseViewComponent.prototype, "selectedDate", {
|
|
5599
|
+
get: function () {
|
|
5600
|
+
return this._selectedDate;
|
|
5601
|
+
},
|
|
5602
|
+
set: function (value) {
|
|
5603
|
+
this._selectedDate = value;
|
|
5604
|
+
this._dateIsSet();
|
|
5605
|
+
},
|
|
5606
|
+
enumerable: false,
|
|
5607
|
+
configurable: true
|
|
5608
|
+
});
|
|
5609
|
+
Object.defineProperty(AgendaBaseViewComponent.prototype, "eventsPerDay", {
|
|
5610
|
+
set: function (value) {
|
|
5611
|
+
this._eventsPerDay = value;
|
|
5612
|
+
this._eventsAreSet();
|
|
5613
|
+
},
|
|
5614
|
+
enumerable: false,
|
|
5615
|
+
configurable: true
|
|
5616
|
+
});
|
|
5617
|
+
Object.defineProperty(AgendaBaseViewComponent.prototype, "eventsPerDate", {
|
|
5618
|
+
get: function () {
|
|
5619
|
+
return this._eventsPerDay;
|
|
5620
|
+
},
|
|
5621
|
+
enumerable: false,
|
|
5622
|
+
configurable: true
|
|
5623
|
+
});
|
|
5624
|
+
//overridable by descendents
|
|
5625
|
+
AgendaBaseViewComponent.prototype.prepareViewData = function () {
|
|
5626
|
+
};
|
|
5627
|
+
AgendaBaseViewComponent.prototype.getEventsFromDate = function (date) {
|
|
5628
|
+
var events = [];
|
|
5629
|
+
if (this.eventsPerDate) {
|
|
5630
|
+
var len = this.eventsPerDate.length;
|
|
5631
|
+
for (var i = 0; i < len; i++) {
|
|
5632
|
+
if (DateUtils.DatesEqual(date, this.eventsPerDate[i].date)) {
|
|
5633
|
+
events = this.eventsPerDate[i].events;
|
|
5634
|
+
break;
|
|
5635
|
+
}
|
|
5636
|
+
}
|
|
5637
|
+
}
|
|
5638
|
+
return events;
|
|
5639
|
+
};
|
|
5640
|
+
AgendaBaseViewComponent.prototype._dateIsSet = function () {
|
|
5641
|
+
this.prepareViewData();
|
|
5642
|
+
};
|
|
5643
|
+
AgendaBaseViewComponent.prototype._eventsAreSet = function () {
|
|
5644
|
+
this.prepareViewData();
|
|
5645
|
+
};
|
|
5646
|
+
return AgendaBaseViewComponent;
|
|
5647
|
+
}());
|
|
5648
|
+
AgendaBaseViewComponent.decorators = [
|
|
5649
|
+
{ type: i0.Directive }
|
|
5650
|
+
];
|
|
5651
|
+
AgendaBaseViewComponent.ctorParameters = function () { return [
|
|
5652
|
+
{ type: exports["ɵr"], decorators: [{ type: i0.Inject, args: [i0.LOCALE_ID,] }] },
|
|
5653
|
+
{ type: IconCacheService }
|
|
5654
|
+
]; };
|
|
5655
|
+
AgendaBaseViewComponent.propDecorators = {
|
|
5656
|
+
selectedDate: [{ type: i0.Input }],
|
|
5657
|
+
eventsPerDay: [{ type: i0.Input }],
|
|
5658
|
+
eventChecked: [{ type: i0.Output }]
|
|
5659
|
+
};
|
|
5660
|
+
|
|
5661
|
+
var AgendaMonthViewComponent = /** @class */ (function (_super) {
|
|
5662
|
+
__extends(AgendaMonthViewComponent, _super);
|
|
5663
|
+
function AgendaMonthViewComponent() {
|
|
5664
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
5665
|
+
_this.month = NULL_MONTH;
|
|
5666
|
+
_this.firstWeekDays = [];
|
|
5667
|
+
_this.weeks = [];
|
|
5668
|
+
return _this;
|
|
5669
|
+
}
|
|
5670
|
+
AgendaMonthViewComponent.prototype.prepareViewData = function () {
|
|
5671
|
+
var month = new Month();
|
|
5672
|
+
if (this.selectedDate) {
|
|
5673
|
+
var day = DateUtils.GetFirstDayOfMonth(this.selectedDate);
|
|
5674
|
+
var endOfMonth = DateUtils.GetLastDayOfMonth(this.selectedDate);
|
|
5675
|
+
var oneMoreIteration = false;
|
|
5676
|
+
var continueLoop = true;
|
|
5677
|
+
while (continueLoop) {
|
|
5678
|
+
if (oneMoreIteration) {
|
|
5679
|
+
continueLoop = false;
|
|
5680
|
+
}
|
|
5681
|
+
var week = CalendarUtils.GetDaysOfWeek(day);
|
|
5682
|
+
var len = week.weekDays.length;
|
|
5683
|
+
for (var i = 0; i < len; i++) {
|
|
5684
|
+
week.weekDays[i].events = this.getEventsFromDate(week.weekDays[i].date);
|
|
5685
|
+
week.weekDays[i].inView = week.weekDays[i].date.getMonth() === this.selectedDate.getMonth();
|
|
5686
|
+
}
|
|
5687
|
+
month.weeks.push(week);
|
|
5688
|
+
day.setDate(day.getDate() + 7);
|
|
5689
|
+
if (day.getTime() >= endOfMonth.getTime()) {
|
|
5690
|
+
oneMoreIteration = true;
|
|
5691
|
+
}
|
|
5692
|
+
}
|
|
5693
|
+
this.month = month;
|
|
5694
|
+
this.firstWeekDays = this.month.firstWeek.weekDays;
|
|
5695
|
+
this.weeks = month.weeks;
|
|
5696
|
+
}
|
|
5697
|
+
};
|
|
5698
|
+
return AgendaMonthViewComponent;
|
|
5699
|
+
}(AgendaBaseViewComponent));
|
|
5700
|
+
AgendaMonthViewComponent.decorators = [
|
|
5701
|
+
{ type: i0.Component, args: [{
|
|
5702
|
+
selector: "agenda-month-view",
|
|
5703
|
+
template: "\n <div class=\"view-wrapper\">\n <div class=\"hour-view-labels-wrapper\"></div>\n <div class=\"weeks\">\n <div class=\"week\" *ngFor=\"let week of weeks\" fxLayout=\"row\">\n <div class=\"week-day\" *ngFor=\"let weekDay of week.weekDays\" [class.not-in-month]=\"!weekDay.inView\">\n <div class=\"day\" [textContent]=\"weekDay.weekdayDay\"></div>\n </div>\n </div>\n </div>\n </div>\n ",
|
|
5704
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5705
|
+
},] }
|
|
5706
|
+
];
|
|
5707
|
+
|
|
5708
|
+
var AgendaDayViewComponent = /** @class */ (function (_super) {
|
|
5709
|
+
__extends(AgendaDayViewComponent, _super);
|
|
5710
|
+
function AgendaDayViewComponent() {
|
|
5711
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
5712
|
+
_this.events = [];
|
|
5713
|
+
return _this;
|
|
5714
|
+
}
|
|
5715
|
+
AgendaDayViewComponent.prototype.prepareViewData = function () {
|
|
5716
|
+
if (this.eventsPerDate && this.eventsPerDate.length > 0) {
|
|
5717
|
+
this.events = this.eventsPerDate[0].events;
|
|
5718
|
+
}
|
|
5719
|
+
};
|
|
5720
|
+
return AgendaDayViewComponent;
|
|
5721
|
+
}(AgendaBaseViewComponent));
|
|
5722
|
+
AgendaDayViewComponent.decorators = [
|
|
5723
|
+
{ type: i0.Component, args: [{
|
|
5724
|
+
selector: "agenda-day-view",
|
|
5725
|
+
template: "\n <div class=\"view-wrapper\">\n <agenda-hour-view-labels [date]=\"selectedDate\"></agenda-hour-view-labels>\n <agenda-hour-view [date]=\"selectedDate\">\n <agenda-events\n [halfHourHeight]=\"40\"\n [events]=\"events\"\n (eventChecked)=\"eventChecked.emit($event)\"\n ></agenda-events>\n </agenda-hour-view>\n </div>\n ",
|
|
5726
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5727
|
+
},] }
|
|
5728
|
+
];
|
|
5729
|
+
|
|
5730
|
+
var AgendaWeekViewComponent = /** @class */ (function (_super) {
|
|
5731
|
+
__extends(AgendaWeekViewComponent, _super); /*implements OnInit, OnDestroy*/
|
|
5732
|
+
function AgendaWeekViewComponent() {
|
|
5733
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
5734
|
+
_this.view = CalendarView.WeekView;
|
|
5735
|
+
_this.week = NULL_WEEK;
|
|
5736
|
+
return _this;
|
|
5737
|
+
}
|
|
5738
|
+
AgendaWeekViewComponent.prototype.prepareViewData = function () {
|
|
5739
|
+
if (this.selectedDate) {
|
|
5740
|
+
// get the events
|
|
5741
|
+
var week = CalendarUtils.GetDaysOfWeek(this.selectedDate);
|
|
5742
|
+
var len = week.weekDays.length;
|
|
5743
|
+
for (var i = 0; i < len; i++) {
|
|
5744
|
+
week.weekDays[i].events = this.getEventsFromDate(week.weekDays[i].date);
|
|
5745
|
+
}
|
|
5746
|
+
this.week = week;
|
|
5747
|
+
}
|
|
5748
|
+
};
|
|
5749
|
+
return AgendaWeekViewComponent;
|
|
5750
|
+
}(AgendaBaseViewComponent /*implements OnInit, OnDestroy*/));
|
|
5751
|
+
AgendaWeekViewComponent.decorators = [
|
|
5752
|
+
{ type: i0.Component, args: [{
|
|
5753
|
+
selector: "agenda-week-view",
|
|
5754
|
+
template: "\n <div class=\"view-wrapper\">\n <agenda-hour-view-labels [date]=\"selectedDate\"></agenda-hour-view-labels>\n <div class=\"week-day\" *ngFor=\"let weekDay of week.weekDays\">\n <agenda-hour-view [date]=\"weekDay.date\">\n <agenda-events\n [halfHourHeight]=\"40\"\n [events]=\"weekDay.events\"\n (eventChecked)=\"eventChecked.emit($event)\"\n [view]=\"view\"\n ></agenda-events>\n </agenda-hour-view>\n </div>\n </div>\n ",
|
|
5755
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5756
|
+
},] }
|
|
5757
|
+
];
|
|
5758
|
+
AgendaWeekViewComponent.propDecorators = {
|
|
5759
|
+
view: [{ type: i0.Input }]
|
|
5760
|
+
};
|
|
5761
|
+
|
|
5762
|
+
var AgendaWeekSelectViewComponent = /** @class */ (function (_super) {
|
|
5763
|
+
__extends(AgendaWeekSelectViewComponent, _super);
|
|
5764
|
+
function AgendaWeekSelectViewComponent() {
|
|
5765
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
5766
|
+
_this.view = CalendarView.WeekSelectView;
|
|
5767
|
+
_this.week = NULL_WEEK;
|
|
5768
|
+
_this.icons = Icon;
|
|
5769
|
+
return _this;
|
|
5770
|
+
}
|
|
5771
|
+
AgendaWeekSelectViewComponent.prototype.prepareViewData = function () {
|
|
5772
|
+
if (this.selectedDate) {
|
|
5773
|
+
// get the events
|
|
5774
|
+
var week = CalendarUtils.GetDaysOfWeek(this.selectedDate);
|
|
5775
|
+
var len = week.weekDays.length;
|
|
5776
|
+
for (var i = 0; i < len; i++) {
|
|
5777
|
+
week.weekDays[i].events = this.getEventsFromDate(week.weekDays[i].date);
|
|
5778
|
+
}
|
|
5779
|
+
this.week = week;
|
|
5780
|
+
}
|
|
5781
|
+
};
|
|
5782
|
+
return AgendaWeekSelectViewComponent;
|
|
5783
|
+
}(AgendaBaseViewComponent));
|
|
5784
|
+
AgendaWeekSelectViewComponent.decorators = [
|
|
5785
|
+
{ type: i0.Component, args: [{
|
|
5786
|
+
selector: "agenda-week-select-view",
|
|
5787
|
+
template: "\n <div class=\"view-wrapper week-select-view\">\n <div class=\"week-day\" *ngFor=\"let weekDay of week.weekDays\">\n <div class=\"week-select-container\" *ngIf=\"weekDay.weekdaySelected\">\n <div class=\"week-select-left\">\n <h3 [textContent]=\"'AGENDA_CHOOSE_DELIVERY_PERIOD'\"></h3>\n <div class=\"week-select-list mini-scrollbar\">\n <agenda-events\n [halfHourHeight]=\"40\"\n [events]=\"weekDay.events\"\n (eventChecked)=\"eventChecked.emit($event)\"\n [view]=\"view\"\n ></agenda-events>\n <div class=\"no-events-banner\" *ngIf=\"weekDay.events.length === 0\">\n <p [textContent]=\"'AGENDA_NO_PERIODS_AVAILABLE'\"></p>\n </div>\n </div>\n </div>\n <div class=\"week-select-right\">\n <h3 [textContent]=\"'AGENDA_FOR_EVERY_PERIOD'\"></h3>\n <ul>\n <li><co-icon [iconData]=\"iconCacheService.getIcon(icons.CheckRound)\" class=\"small action-color moment-icon\"></co-icon><span [textContent]=\"'AGENDA_FOR_EVERY_PERIOD_REASON1'\"></span></li>\n <li><co-icon [iconData]=\"iconCacheService.getIcon(icons.CheckRound)\" class=\"small action-color moment-icon\"></co-icon><span [textContent]=\"'AGENDA_FOR_EVERY_PERIOD_REASON2'\"></span></li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n ",
|
|
5788
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5789
|
+
},] }
|
|
5790
|
+
];
|
|
5791
|
+
AgendaWeekSelectViewComponent.propDecorators = {
|
|
5792
|
+
view: [{ type: i0.Input }]
|
|
5793
|
+
};
|
|
5794
|
+
|
|
5795
|
+
var AgendaHourViewComponent = /** @class */ (function () {
|
|
5796
|
+
function AgendaHourViewComponent() {
|
|
5797
|
+
this.datesByTheHour = [];
|
|
5798
|
+
this._date = new Date();
|
|
5799
|
+
}
|
|
5800
|
+
Object.defineProperty(AgendaHourViewComponent.prototype, "date", {
|
|
5801
|
+
get: function () {
|
|
5802
|
+
return this._date;
|
|
5803
|
+
},
|
|
5804
|
+
set: function (value) {
|
|
5805
|
+
this._date = new Date(value);
|
|
5806
|
+
this._prepareViewData();
|
|
5807
|
+
},
|
|
5808
|
+
enumerable: false,
|
|
5809
|
+
configurable: true
|
|
5810
|
+
});
|
|
5811
|
+
// fixme remove ctrl + c, ctrl + v code duplication with AgendaHourViewLabelsComponent._prepareViewData()
|
|
5812
|
+
AgendaHourViewComponent.prototype._prepareViewData = function () {
|
|
5813
|
+
this.datesByTheHour.length = 0;
|
|
5814
|
+
if (this.date) {
|
|
5815
|
+
var newDate = new Date(this.date);
|
|
5816
|
+
newDate.setHours(0, 0, 0, 0);
|
|
5817
|
+
this.datesByTheHour.push(newDate);
|
|
5818
|
+
for (var i = 0; i < 23; i++) {
|
|
5819
|
+
newDate = new Date(newDate);
|
|
5820
|
+
newDate.setHours(newDate.getHours() + 1);
|
|
5821
|
+
this.datesByTheHour.push(newDate);
|
|
5822
|
+
}
|
|
5823
|
+
}
|
|
5824
|
+
};
|
|
5825
|
+
return AgendaHourViewComponent;
|
|
5826
|
+
}());
|
|
5827
|
+
AgendaHourViewComponent.decorators = [
|
|
5828
|
+
{ type: i0.Component, args: [{
|
|
5829
|
+
selector: "agenda-hour-view",
|
|
5830
|
+
template: "\n <div class=\"row-per-hour\" *ngFor=\"let dateByTheHour of datesByTheHour\">\n <div fxLayout=\"row\">\n <agenda-hour-cell [date]=\"dateByTheHour\"></agenda-hour-cell>\n </div>\n </div>\n <ng-content></ng-content>\n ",
|
|
5831
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5832
|
+
},] }
|
|
5833
|
+
];
|
|
5834
|
+
AgendaHourViewComponent.propDecorators = {
|
|
5835
|
+
date: [{ type: i0.Input }]
|
|
5836
|
+
};
|
|
5837
|
+
|
|
5838
|
+
var AgendaHourCellComponent = /** @class */ (function () {
|
|
5839
|
+
function AgendaHourCellComponent() {
|
|
5840
|
+
this.onlyLabels = false;
|
|
5841
|
+
this.noLabels = false;
|
|
5842
|
+
}
|
|
5843
|
+
Object.defineProperty(AgendaHourCellComponent.prototype, "date", {
|
|
5844
|
+
get: function () {
|
|
5845
|
+
return this._date;
|
|
5846
|
+
},
|
|
5847
|
+
set: function (value) {
|
|
5848
|
+
this._date = value;
|
|
5849
|
+
this._setNextHalfHour();
|
|
5850
|
+
},
|
|
5851
|
+
enumerable: false,
|
|
5852
|
+
configurable: true
|
|
5853
|
+
});
|
|
5854
|
+
AgendaHourCellComponent.prototype._setNextHalfHour = function () {
|
|
5855
|
+
this.datePlushalfHour = new Date(this._date);
|
|
5856
|
+
this.datePlushalfHour.setMinutes(this.datePlushalfHour.getMinutes() + 30);
|
|
5857
|
+
};
|
|
5858
|
+
return AgendaHourCellComponent;
|
|
5859
|
+
}());
|
|
5860
|
+
AgendaHourCellComponent.decorators = [
|
|
5861
|
+
{ type: i0.Component, args: [{
|
|
5862
|
+
selector: "agenda-hour-cell",
|
|
5863
|
+
template: "\n <div class=\"row-per-half-hour\">\n <agenda-half-hour-cell [date]=\"date\" [showLabel]=\"onlyLabels && !noLabels\"></agenda-half-hour-cell>\n <agenda-half-hour-cell [date]=\"datePlushalfHour\"></agenda-half-hour-cell>\n </div>\n ",
|
|
5864
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5865
|
+
},] }
|
|
5866
|
+
];
|
|
5867
|
+
AgendaHourCellComponent.propDecorators = {
|
|
5868
|
+
onlyLabels: [{ type: i0.Input }],
|
|
5869
|
+
noLabels: [{ type: i0.Input }],
|
|
5870
|
+
date: [{ type: i0.Input }]
|
|
5871
|
+
};
|
|
5872
|
+
|
|
5873
|
+
var AgendaHourViewLabelsComponent = /** @class */ (function () {
|
|
5874
|
+
function AgendaHourViewLabelsComponent() {
|
|
5875
|
+
this.noLabels = false;
|
|
5876
|
+
this.datesByTheHour = [];
|
|
5877
|
+
this._date = new Date();
|
|
5878
|
+
}
|
|
5879
|
+
Object.defineProperty(AgendaHourViewLabelsComponent.prototype, "date", {
|
|
5880
|
+
get: function () {
|
|
5881
|
+
return this._date;
|
|
5882
|
+
},
|
|
5883
|
+
set: function (value) {
|
|
5884
|
+
this._date = new Date(value);
|
|
5885
|
+
this._date.setDate(1);
|
|
5886
|
+
this._date.setMonth(1);
|
|
5887
|
+
this._date.setFullYear(1);
|
|
5888
|
+
this._prepareViewData();
|
|
5889
|
+
},
|
|
5890
|
+
enumerable: false,
|
|
5891
|
+
configurable: true
|
|
5892
|
+
});
|
|
5893
|
+
// fixme remove ctrl + c, ctrl + v code duplication with AgendaHourViewComponent._prepareViewData()
|
|
5894
|
+
AgendaHourViewLabelsComponent.prototype._prepareViewData = function () {
|
|
5895
|
+
this.datesByTheHour.length = 0;
|
|
5896
|
+
if (this.date) {
|
|
5897
|
+
var newDate = new Date(this.date);
|
|
5898
|
+
newDate.setHours(0, 0, 0, 0);
|
|
5899
|
+
this.datesByTheHour.push(newDate);
|
|
5900
|
+
for (var i = 0; i < 23; i++) {
|
|
5901
|
+
newDate = new Date(newDate);
|
|
5902
|
+
newDate.setHours(newDate.getHours() + 1);
|
|
5903
|
+
this.datesByTheHour.push(newDate);
|
|
5904
|
+
}
|
|
5905
|
+
}
|
|
5906
|
+
};
|
|
5907
|
+
return AgendaHourViewLabelsComponent;
|
|
5908
|
+
}());
|
|
5909
|
+
AgendaHourViewLabelsComponent.decorators = [
|
|
5910
|
+
{ type: i0.Component, args: [{
|
|
5911
|
+
selector: "agenda-hour-view-labels",
|
|
5912
|
+
template: "\n <div class=\"row-per-hour\" *ngFor=\"let dateByTheHour of datesByTheHour\">\n <div>\n <agenda-hour-cell [date]=\"dateByTheHour\" onlyLabels [noLabels]=\"noLabels\"></agenda-hour-cell>\n </div>\n </div>\n ",
|
|
5913
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5914
|
+
},] }
|
|
5915
|
+
];
|
|
5916
|
+
AgendaHourViewLabelsComponent.propDecorators = {
|
|
5917
|
+
date: [{ type: i0.Input }],
|
|
5918
|
+
noLabels: [{ type: i0.Input }]
|
|
5919
|
+
};
|
|
5920
|
+
|
|
5921
|
+
var AgendaHalfHourCellComponent = /** @class */ (function () {
|
|
5922
|
+
function AgendaHalfHourCellComponent(_renderer) {
|
|
5923
|
+
this._renderer = _renderer;
|
|
5924
|
+
this.showLabel = false;
|
|
5925
|
+
this.showCurrentTime = false;
|
|
5926
|
+
this.currentTimeTop = 0;
|
|
5927
|
+
}
|
|
5928
|
+
Object.defineProperty(AgendaHalfHourCellComponent.prototype, "date", {
|
|
5929
|
+
get: function () {
|
|
5930
|
+
return this._date;
|
|
5931
|
+
},
|
|
5932
|
+
set: function (value) {
|
|
5933
|
+
this._date = value;
|
|
5934
|
+
this._checkDate();
|
|
5935
|
+
this._checkWorkingDayStart();
|
|
5936
|
+
},
|
|
5937
|
+
enumerable: false,
|
|
5938
|
+
configurable: true
|
|
5939
|
+
});
|
|
5940
|
+
AgendaHalfHourCellComponent.prototype.ngOnDestroy = function () {
|
|
5941
|
+
this.currentTimeElement = undefined;
|
|
5942
|
+
};
|
|
5943
|
+
AgendaHalfHourCellComponent.prototype._checkDate = function () {
|
|
5944
|
+
var checkDate = new Date();
|
|
5945
|
+
var minutesFrom = this.date.getMinutes();
|
|
5946
|
+
var minutesTo = minutesFrom + 30;
|
|
5947
|
+
if (DateUtils.DatesEqual(this.date, checkDate)) {
|
|
5948
|
+
if (checkDate.getHours() === this.date.getHours() && (checkDate.getMinutes() > minutesFrom && checkDate.getMinutes() < minutesTo)) {
|
|
5949
|
+
this.currentTimeTop = (Math.max(checkDate.getMinutes(), .01) / 60) * 100;
|
|
5950
|
+
this._positionCurrentTime();
|
|
5951
|
+
this.showCurrentTime = true;
|
|
5952
|
+
}
|
|
5953
|
+
}
|
|
5954
|
+
};
|
|
5955
|
+
AgendaHalfHourCellComponent.prototype._checkWorkingDayStart = function () {
|
|
5956
|
+
this.id = (this._date.getHours() === 8 && this._date.getMinutes() === 30) ? "dayStart" : "";
|
|
5957
|
+
};
|
|
5958
|
+
AgendaHalfHourCellComponent.prototype._positionCurrentTime = function () {
|
|
5959
|
+
if (this.currentTimeElement) {
|
|
5960
|
+
this._renderer.setStyle(this.currentTimeElement.nativeElement, "top", this.currentTimeTop + "%");
|
|
5961
|
+
this.currentTimeElement.nativeElement.scrollIntoView();
|
|
5962
|
+
}
|
|
5963
|
+
};
|
|
5964
|
+
return AgendaHalfHourCellComponent;
|
|
5965
|
+
}());
|
|
5966
|
+
AgendaHalfHourCellComponent.decorators = [
|
|
5967
|
+
{ type: i0.Component, args: [{
|
|
5968
|
+
selector: "agenda-half-hour-cell",
|
|
5969
|
+
template: "\n <div id=\"{{id}}\" class=\"cell-wrapper\">\n <div *ngIf=\"showLabel\" [class.show]=\"showLabel\" class=\"half-hour-label\">\n <div [textContent]=\"date | date:'HH:mm'\"></div>\n </div>\n <div *ngIf=\"showCurrentTime\" id=\"currentTime\" class=\"current-time\" #currentTime></div>\n <div class=\"content-wrapper\">\n <ng-content></ng-content>\n </div>\n </div>\n ",
|
|
5970
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5971
|
+
},] }
|
|
5972
|
+
];
|
|
5973
|
+
AgendaHalfHourCellComponent.ctorParameters = function () { return [
|
|
5974
|
+
{ type: i0.Renderer2 }
|
|
5975
|
+
]; };
|
|
5976
|
+
AgendaHalfHourCellComponent.propDecorators = {
|
|
5977
|
+
currentTimeElement: [{ type: i0.ViewChild, args: ["currentTime",] }],
|
|
5978
|
+
date: [{ type: i0.Input }],
|
|
5979
|
+
showLabel: [{ type: i0.Input }]
|
|
5980
|
+
};
|
|
5981
|
+
|
|
5982
|
+
var AgendaEventsComponent = /** @class */ (function () {
|
|
5983
|
+
function AgendaEventsComponent() {
|
|
5984
|
+
this.viewTypes = CalendarView;
|
|
5985
|
+
this.view = CalendarView.WeekView;
|
|
5986
|
+
this.type = "";
|
|
5987
|
+
this.events = [];
|
|
5988
|
+
this.eventChecked = new i0.EventEmitter();
|
|
5989
|
+
}
|
|
5990
|
+
return AgendaEventsComponent;
|
|
5991
|
+
}());
|
|
5992
|
+
AgendaEventsComponent.decorators = [
|
|
5993
|
+
{ type: i0.Component, args: [{
|
|
5994
|
+
selector: "agenda-events",
|
|
5995
|
+
template: "\n <ng-container *ngIf=\"view !== viewTypes.WeekSelectView\">\n <agenda-event\n *ngFor=\"let event of events\"\n [halfHourHeight]=\"halfHourHeight\"\n [event]=\"event\"\n (eventChecked)=\"eventChecked.emit($event)\"\n ></agenda-event>\n </ng-container>\n <ng-container *ngIf=\"view === viewTypes.WeekSelectView\">\n <agenda-select-event\n *ngFor=\"let event of events\"\n [event]=\"event\"\n (eventChecked)=\"eventChecked.emit($event)\"\n ></agenda-select-event>\n </ng-container>\n ",
|
|
5996
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
5997
|
+
},] }
|
|
5998
|
+
];
|
|
5999
|
+
AgendaEventsComponent.ctorParameters = function () { return []; };
|
|
6000
|
+
AgendaEventsComponent.propDecorators = {
|
|
6001
|
+
view: [{ type: i0.Input }],
|
|
6002
|
+
type: [{ type: i0.Input }],
|
|
6003
|
+
events: [{ type: i0.Input }],
|
|
6004
|
+
halfHourHeight: [{ type: i0.Input }],
|
|
6005
|
+
eventChecked: [{ type: i0.Output }]
|
|
6006
|
+
};
|
|
6007
|
+
|
|
6008
|
+
var AgendaEventComponent = /** @class */ (function () {
|
|
6009
|
+
function AgendaEventComponent(_elementRef, _renderer, iconCacheService) {
|
|
6010
|
+
this._elementRef = _elementRef;
|
|
6011
|
+
this._renderer = _renderer;
|
|
6012
|
+
this.iconCacheService = iconCacheService;
|
|
6013
|
+
this.icons = Icon;
|
|
6014
|
+
this.event = NULL_AGENDA_EVENT;
|
|
6015
|
+
this.eventChecked = new i0.EventEmitter();
|
|
6016
|
+
}
|
|
6017
|
+
AgendaEventComponent.prototype.ngOnDestroy = function () {
|
|
6018
|
+
this._elementRef = undefined;
|
|
6019
|
+
};
|
|
6020
|
+
AgendaEventComponent.prototype.ngOnInit = function () {
|
|
6021
|
+
var hourTo = this.event.from.getHours();
|
|
6022
|
+
var minutesTo = this.event.from.getMinutes();
|
|
6023
|
+
var multiply = hourTo + (minutesTo / 60);
|
|
6024
|
+
var top = multiply * (this.halfHourHeight * 2);
|
|
6025
|
+
this._renderer.setStyle(this._elementRef.nativeElement, "top", top + "px");
|
|
6026
|
+
var hours = Math.abs(this.event.to.getTime() - this.event.from.getTime()) / 3600000;
|
|
6027
|
+
var height = hours * (this.halfHourHeight * 2) - 1;
|
|
6028
|
+
this._renderer.setStyle(this._elementRef.nativeElement, "height", height + "px");
|
|
6029
|
+
};
|
|
6030
|
+
AgendaEventComponent.prototype.checkEvent = function (event) {
|
|
6031
|
+
this.event.checked = !this.event.checked;
|
|
6032
|
+
this.eventChecked.emit(this.event);
|
|
6033
|
+
};
|
|
6034
|
+
return AgendaEventComponent;
|
|
6035
|
+
}());
|
|
6036
|
+
AgendaEventComponent.decorators = [
|
|
6037
|
+
{ type: i0.Component, args: [{
|
|
6038
|
+
selector: "agenda-event",
|
|
6039
|
+
template: "\n <div class=\"agenda-event-wrapper\" [class.checkable]=\"event.showCheckbox\" [class.selected]=\"event.checked\" (click)=\"checkEvent($event)\">\n <div [textContent]=\"event.fromToRepresentation\" class=\"event-description\"></div>\n <co-icon *ngIf=\"event.showCheckbox\" [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" [class.checked]=\"event.checked\"></co-icon>\n </div>\n ",
|
|
6040
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
6041
|
+
},] }
|
|
6042
|
+
];
|
|
6043
|
+
AgendaEventComponent.ctorParameters = function () { return [
|
|
6044
|
+
{ type: i0.ElementRef },
|
|
6045
|
+
{ type: i0.Renderer2 },
|
|
6046
|
+
{ type: IconCacheService }
|
|
6047
|
+
]; };
|
|
6048
|
+
AgendaEventComponent.propDecorators = {
|
|
6049
|
+
event: [{ type: i0.Input }],
|
|
6050
|
+
halfHourHeight: [{ type: i0.Input }],
|
|
6051
|
+
eventChecked: [{ type: i0.Output }]
|
|
6052
|
+
};
|
|
6053
|
+
|
|
6054
|
+
// Pipe capable of transforming the first character of a string-value to upper case.
|
|
6055
|
+
var UCfirstPipe = /** @class */ (function () {
|
|
6056
|
+
function UCfirstPipe() {
|
|
6057
|
+
}
|
|
6058
|
+
UCfirstPipe.prototype.transform = function (value) {
|
|
6059
|
+
if (typeof value === "string") {
|
|
6060
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
6061
|
+
}
|
|
6062
|
+
return value;
|
|
6063
|
+
};
|
|
6064
|
+
return UCfirstPipe;
|
|
6065
|
+
}());
|
|
6066
|
+
UCfirstPipe.decorators = [
|
|
6067
|
+
{ type: i0.Pipe, args: [{
|
|
6068
|
+
name: "ucfirst"
|
|
6069
|
+
},] }
|
|
6070
|
+
];
|
|
6071
|
+
|
|
6072
|
+
var MASTER_PIPES = [
|
|
6073
|
+
ArrayNumberPipe,
|
|
6074
|
+
UCfirstPipe
|
|
6075
|
+
];
|
|
6076
|
+
|
|
6077
|
+
// <b>Enum</b> Represents the different states of the three way thumb.
|
|
6078
|
+
var ThumbThreeWayState;
|
|
6079
|
+
(function (ThumbThreeWayState) {
|
|
6080
|
+
ThumbThreeWayState[ThumbThreeWayState["Left"] = 0] = "Left";
|
|
6081
|
+
ThumbThreeWayState[ThumbThreeWayState["Middle"] = 1] = "Middle";
|
|
6082
|
+
ThumbThreeWayState[ThumbThreeWayState["Right"] = 2] = "Right";
|
|
6083
|
+
})(ThumbThreeWayState || (ThumbThreeWayState = {}));
|
|
6084
|
+
function NextStateOfThumbThreeWay(state) {
|
|
6085
|
+
switch (state) {
|
|
6086
|
+
case ThumbThreeWayState.Left:
|
|
6087
|
+
return ThumbThreeWayState.Middle;
|
|
6088
|
+
case ThumbThreeWayState.Middle:
|
|
6089
|
+
return ThumbThreeWayState.Right;
|
|
6090
|
+
case ThumbThreeWayState.Right:
|
|
6091
|
+
default:
|
|
6092
|
+
return ThumbThreeWayState.Left;
|
|
6093
|
+
}
|
|
6094
|
+
}
|
|
6095
|
+
|
|
6096
|
+
// Static utility functions holder related to Maps.
|
|
6097
|
+
var MapUtils = /** @class */ (function () {
|
|
6098
|
+
function MapUtils() {
|
|
6099
|
+
}
|
|
6100
|
+
/**
|
|
6101
|
+
* Returns the first key from given map, for which the value filter holds true. Basically a reverse Map.get(key) function.
|
|
6102
|
+
* @param map
|
|
6103
|
+
* @param valueFilter For the first value that returns true for this filter functions, its key will be returned.
|
|
6104
|
+
*/
|
|
6105
|
+
MapUtils.FindKeyByValue = function (map, valueFilter) {
|
|
6106
|
+
var _this = this;
|
|
6107
|
+
if (!map || !valueFilter) {
|
|
6108
|
+
return undefined;
|
|
6109
|
+
}
|
|
6110
|
+
var foundKey = undefined;
|
|
6111
|
+
var keyWasFound = false;
|
|
6112
|
+
map.forEach(function (value, key) {
|
|
6113
|
+
if (!keyWasFound && valueFilter.call(_this, value)) {
|
|
6114
|
+
foundKey = key;
|
|
6115
|
+
keyWasFound = true;
|
|
6116
|
+
}
|
|
6117
|
+
});
|
|
6118
|
+
return foundKey;
|
|
6119
|
+
};
|
|
6120
|
+
/**
|
|
6121
|
+
* Inserts given arrayEntry into given map, under given mapKey. What's special here, is that a NEW map entry is created with an array
|
|
6122
|
+
* containing the single [arrayEntry] item, if no entry yet existed.
|
|
6123
|
+
* @param map
|
|
6124
|
+
* @param mapKey
|
|
6125
|
+
* @param arrayEntry
|
|
6126
|
+
*/
|
|
6127
|
+
MapUtils.InsertArrayItemIntoMap = function (map, mapKey, arrayEntry) {
|
|
6128
|
+
if (!map) {
|
|
6129
|
+
return;
|
|
6130
|
+
}
|
|
6131
|
+
if (!map.has(mapKey)) {
|
|
6132
|
+
map.set(mapKey, [arrayEntry]);
|
|
6133
|
+
}
|
|
6134
|
+
else {
|
|
6135
|
+
map.get(mapKey).push(arrayEntry);
|
|
6136
|
+
}
|
|
6137
|
+
};
|
|
6138
|
+
return MapUtils;
|
|
6139
|
+
}());
|
|
6140
|
+
|
|
6141
|
+
var ViewSelectComponent = /** @class */ (function () {
|
|
6142
|
+
function ViewSelectComponent() {
|
|
6143
|
+
this._viewsToThumb = new Map([
|
|
6144
|
+
[CalendarView.DayView, ThumbThreeWayState.Left],
|
|
6145
|
+
[CalendarView.WeekView, ThumbThreeWayState.Middle],
|
|
6146
|
+
[CalendarView.MonthView, ThumbThreeWayState.Right]
|
|
6147
|
+
]);
|
|
6148
|
+
this.selectedView = CalendarView.WeekView;
|
|
6149
|
+
this.selectedViewChange = new i0.EventEmitter();
|
|
6150
|
+
}
|
|
6151
|
+
Object.defineProperty(ViewSelectComponent.prototype, "modelAsThumbState", {
|
|
6152
|
+
get: function () {
|
|
6153
|
+
return this._viewsToThumb.get(this.selectedView);
|
|
6154
|
+
},
|
|
6155
|
+
enumerable: false,
|
|
6156
|
+
configurable: true
|
|
6157
|
+
});
|
|
6158
|
+
ViewSelectComponent.prototype.onThumbStateChange = function (thumbState) {
|
|
6159
|
+
this.selectedView = MapUtils.FindKeyByValue(this._viewsToThumb, function (value) {
|
|
6160
|
+
return (value === thumbState);
|
|
6161
|
+
});
|
|
6162
|
+
this.selectedViewChange.emit(this.selectedView);
|
|
6163
|
+
};
|
|
6164
|
+
return ViewSelectComponent;
|
|
6165
|
+
}());
|
|
6166
|
+
ViewSelectComponent.decorators = [
|
|
6167
|
+
{ type: i0.Component, args: [{
|
|
6168
|
+
selector: "view-select",
|
|
6169
|
+
template: "\n <div class=\"select-wrapper\">\n <div [textContent]=\"'DAY'\" class=\"label\"></div>\n <div [textContent]=\"'MONTH'\" class=\"label\"></div>\n </div>\n ",
|
|
6170
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
6171
|
+
},] }
|
|
6172
|
+
];
|
|
6173
|
+
ViewSelectComponent.ctorParameters = function () { return []; };
|
|
6174
|
+
ViewSelectComponent.propDecorators = {
|
|
6175
|
+
selectedView: [{ type: i0.Input }],
|
|
6176
|
+
selectedViewChange: [{ type: i0.Output }]
|
|
6177
|
+
};
|
|
6178
|
+
|
|
6179
|
+
var AgendaSelectEventComponent = /** @class */ (function () {
|
|
6180
|
+
function AgendaSelectEventComponent(iconCacheService) {
|
|
6181
|
+
this.iconCacheService = iconCacheService;
|
|
6182
|
+
this.icons = Icon;
|
|
6183
|
+
this.event = NULL_AGENDA_EVENT;
|
|
6184
|
+
this.eventChecked = new i0.EventEmitter();
|
|
6185
|
+
}
|
|
6186
|
+
AgendaSelectEventComponent.prototype.checkEvent = function (event) {
|
|
6187
|
+
this.event.checked = !this.event.checked;
|
|
6188
|
+
this.eventChecked.emit(this.event);
|
|
6189
|
+
};
|
|
6190
|
+
return AgendaSelectEventComponent;
|
|
6191
|
+
}());
|
|
6192
|
+
AgendaSelectEventComponent.decorators = [
|
|
6193
|
+
{ type: i0.Component, args: [{
|
|
6194
|
+
selector: "agenda-select-event",
|
|
6195
|
+
template: "\n <div class=\"week-select-item\" (click)=\"checkEvent($event)\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" class=\"select-icon action-color\" *ngIf=\"!event.checked\"></co-icon>\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.ArrowPointRight)\" class=\"select-icon action-color\" *ngIf=\"event.checked\"></co-icon>\n <div class=\"moment-name\">\n <small>{{ event.date | date: 'EEEE d MMMM' | uppercase }}</small>\n <h2>{{ event.description }}</h2>\n </div>\n </div>\n "
|
|
6196
|
+
},] }
|
|
6197
|
+
];
|
|
6198
|
+
AgendaSelectEventComponent.ctorParameters = function () { return [
|
|
6199
|
+
{ type: IconCacheService }
|
|
6200
|
+
]; };
|
|
6201
|
+
AgendaSelectEventComponent.propDecorators = {
|
|
6202
|
+
event: [{ type: i0.Input }],
|
|
6203
|
+
eventChecked: [{ type: i0.Output }]
|
|
6204
|
+
};
|
|
6205
|
+
|
|
6206
|
+
var DatePlanningModule = /** @class */ (function () {
|
|
6207
|
+
function DatePlanningModule() {
|
|
6208
|
+
}
|
|
6209
|
+
return DatePlanningModule;
|
|
6210
|
+
}());
|
|
6211
|
+
DatePlanningModule.decorators = [
|
|
6212
|
+
{ type: i0.NgModule, args: [{
|
|
6213
|
+
imports: [
|
|
6214
|
+
common.CommonModule,
|
|
6215
|
+
corecomponents_v12.InputDatePickerModule,
|
|
6216
|
+
corecomponents_v12.IconModule,
|
|
6217
|
+
corecomponents_v12.ButtonModule,
|
|
6218
|
+
],
|
|
6219
|
+
declarations: [
|
|
6220
|
+
DatePlanningComponent,
|
|
6221
|
+
CalendarAllYearsComponent,
|
|
6222
|
+
CalendarAllMonthsComponent,
|
|
6223
|
+
CalendarHeaderComponent,
|
|
6224
|
+
CalendarComponent,
|
|
6225
|
+
CalendarViewComponent,
|
|
6226
|
+
AgendaHeaderComponent,
|
|
6227
|
+
AgendaViewComponent,
|
|
6228
|
+
AgendaMonthViewComponent,
|
|
6229
|
+
AgendaDayViewComponent,
|
|
6230
|
+
AgendaWeekViewComponent,
|
|
6231
|
+
AgendaWeekSelectViewComponent,
|
|
6232
|
+
AgendaHourViewComponent,
|
|
6233
|
+
AgendaHourCellComponent,
|
|
6234
|
+
AgendaHourViewLabelsComponent,
|
|
6235
|
+
AgendaHalfHourCellComponent,
|
|
6236
|
+
AgendaEventsComponent,
|
|
6237
|
+
AgendaEventComponent,
|
|
6238
|
+
ViewSelectComponent,
|
|
6239
|
+
AgendaSelectEventComponent,
|
|
6240
|
+
MASTER_PIPES
|
|
6241
|
+
],
|
|
6242
|
+
exports: [
|
|
6243
|
+
DatePlanningComponent
|
|
6244
|
+
]
|
|
6245
|
+
},] }
|
|
6246
|
+
];
|
|
6247
|
+
|
|
3632
6248
|
var SharedService = /** @class */ (function () {
|
|
3633
6249
|
function SharedService(options, connector) {
|
|
3634
6250
|
this.options = options;
|
|
@@ -3672,6 +6288,8 @@
|
|
|
3672
6288
|
exports.CoCircularGaugeModule = CoCircularGaugeModule;
|
|
3673
6289
|
exports.CoLinearGaugeComponent = CoLinearGaugeComponent;
|
|
3674
6290
|
exports.CoLinearGaugeModule = CoLinearGaugeModule;
|
|
6291
|
+
exports.DatePlanningComponent = DatePlanningComponent;
|
|
6292
|
+
exports.DatePlanningModule = DatePlanningModule;
|
|
3675
6293
|
exports.DocsignComponent = DocsignComponent;
|
|
3676
6294
|
exports.DocsignModule = DocsignModule;
|
|
3677
6295
|
exports.KeyPadComponent = KeyPadComponent;
|
|
@@ -3687,6 +6305,16 @@
|
|
|
3687
6305
|
exports.StockModule = StockModule;
|
|
3688
6306
|
exports["ɵa"] = SignatureComponent;
|
|
3689
6307
|
exports["ɵb"] = SignaturesComponent;
|
|
6308
|
+
exports["ɵba"] = AgendaHourCellComponent;
|
|
6309
|
+
exports["ɵbb"] = AgendaHourViewLabelsComponent;
|
|
6310
|
+
exports["ɵbc"] = AgendaHalfHourCellComponent;
|
|
6311
|
+
exports["ɵbd"] = AgendaEventsComponent;
|
|
6312
|
+
exports["ɵbe"] = AgendaEventComponent;
|
|
6313
|
+
exports["ɵbf"] = ViewSelectComponent;
|
|
6314
|
+
exports["ɵbg"] = AgendaSelectEventComponent;
|
|
6315
|
+
exports["ɵbh"] = MASTER_PIPES;
|
|
6316
|
+
exports["ɵbi"] = ArrayNumberPipe;
|
|
6317
|
+
exports["ɵbj"] = UCfirstPipe;
|
|
3690
6318
|
exports["ɵc"] = StockService;
|
|
3691
6319
|
exports["ɵd"] = SharedConnectorService;
|
|
3692
6320
|
exports["ɵe"] = OptionsService;
|
|
@@ -3697,6 +6325,19 @@
|
|
|
3697
6325
|
exports["ɵj"] = StockLocationComponent;
|
|
3698
6326
|
exports["ɵk"] = StockTransferComponent;
|
|
3699
6327
|
exports["ɵl"] = StockChangeAmountComponent;
|
|
6328
|
+
exports["ɵm"] = CalendarAllYearsComponent;
|
|
6329
|
+
exports["ɵn"] = CalendarAllMonthsComponent;
|
|
6330
|
+
exports["ɵo"] = CalendarHeaderComponent;
|
|
6331
|
+
exports["ɵp"] = CalendarComponent;
|
|
6332
|
+
exports["ɵq"] = CalendarViewComponent;
|
|
6333
|
+
exports["ɵs"] = AgendaHeaderComponent;
|
|
6334
|
+
exports["ɵt"] = AgendaViewComponent;
|
|
6335
|
+
exports["ɵu"] = AgendaMonthViewComponent;
|
|
6336
|
+
exports["ɵv"] = AgendaBaseViewComponent;
|
|
6337
|
+
exports["ɵw"] = AgendaDayViewComponent;
|
|
6338
|
+
exports["ɵx"] = AgendaWeekViewComponent;
|
|
6339
|
+
exports["ɵy"] = AgendaWeekSelectViewComponent;
|
|
6340
|
+
exports["ɵz"] = AgendaHourViewComponent;
|
|
3700
6341
|
|
|
3701
6342
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3702
6343
|
|