@colijnit/transaction 12.1.59 → 12.1.61
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-transaction.umd.js +1390 -1875
- package/bundles/colijnit-transaction.umd.js.map +1 -1
- package/colijnit-transaction.d.ts +282 -278
- package/colijnit-transaction.metadata.json +1 -1
- package/esm2015/colijnit-transaction.js +283 -279
- package/esm2015/lib/cache/parameter-cache-field.js +2 -2
- package/esm2015/lib/cache/service/business-object-cache-manager.service.js +2 -2
- package/esm2015/lib/cache/service/select-multiple-cache.service.js +1 -1
- package/esm2015/lib/cache/service/select-multiple-parameterized-cache.service.js +1 -1
- package/esm2015/lib/cache/service/select-single-cache.service.js +1 -1
- package/esm2015/lib/component/avatar/avatar.component.js +8 -5
- package/esm2015/lib/component/checkout/checkout-overview-delivery-address/checkout-overview-delivery-address.component.js +1 -1
- package/esm2015/lib/component/checkout/checkout-overview-delivery-edit/checkout-overview-delivery-edit.component.js +2 -5
- package/esm2015/lib/component/checkout/checkout-overview-payment/checkout-overview-payment.component.js +2 -2
- package/esm2015/lib/component/checkout/checkout-overview-relation-edit/checkout-overview-relation-edit.component.js +19 -133
- package/esm2015/lib/component/checkout/checkout.component.js +8 -3
- package/esm2015/lib/component/core/base/transaction-filter-popup-base.component.js +1 -1
- package/esm2015/lib/component/core/base/transaction-header-base.component.js +1 -1
- package/esm2015/lib/component/core/base/transaction-header-filter-popup-base.component.js +1 -1
- package/esm2015/lib/component/core/base/transaction-line-base.component.js +1 -1
- package/esm2015/lib/component/core/relation/customer-groups.component.js +1 -1
- package/esm2015/lib/component/dialog/dialog-header-search/dialog-header-search.component.js +2 -2
- package/esm2015/lib/component/editable-label/editable-label.component.js +4 -1
- package/esm2015/lib/component/quick-send-button/quick-send-button.component.js +116 -0
- package/esm2015/lib/component/quick-send-button/quick-send-button.module.js +27 -0
- package/esm2015/lib/component/relation/relation-address/relation-address.component.js +4 -4
- package/esm2015/lib/component/relation/relation-address-select/relation-address-select.component.js +7 -8
- package/esm2015/lib/component/relation/relation-address-tile/relation-address-tile.component.js +1 -1
- package/esm2015/lib/component/relation/relation-addresses/relation-addresses.component.js +9 -17
- package/esm2015/lib/component/relation/relation-base.component.js +2 -2
- package/esm2015/lib/component/relation/relation-contact-details/relation-contact-details.component.js +4 -4
- package/esm2015/lib/component/relation/relation-general/relation-general.component.js +13 -10
- package/esm2015/lib/component/relation/relation-preferences/relation-preferences.component.js +2 -2
- package/esm2015/lib/component/relation/relation-suggestions-list/relation-suggestions-list.component.js +1 -1
- package/esm2015/lib/component/relation/relation-suggestions-list-item/relation-suggestions-list-item.component.js +1 -1
- package/esm2015/lib/component/relation/relation-type/relation-type.component.js +3 -3
- package/esm2015/lib/component/shared/transaction-article-text-overview/transaction-article-text-overview.component.js +5 -6
- package/esm2015/lib/component/shared/transaction-article-text-overview/transaction-article-text-overview.module.js +1 -5
- package/esm2015/lib/component/shopping-cart/shopping-cart.component.js +2 -2
- package/esm2015/lib/component/transaction/transaction.component.js +6 -2
- package/esm2015/lib/component/transaction/transaction.module.js +4 -2
- package/esm2015/lib/component/transaction-header/transaction-header/transaction-header.component.js +2 -2
- package/esm2015/lib/component/transaction-header/transaction-header-payment/transaction-header-payment.component.js +2 -2
- package/esm2015/lib/component/transaction-header/transaction-header-relation/transaction-header-relation.component.js +103 -59
- package/esm2015/lib/component/transaction-header/transaction-header-relation/transaction-header-relation.module.js +5 -3
- package/esm2015/lib/component/transaction-header-fields/transaction-header-administrative-relation.component.js +9 -6
- package/esm2015/lib/component/transaction-header-fields/transaction-header-branch.component.js +8 -5
- package/esm2015/lib/component/transaction-header-fields/transaction-header-partial-delivery.component.js +9 -3
- package/esm2015/lib/component/transaction-line/transaction-base-line/transaction-base-line.component.js +6 -4
- package/esm2015/lib/component/transaction-line/transaction-order-delivery-line/service/transaction-order-delivery.service.js +15 -0
- package/esm2015/lib/component/transaction-line/transaction-order-delivery-line/transaction-order-delivery-line.component.js +56 -30
- package/esm2015/lib/component/transaction-line/transaction-order-delivery-line/transaction-order-delivery-line.module.js +4 -3
- package/esm2015/lib/component/transaction-line-fields/transaction-line-commission-button.component.js +1 -1
- package/esm2015/lib/component/transaction-line-fields/transaction-line-commission-code.component.js +1 -1
- package/esm2015/lib/component/transaction-line-fields/transaction-line-delivery-date-button.component.js +2 -2
- package/esm2015/lib/component/transaction-line-fields/transaction-line-supplier-button.component.js +7 -4
- package/esm2015/lib/component/transaction-line-fields/transaction-line-supplier.component.js +9 -6
- package/esm2015/lib/component/transaction-line-side-panel-purchase/transaction-line-side-panel-purchase.component.js +1 -2
- package/esm2015/lib/component/transaction-quick-access/transaction-quick-access-order-delivery/transaction-quick-access-order-delivery.component.js +21 -5
- package/esm2015/lib/component/transaction-quick-access/transaction-quick-access-overview/transaction-quick-access-overview.component.js +2 -2
- package/esm2015/lib/component/transaction-search/service/transaction-search.service.js +2 -2
- package/esm2015/lib/component/transaction-search/transaction-filter-content/purchase-order-filter-content/transaction-purchase-order-filter-content-article/transaction-purchase-order-filter-content-article.component.js +9 -6
- package/esm2015/lib/component/transaction-search/transaction-filter-content/purchase-order-filter-content/transaction-purchase-order-filter-content-order/transaction-purchase-order-filter-content-order.component.js +7 -4
- package/esm2015/lib/component/transaction-search/transaction-filter-content/sales-order-filter-content/transaction-sales-order-filter-content-article/transaction-sales-order-filter-content-article.component.js +9 -6
- package/esm2015/lib/component/transaction-search/transaction-filter-content/sales-order-filter-content/transaction-sales-order-filter-content-order/transaction-sales-order-filter-content-order.component.js +9 -6
- package/esm2015/lib/component/transaction-search/transaction-search-header/transaction-search-header.component.js +2 -6
- package/esm2015/lib/component/transaction-search/transaction-search.component.js +2 -2
- package/esm2015/lib/model/relation-any-type.js +1 -1
- package/esm2015/lib/pipe/co-currency.pipe.js +2 -2
- package/esm2015/lib/pipe/date-duration.pipe.js +2 -2
- package/esm2015/lib/pipe/delivery-time.pipe.js +2 -2
- package/esm2015/lib/service/article-connector.service.js +10 -6
- package/esm2015/lib/service/dictionary.service.js +2 -2
- package/esm2015/lib/service/error.service.js +1 -1
- package/esm2015/lib/service/payment.service.js +1 -1
- package/esm2015/lib/service/pending-reason.service.js +25 -33
- package/esm2015/lib/service/relation-connector.service.js +192 -0
- package/esm2015/lib/service/relation.service.js +120 -0
- package/esm2015/lib/service/shared-connector.service.js +2 -2
- package/esm2015/lib/service/shared.service.js +10 -6
- package/esm2015/lib/service/transaction-connector-adapter.service.js +69 -140
- package/esm2015/lib/service/transaction-connector.service.js +21 -59
- package/esm2015/lib/service/transaction-event.service.js +4 -2
- package/esm2015/lib/service/transaction-mapping.service.js +2 -1
- package/esm2015/lib/service/transaction.service.js +29 -83
- package/fesm2015/colijnit-transaction.js +1057 -1528
- package/fesm2015/colijnit-transaction.js.map +1 -1
- package/lib/cache/service/business-object-cache-manager.service.d.ts +2 -1
- package/lib/cache/service/select-multiple-cache.service.d.ts +1 -1
- package/lib/cache/service/select-multiple-parameterized-cache.service.d.ts +1 -1
- package/lib/cache/service/select-single-cache.service.d.ts +2 -1
- package/lib/component/avatar/avatar.component.d.ts +5 -3
- package/lib/component/checkout/checkout-overview-delivery-address/checkout-overview-delivery-address.component.d.ts +1 -1
- package/lib/component/checkout/checkout-overview-delivery-edit/checkout-overview-delivery-edit.component.d.ts +3 -5
- package/lib/component/checkout/checkout-overview-payment/checkout-overview-payment.component.d.ts +2 -2
- package/lib/component/checkout/checkout-overview-relation-edit/checkout-overview-relation-edit.component.d.ts +9 -14
- package/lib/component/core/base/transaction-filter-popup-base.component.d.ts +1 -1
- package/lib/component/core/base/transaction-header-base.component.d.ts +1 -1
- package/lib/component/core/base/transaction-header-filter-popup-base.component.d.ts +1 -1
- package/lib/component/core/base/transaction-line-base.component.d.ts +1 -1
- package/lib/component/core/relation/customer-groups.component.d.ts +1 -1
- package/lib/component/editable-label/editable-label.component.d.ts +1 -0
- package/lib/component/editable-label/style/_layout.scss +9 -0
- package/lib/component/editable-label/style/_material-definition.scss +1 -0
- package/lib/component/editable-label/style/material.scss +1 -1
- package/lib/component/payment/style/_layout.scss +3 -0
- package/lib/component/payment/style/_material-definition.scss +1 -0
- package/lib/component/quick-send-button/quick-send-button.component.d.ts +31 -0
- package/lib/component/quick-send-button/quick-send-button.module.d.ts +2 -0
- package/lib/component/quick-send-button/style/_layout.scss +52 -1
- package/lib/component/quick-send-button/style/_material-definition.scss +4 -0
- package/lib/component/relation/relation-address/relation-address.component.d.ts +2 -2
- package/lib/component/relation/relation-address-select/relation-address-select.component.d.ts +3 -4
- package/lib/component/relation/relation-address-tile/relation-address-tile.component.d.ts +1 -1
- package/lib/component/relation/relation-addresses/relation-addresses.component.d.ts +5 -5
- package/lib/component/relation/relation-base.component.d.ts +2 -2
- package/lib/component/relation/relation-contact-details/relation-contact-details.component.d.ts +1 -1
- package/lib/component/relation/relation-general/relation-general.component.d.ts +6 -4
- package/lib/component/relation/relation-preferences/relation-preferences.component.d.ts +1 -1
- package/lib/component/relation/relation-suggestions-list/relation-suggestions-list.component.d.ts +1 -1
- package/lib/component/relation/relation-suggestions-list-item/relation-suggestions-list-item.component.d.ts +1 -1
- package/lib/component/relation/relation-type/relation-type.component.d.ts +2 -2
- package/lib/component/shared/transaction-article-text-overview/transaction-article-text-overview.component.d.ts +2 -3
- package/lib/component/transaction/style/_layout.scss +4 -21
- package/lib/component/transaction/style/_material-definition.scss +1 -4
- package/lib/component/transaction-header/transaction-header/transaction-header.component.d.ts +1 -1
- package/lib/component/transaction-header/transaction-header-relation/transaction-header-relation.component.d.ts +17 -12
- package/lib/component/transaction-header-fields/transaction-header-administrative-relation.component.d.ts +4 -2
- package/lib/component/transaction-header-fields/transaction-header-branch.component.d.ts +5 -3
- package/lib/component/transaction-header-fields/transaction-header-partial-delivery.component.d.ts +3 -1
- package/lib/component/transaction-line/transaction-base-line/style/_layout.scss +3 -0
- package/lib/component/transaction-line/transaction-base-line/style/_material-definition.scss +6 -0
- package/lib/component/transaction-line/transaction-base-line/transaction-base-line.component.d.ts +2 -1
- package/lib/component/transaction-line/transaction-line/style/_layout.scss +14 -8
- package/lib/component/transaction-line/transaction-order-delivery-line/service/transaction-order-delivery.service.d.ts +4 -0
- package/lib/component/transaction-line/transaction-order-delivery-line/style/_layout.scss +4 -4
- package/lib/component/transaction-line/transaction-order-delivery-line/transaction-order-delivery-line.component.d.ts +9 -4
- package/lib/component/transaction-line-fields/transaction-line-commission-code.component.d.ts +1 -1
- package/lib/component/transaction-line-fields/transaction-line-supplier-button.component.d.ts +3 -1
- package/lib/component/transaction-line-fields/transaction-line-supplier.component.d.ts +4 -2
- package/lib/component/transaction-lines/style/material.scss +1 -0
- package/lib/component/transaction-quick-access/transaction-quick-access-order-delivery/style/_layout.scss +4 -0
- package/lib/component/transaction-quick-access/transaction-quick-access-order-delivery/transaction-quick-access-order-delivery.component.d.ts +10 -3
- package/lib/component/transaction-search/style/_layout.scss +1 -1
- package/lib/component/transaction-search/style/_material-definition.scss +0 -2
- package/lib/component/transaction-search/transaction-filter-content/purchase-order-filter-content/transaction-purchase-order-filter-content-article/transaction-purchase-order-filter-content-article.component.d.ts +3 -1
- package/lib/component/transaction-search/transaction-filter-content/purchase-order-filter-content/transaction-purchase-order-filter-content-order/transaction-purchase-order-filter-content-order.component.d.ts +3 -1
- package/lib/component/transaction-search/transaction-filter-content/sales-order-filter-content/transaction-sales-order-filter-content-article/transaction-sales-order-filter-content-article.component.d.ts +3 -1
- package/lib/component/transaction-search/transaction-filter-content/sales-order-filter-content/transaction-sales-order-filter-content-order/transaction-sales-order-filter-content-order.component.d.ts +3 -1
- package/lib/component/transaction-search/transaction-search-header/style/_layout.scss +0 -10
- package/lib/model/relation-any-type.d.ts +2 -2
- package/lib/service/article-connector.service.d.ts +3 -1
- package/lib/service/error.service.d.ts +1 -1
- package/lib/service/pending-reason.service.d.ts +5 -5
- package/lib/service/relation-connector.service.d.ts +34 -0
- package/lib/service/relation.service.d.ts +37 -0
- package/lib/service/shared.service.d.ts +3 -1
- package/lib/service/transaction-connector-adapter.service.d.ts +16 -25
- package/lib/service/transaction-connector.service.d.ts +14 -25
- package/lib/service/transaction-event.service.d.ts +4 -2
- package/lib/service/transaction.service.d.ts +9 -25
- package/lib/style/_variables.scss +23 -23
- package/package.json +9 -3
- package/esm2015/lib/factory/business-object-factory.js +0 -120
- package/esm2015/lib/factory/decorators/boolean.decorator.js +0 -102
- package/esm2015/lib/factory/decorators/complex-array.decorator.js +0 -55
- package/esm2015/lib/factory/decorators/complex-field.decorator.js +0 -57
- package/esm2015/lib/factory/decorators/date-field.decorator.js +0 -36
- package/esm2015/lib/factory/decorators/string-number.decorator.js +0 -43
- package/esm2015/lib/model/business-object.js +0 -81
- package/esm2015/lib/utils/array-utils.js +0 -183
- package/esm2015/lib/utils/is-nill.function.js +0 -5
- package/esm2015/lib/utils/string-utils.js +0 -64
- package/lib/factory/business-object-factory.d.ts +0 -23
- package/lib/factory/decorators/boolean.decorator.d.ts +0 -43
- package/lib/factory/decorators/complex-array.decorator.d.ts +0 -25
- package/lib/factory/decorators/complex-field.decorator.d.ts +0 -25
- package/lib/factory/decorators/date-field.decorator.d.ts +0 -17
- package/lib/factory/decorators/string-number.decorator.d.ts +0 -22
- package/lib/model/business-object.d.ts +0 -7
- package/lib/utils/array-utils.d.ts +0 -57
- package/lib/utils/is-nill.function.d.ts +0 -1
- package/lib/utils/string-utils.d.ts +0 -22
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { ObjectUtils } from "@colijnit/transactionapi/build/utils/object-utils";
|
|
2
|
-
import { NumberUtils } from "@colijnit/transactionapi/build/utils/number-utils";
|
|
3
|
-
import { isNill } from "@colijnit/transactionapi/build/utils/function/is-nill.function";
|
|
4
|
-
import { notNill } from "@colijnit/transactionapi/build/utils/function/not-nill.function";
|
|
5
|
-
export class ArrayUtils {
|
|
6
|
-
/**
|
|
7
|
-
* Returns whether at least one element in given array could be found by given finder function.
|
|
8
|
-
*
|
|
9
|
-
* @param {T[]} array
|
|
10
|
-
* @param {(element: T) => boolean} finder A finder function that takes an element of the array and returns a boolean that represents
|
|
11
|
-
* the 'found status' for that element; whether it should have been found or not.
|
|
12
|
-
*/
|
|
13
|
-
static ContainsAnElementFoundBy(array, finder) {
|
|
14
|
-
if (!array || !finder) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return notNill(this.Find(array, finder));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Cross-browser Array.find() function. Returns the first item in given array for which the foundBy function returns true. Returns
|
|
21
|
-
* undefined when none was found.
|
|
22
|
-
*
|
|
23
|
-
* Example usage:
|
|
24
|
-
* const foundItem: BusinessObject = ArrayUtils.Find<BusinessObject>(modelArray, (modelItem: BusinessObject) => <br>
|
|
25
|
-
* (return modelItem.getId() === '1')
|
|
26
|
-
* * });
|
|
27
|
-
*
|
|
28
|
-
* @param array The array with items to search in.
|
|
29
|
-
* @param foundBy The finder function applied on each items of the array, when that returns true, the item is considered found.
|
|
30
|
-
*/
|
|
31
|
-
static Find(array, foundBy) {
|
|
32
|
-
if (!array || !foundBy) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
36
|
-
const itemCur = array[i];
|
|
37
|
-
if (foundBy(itemCur)) {
|
|
38
|
-
return itemCur;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
// @returns empty array when nothing found, otherwise array with found items
|
|
44
|
-
static FindAll(array, foundBy) {
|
|
45
|
-
const answer = [];
|
|
46
|
-
if (!array || !foundBy) {
|
|
47
|
-
return answer;
|
|
48
|
-
}
|
|
49
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
50
|
-
const itemCur = array[i];
|
|
51
|
-
if (foundBy(itemCur)) {
|
|
52
|
-
answer.push(itemCur);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return answer;
|
|
56
|
-
}
|
|
57
|
-
// returns a simple clone of given array, using array.slice(0)
|
|
58
|
-
static CloneArray(array) {
|
|
59
|
-
let answer = [];
|
|
60
|
-
if (array) {
|
|
61
|
-
answer = array.slice(0);
|
|
62
|
-
}
|
|
63
|
-
return answer;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Returns a 'semi deep clone' of given array. Its first-level members are object-shallow-cloned (optionally with a strongly typed constructor),
|
|
67
|
-
* or just as plain object (see param arrayItemsClass).
|
|
68
|
-
* @param array
|
|
69
|
-
* @param arrayItemsClass If provided, the cloned array's first-level items will be strongly typed to / constructed as this class. Otherwise
|
|
70
|
-
* it'll be a plain object.
|
|
71
|
-
* @param deepClone Set to true if array items contain FUNCTIONS that need to be cloned..
|
|
72
|
-
* @returns {Array} semi-deep clone of given array
|
|
73
|
-
*/
|
|
74
|
-
static CloneArrayAndItsItems(array, arrayItemsClass, deepClone = false) {
|
|
75
|
-
const cloneArray = [];
|
|
76
|
-
if (array) {
|
|
77
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
78
|
-
if (deepClone) {
|
|
79
|
-
cloneArray.push(ObjectUtils.GetDeepClone(array[i]));
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
cloneArray.push(ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
return cloneArray;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Removes element at given index from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really
|
|
93
|
-
* removes the element using splice().
|
|
94
|
-
*
|
|
95
|
-
* @param {number} index
|
|
96
|
-
* @param {any[]} array in-out
|
|
97
|
-
* @returns {boolean} True if and only if the element on given index is succesfully removed from given array.
|
|
98
|
-
*/
|
|
99
|
-
static RemoveElementAtIndex(index, array) {
|
|
100
|
-
if (NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
if (index in array) {
|
|
104
|
-
array.splice(index, 1);
|
|
105
|
-
return true;
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Removes given element from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really removes the
|
|
113
|
-
* element using splice(). Also works on associative arrays.
|
|
114
|
-
*
|
|
115
|
-
* @param {T} element The element to remove.
|
|
116
|
-
* @param {T[]} array The array to remove the element from.
|
|
117
|
-
* @returns {boolean} True iff given element was truly successfully removed from given array.
|
|
118
|
-
*/
|
|
119
|
-
static RemoveElement(element, array) {
|
|
120
|
-
if (!Array.isArray(array)) {
|
|
121
|
-
return false;
|
|
122
|
-
}
|
|
123
|
-
const index = array.indexOf(element);
|
|
124
|
-
return ArrayUtils.RemoveElementAtIndex(index, array);
|
|
125
|
-
}
|
|
126
|
-
// 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.
|
|
127
|
-
static IsArrayWithElements(arrayToCheck, classItemsMustBeInstanceOf) {
|
|
128
|
-
if (isNill(arrayToCheck)) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
|
|
132
|
-
if (classItemsMustBeInstanceOf) {
|
|
133
|
-
return arrayToCheck[0] instanceof classItemsMustBeInstanceOf;
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
return true;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
// Removes all elements from given array for which given filter function holds true. Returns true if at least one removed, else false.
|
|
144
|
-
static RemoveElementsByFilter(array, filterFunction) {
|
|
145
|
-
if (!ArrayUtils.IsArrayWithElements(array) || !filterFunction) {
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
let atLeastOneRemoved = false;
|
|
149
|
-
const len = array.length;
|
|
150
|
-
for (let i = len - 1; i >= 0; i--) {
|
|
151
|
-
const item = array[i];
|
|
152
|
-
if (filterFunction.call(this, item) === true) {
|
|
153
|
-
array.splice(i, 1);
|
|
154
|
-
atLeastOneRemoved = true;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return atLeastOneRemoved;
|
|
158
|
-
}
|
|
159
|
-
static MoveElement(element, toIndex, array) {
|
|
160
|
-
if (!Array.isArray(array) || isNill(toIndex)) {
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
const fromIndex = array.indexOf(element);
|
|
164
|
-
const toIndexCorrected = NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
|
|
165
|
-
if (fromIndex === -1 || array[toIndexCorrected] === element) {
|
|
166
|
-
// element did not exist in given array, or already existed on given toIndex
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
array.splice(toIndexCorrected, 0, array.splice(fromIndex, 1)[0]);
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
// PRE: elements exists in given array. POST: given elementToPlace has a lower index than given afterThisElement. Array is in-out manipulated.
|
|
173
|
-
static PlaceElementAfterOther(array, elementToPlace, afterThisElement) {
|
|
174
|
-
if (array) {
|
|
175
|
-
const afterThisElIdx = array.indexOf(afterThisElement);
|
|
176
|
-
const elToPlaceIdx = array.indexOf(elementToPlace);
|
|
177
|
-
if (afterThisElIdx >= elToPlaceIdx) {
|
|
178
|
-
ArrayUtils.MoveElement(elementToPlace, afterThisElIdx + 1, array);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJyYXktdXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90cmFuc2FjdGlvbi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BmYWxzZSk6IFRbXSB7XHJcbiAgICAgICAgY29uc3QgY2xvbmVBcnJheTogVFtdID0gW107XHJcblxyXG4gICAgICAgIGlmIChhcnJheSkge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpOiBudW1iZXIgPSAwLCBsZW46IG51bWJlciA9IGFycmF5Lmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoZGVlcENsb25lKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY2xvbmVBcnJheS5wdXNoKE9iamVjdFV0aWxzLkdldERlZXBDbG9uZShhcnJheVtpXSkpO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBjbG9uZUFycmF5LnB1c2goT2JqZWN0VXRpbHMuR2V0U2hhbGxvd0Nsb25lKGFycmF5W2ldLCBhcnJheUl0ZW1zQ2xhc3MpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIHJldHVybiBbXTtcclxuICAgICAgICB9XHJcblxyXG4gICAgICAgIHJldHVybiBjbG9uZUFycmF5O1xyXG4gICAgfVxyXG5cclxuICAgIC8qKlxyXG4gICAgICogUmVtb3ZlcyBlbGVtZW50IGF0IGdpdmVuIGluZGV4IGZyb20gZ2l2ZW4gYXJyYXkuIERvZXNuJ3QganVzdCBzZXQgaXQgdG8gbnVsbCBsaWtlIEphdmFTY3JpcHRzIHN0YW5kYXJkICdkZWxldGUnIGRvZXMsIGJ1dCByZWFsbHlcclxuICAgICAqIHJlbW92ZXMgdGhlIGVsZW1lbnQgdXNpbmcgc3BsaWNlKCkuXHJcbiAgICAgKlxyXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IGluZGV4XHJcbiAgICAgKiBAcGFyYW0ge2FueVtdfSBhcnJheSBpbi1vdXRcclxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBUcnVl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ICAgICBhcnJheS5zcGxpY2UodG9JbmRleENvcnJlY3RlZCwgMCwgYXJyYXkuc3BsaWNlKGZyb21JbmRleCwgMSlbMF0pO1xyXG4gICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfVxyXG5cclxuICAgIC8vIFBSRTogZWxlbWVudHMgZXhpc3RzIGluIGdpdmVuIGFycmF5LiBQT1NUOiBnaXZlbiBlbGVtZW50VG9QbGFjZSBoYXMgYSBsb3dlciBpbmRleCB0aGFuIGdpdmVuIGFmdGVyVGhpc0VsZW1lbnQuIEFycmF5IGlzIGluLW91dCBtYW5pcHVsYXRlZC5cclxuICAgIHB1YmxpYyBzdGF0aWMgUGxhY2VFbGVtZW50QWZ0ZXJPdGhlcihhcnJheTogYW55W10sIGVsZW1lbnRUb1BsYWNlOiBhbnksIGFmdGVyVGhpc0VsZW1lbnQ6IGFueSk6IHZvaWQge1xyXG4gICAgICAgIGlmIChhcnJheSkge1xyXG4gICAgICAgICAgICBjb25zdCBhZnRlclRoaXNFbElkeDogbnVtYmVyID0gYXJyYXkuaW5kZXhPZihhZnRlclRoaXNFbGVtZW50KTtcclxuICAgICAgICAgICAgY29uc3QgZWxUb1BsYWNlSWR4OiBudW1iZXIgPSBhcnJheS5pbmRleE9mKGVsZW1lbnRUb1BsYWNlKTtcclxuICAgICAgICAgICAgaWYgKGFmdGVyVGhpc0VsSWR4ID49IGVsVG9QbGFjZUlkeCkge1xyXG4gICAgICAgICAgICAgICAgQXJyYXlVdGlscy5Nb3ZlRWxlbWVudChlbGVtZW50VG9QbGFjZSwgYWZ0ZXJUaGlzRWxJZHggKyAxLCBhcnJheSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuIl19
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
// @returns true iff given value equals null or equals undefined
|
|
2
|
-
export function isNill(value) {
|
|
3
|
-
return value === null || value === undefined;
|
|
4
|
-
}
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXMtbmlsbC5mdW5jdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3RyYW5zYWN0aW9uL3NyYy9saWIvdXRpbHMvaXMtbmlsbC5mdW5jdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnRUFBZ0U7QUFDaEUsTUFBTSxVQUFVLE1BQU0sQ0FBQyxLQUFVO0lBQzdCLE9BQU8sS0FBSyxLQUFLLElBQUksSUFBSSxLQUFLLEtBQUssU0FBUyxDQUFDO0FBQ2pELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBAcmV0dXJucyB0cnVlIGlmZiBnaXZlbiB2YWx1ZSBlcXVhbHMgbnVsbCBvciBlcXVhbHMgdW5kZWZpbmVkXHJcbmV4cG9ydCBmdW5jdGlvbiBpc05pbGwodmFsdWU6IGFueSk6IGJvb2xlYW4ge1xyXG4gICAgcmV0dXJuIHZhbHVlID09PSBudWxsIHx8IHZhbHVlID09PSB1bmRlZmluZWQ7XHJcbn0iXX0=
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// Static utility functions holder related to strings.
|
|
2
|
-
export class StringUtils {
|
|
3
|
-
/**
|
|
4
|
-
* Returns a new string where given placeholder in given source string are replaced by given replacement texts.
|
|
5
|
-
*
|
|
6
|
-
* Example usage:
|
|
7
|
-
*
|
|
8
|
-
* source = "ABCDABCD"
|
|
9
|
-
* placeholder = "BC"
|
|
10
|
-
* replacementTexts = "Z", "Z" (REST arguments)
|
|
11
|
-
* OUTPUT = "AZDAZD"
|
|
12
|
-
*
|
|
13
|
-
* @param {string} source
|
|
14
|
-
* @param {string} placeholder
|
|
15
|
-
* @param {string} replacementTexts If only one is given, this function replaces all placeholders with that single replacementText.
|
|
16
|
-
* If more are given, placeholders without a corresponding replacementText will remain their original placeholder characters.
|
|
17
|
-
*/
|
|
18
|
-
static ReplaceOccurrencesIn(source, placeholder, ...replacementTexts) {
|
|
19
|
-
// parameter guards
|
|
20
|
-
if (!(source)) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
if (!placeholder || replacementTexts.length === 0) {
|
|
24
|
-
return source;
|
|
25
|
-
}
|
|
26
|
-
let outString = source;
|
|
27
|
-
// one replacementText means replace for all
|
|
28
|
-
if (replacementTexts.length === 1) {
|
|
29
|
-
// "g" is the g flag to replace globally
|
|
30
|
-
outString = outString.replace(placeholder, replacementTexts[0]);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
// replace occurence i by replacementTexts[i], one at a time in loop (there might be a faster way..)
|
|
34
|
-
for (let i = 0, len = replacementTexts.length; i < len; i++) {
|
|
35
|
-
outString = outString.replace(placeholder, replacementTexts[i]);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return outString;
|
|
39
|
-
}
|
|
40
|
-
// Returns the given argument as a string. Returns given defaultValue if conversion of argument to string was impossible.
|
|
41
|
-
static ParseString(arg, defaultValue = "") {
|
|
42
|
-
if (!StringUtils.IsString(arg)) {
|
|
43
|
-
if (arg && typeof arg.toString === "function") {
|
|
44
|
-
arg = arg.toString();
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
arg = defaultValue;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return arg;
|
|
51
|
-
}
|
|
52
|
-
static IsString(str) {
|
|
53
|
-
return typeof str === 'string';
|
|
54
|
-
}
|
|
55
|
-
// Returns whether given str is a string and has a length > 0.
|
|
56
|
-
static IsStringWithLength(str) {
|
|
57
|
-
return str && StringUtils.IsString(str) && str.length > 0;
|
|
58
|
-
}
|
|
59
|
-
// Returns given string, escaped for use as string literal in regular expressions.
|
|
60
|
-
static _escapeRegExp(str) {
|
|
61
|
-
return str; // .replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^$\|]/g, "\\$&");
|
|
62
|
-
}
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yBfZXNjYXBlUmVnRXhwKHN0cjogc3RyaW5nKTogc3RyaW5nIHtcclxuICAgIHJldHVybiBzdHI7Ly8gLnJlcGxhY2UoL1tcXC1cXFtcXF1cXC9cXHtcXH1cXChcXClcXCpcXCtcXD9cXC5cXFxcXFxeJFxcfF0vZywgXCJcXFxcJCZcIik7XHJcbiAgfVxyXG5cclxufVxyXG4iXX0=
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { BusinessObject } from "../model/business-object";
|
|
2
|
-
export declare class BusinessObjectFactory {
|
|
3
|
-
constructor();
|
|
4
|
-
/**
|
|
5
|
-
* Creates and returns a new business data object instance of given class, with all given data properties applied to it in a
|
|
6
|
-
* complex-aware style. That is, all properties on given class that are decorated with @ComplexField(..) or @ComplexArray(..) decorators
|
|
7
|
-
* become strongly typed business objects, with methods that are usable and such.
|
|
8
|
-
*
|
|
9
|
-
* @param modelClass
|
|
10
|
-
* @param {Object} rawData The object with all (possibly raw/flat/not alive) data to be applied to the created model object
|
|
11
|
-
*/
|
|
12
|
-
makeWithRawBackendData(modelClass: any, rawData: Object): BusinessObject;
|
|
13
|
-
makeBOArrayFromRawBackendDataArray(modelClass: any, arrayOfRawDatas: Object[]): BusinessObject[];
|
|
14
|
-
instantiateNewBo(modelClass: any): BusinessObject;
|
|
15
|
-
/**
|
|
16
|
-
* Applies all properties of given 'source' object to the given 'destination' businessobject, if destination has that property.
|
|
17
|
-
* Works with the @ComplexField(), @ComplexArray, @BooleanText, @CoInject and @DateField annotations of given destination model.
|
|
18
|
-
*
|
|
19
|
-
* @param sourceData Raw data to copy to destination model
|
|
20
|
-
* @param {BusinessObject} destinationModel InOut: The annotated businessobject to apply source properties to
|
|
21
|
-
*/
|
|
22
|
-
private _copyAllPropertiesDecoratorProcessedFrom;
|
|
23
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { DbBooleanValueType } from "@colijnit/transactionapi/build/enum/db-boolean-value-type.enum";
|
|
2
|
-
/**
|
|
3
|
-
* There are 'J', 'T', 'N', 'F', 0 and 1 'boolean values' in the database. These should be translated to true and false boolean values in
|
|
4
|
-
* our client application.
|
|
5
|
-
*
|
|
6
|
-
* The values 'J' and 'N' seem to be most commonly used. This is the default setting when using this decorator.
|
|
7
|
-
* You can pass 'T' or 1 for the other variants as follows:
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
*
|
|
11
|
-
* @BooleanText() or @BooleanText("J") (the default, uses YesNoDbType char values)
|
|
12
|
-
* public foo: boolean // 'J' and 'N' become true and false after BusinessObjectFactoryService and -SerializerService processing
|
|
13
|
-
*
|
|
14
|
-
* @BooleanText('T') (uses TrueFalseDbType char values)
|
|
15
|
-
* public bar: boolean // 'T' and 'F' become true and false after BusinessObjectFactoryService and -SerializerService processing
|
|
16
|
-
*
|
|
17
|
-
* @BooleanText(1)
|
|
18
|
-
* public baz: boolean // 1 and 0 become true and false after BusinessObjectFactoryService and -SerializerService processing
|
|
19
|
-
*/
|
|
20
|
-
export declare function BooleanText(type?: "J" | "T" | 1): PropertyDecorator;
|
|
21
|
-
export declare class BooleanTextDecorator {
|
|
22
|
-
/**
|
|
23
|
-
* Returns whether given property (as a string) on given object is a boolean text field. That is, it's a field that is decorated
|
|
24
|
-
* with the @BooleanText decorator.
|
|
25
|
-
*/
|
|
26
|
-
static IsBooleanTextField(target: Object, propertyKey: string): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Returns the logical true or false value of given character ('J', 'N', 'T' or 'F') or number (0 or 1).
|
|
29
|
-
* Returns UNDEFINED if given boolChar was not recognised as a boolean text.
|
|
30
|
-
*/
|
|
31
|
-
static GetLogicalBooleanValue(dbBoolChar: DbBooleanValueType | string): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Returns the boolean character / number of given logical bool property on target object. Uses its @BooleanText() annotation to decide
|
|
34
|
-
* what character / number to return.
|
|
35
|
-
* Used in BusinessObjectSerializerServiceService to convert logical bools to their original boolean character.
|
|
36
|
-
* @returns {string|number} The original, reverse-engineered boolean character (or number) of given object property, or undefined.
|
|
37
|
-
*/
|
|
38
|
-
static GetDbBooleanValue(target: Object, propertyKey: string): DbBooleanValueType;
|
|
39
|
-
private static _IsJaNeeProp;
|
|
40
|
-
private static _IsTrueFalseProp;
|
|
41
|
-
private static _IsZeroOneProp;
|
|
42
|
-
private static _IsProp;
|
|
43
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Property decorator for properties of businessobject classes that are an array of other strongly typed businessobjects.
|
|
6
|
-
* Ensures that the BusinessObjectFactoryService makes properly typed objects from incoming raw persistence data. Otherwise we couldn't add methods
|
|
7
|
-
* to our own businessobjects and use them, since all fields would be flat data without methods after BusinessObjectFactoryService creation.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
*
|
|
11
|
-
* @ComplexArray(TransactionLine)
|
|
12
|
-
* public transactionLines: TransactionLine[]
|
|
13
|
-
*/
|
|
14
|
-
export declare function ComplexArray(type: any): PropertyDecorator;
|
|
15
|
-
export declare class ComplexArrayDecorator {
|
|
16
|
-
/**
|
|
17
|
-
* Returns whether given property (as a string) on given object is a complex array. A complex array is an array field that is decorated
|
|
18
|
-
* with the @ComplexArray decorator.
|
|
19
|
-
*/
|
|
20
|
-
static IsComplexArray(target: Object, propertyKey: string): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Returns the VALUE of the @ComplexArray(VALUE) property decorator on the given propertyKey on the given modelobject.
|
|
23
|
-
*/
|
|
24
|
-
static GetComplexArrayType(target: Object, propertyKey: string): any;
|
|
25
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Property decorator for properties of businessobject classes that are other strongly typed businessobjects.
|
|
6
|
-
* Ensures that the BusinessObjectFactoryService makes properly typed objects from incoming raw persistence data. Otherwise we couldn't add methods
|
|
7
|
-
* to our own businessobjects and use them, since all fields would be flat data without methods after BusinessObjectFactoryService creation.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
*
|
|
11
|
-
* @ComplexField(Transaction)
|
|
12
|
-
* public transaction: Transaction
|
|
13
|
-
*
|
|
14
|
-
* Also keeps track of a "complexFieldProps" metadata on the class-level, as a reflect-metadata workaround to be able to
|
|
15
|
-
* retrieve all properties that have the @ComplexField(..) decorator (impossible with current Reflect API).
|
|
16
|
-
*/
|
|
17
|
-
export declare function ComplexField(type: any): PropertyDecorator;
|
|
18
|
-
export declare class ComplexFieldDecorator {
|
|
19
|
-
/**
|
|
20
|
-
* Returns whether given property (as a string) on given object is a complex field. A complex field is a field that is decorated
|
|
21
|
-
* with the @ComplexField decorator.
|
|
22
|
-
*/
|
|
23
|
-
static IsComplexField(target: Object, propertyKey: string): boolean;
|
|
24
|
-
static GetComplexFieldType(target: Object, propertyKey: string): any;
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Property decorator for properties of businessobject classes that are of type Date, but are sent to us as strings.
|
|
6
|
-
* Ensures that the BusinessObjectFactory makes proper JavaScript Date objects from incoming strings for @DateField() decorated properties.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
*
|
|
10
|
-
* @DateField()
|
|
11
|
-
* public expectedDeliveryDate: Date
|
|
12
|
-
*/
|
|
13
|
-
export declare function DateField(): PropertyDecorator;
|
|
14
|
-
export declare class DateFieldFieldDecorator {
|
|
15
|
-
static IsDateField(target: Object, propertyKey: string): boolean;
|
|
16
|
-
static StringAsDate(str: string): Date;
|
|
17
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Decorator for properties of businessobjects that are sent to us as strings from the database, but which we want to use as a number in the client.
|
|
6
|
-
*
|
|
7
|
-
* Can be handy for incongruent backend api cases, where id data types are communicated wrongly via strings instead of numbers
|
|
8
|
-
* (e.g. on EmployeeFullObject.district, points to a District which has a number id, but in employee it's a string representation of that number...)
|
|
9
|
-
*
|
|
10
|
-
* Used by business object factory and -serializer.
|
|
11
|
-
*
|
|
12
|
-
* Usage:
|
|
13
|
-
*
|
|
14
|
-
* @StringNumber()
|
|
15
|
-
* public rights: UserRightType
|
|
16
|
-
*/
|
|
17
|
-
export declare function StringNumber(): PropertyDecorator;
|
|
18
|
-
export declare class StringNumberDecorator {
|
|
19
|
-
static IsStringNumber(target: Object, propertyKey: string): boolean;
|
|
20
|
-
static StringAsNumber(str: string): number;
|
|
21
|
-
static NumberAsString(nr: number): string;
|
|
22
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export declare class ArrayUtils {
|
|
2
|
-
/**
|
|
3
|
-
* Returns whether at least one element in given array could be found by given finder function.
|
|
4
|
-
*
|
|
5
|
-
* @param {T[]} array
|
|
6
|
-
* @param {(element: T) => boolean} finder A finder function that takes an element of the array and returns a boolean that represents
|
|
7
|
-
* the 'found status' for that element; whether it should have been found or not.
|
|
8
|
-
*/
|
|
9
|
-
static ContainsAnElementFoundBy<T>(array: T[], finder: (element: T) => boolean): boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Cross-browser Array.find() function. Returns the first item in given array for which the foundBy function returns true. Returns
|
|
12
|
-
* undefined when none was found.
|
|
13
|
-
*
|
|
14
|
-
* Example usage:
|
|
15
|
-
* const foundItem: BusinessObject = ArrayUtils.Find<BusinessObject>(modelArray, (modelItem: BusinessObject) => <br>
|
|
16
|
-
* (return modelItem.getId() === '1')
|
|
17
|
-
* * });
|
|
18
|
-
*
|
|
19
|
-
* @param array The array with items to search in.
|
|
20
|
-
* @param foundBy The finder function applied on each items of the array, when that returns true, the item is considered found.
|
|
21
|
-
*/
|
|
22
|
-
static Find<T>(array: T[], foundBy: (item: T) => boolean): T;
|
|
23
|
-
static FindAll<T>(array: T[], foundBy: (item: T) => boolean): T[];
|
|
24
|
-
static CloneArray<T>(array: T[]): T[];
|
|
25
|
-
/**
|
|
26
|
-
* Returns a 'semi deep clone' of given array. Its first-level members are object-shallow-cloned (optionally with a strongly typed constructor),
|
|
27
|
-
* or just as plain object (see param arrayItemsClass).
|
|
28
|
-
* @param array
|
|
29
|
-
* @param arrayItemsClass If provided, the cloned array's first-level items will be strongly typed to / constructed as this class. Otherwise
|
|
30
|
-
* it'll be a plain object.
|
|
31
|
-
* @param deepClone Set to true if array items contain FUNCTIONS that need to be cloned..
|
|
32
|
-
* @returns {Array} semi-deep clone of given array
|
|
33
|
-
*/
|
|
34
|
-
static CloneArrayAndItsItems<T>(array: T[], arrayItemsClass?: any, deepClone?: boolean): T[];
|
|
35
|
-
/**
|
|
36
|
-
* Removes element at given index from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really
|
|
37
|
-
* removes the element using splice().
|
|
38
|
-
*
|
|
39
|
-
* @param {number} index
|
|
40
|
-
* @param {any[]} array in-out
|
|
41
|
-
* @returns {boolean} True if and only if the element on given index is succesfully removed from given array.
|
|
42
|
-
*/
|
|
43
|
-
static RemoveElementAtIndex(index: number, array: any[]): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Removes given element from given array. Doesn't just set it to null like JavaScripts standard 'delete' does, but really removes the
|
|
46
|
-
* element using splice(). Also works on associative arrays.
|
|
47
|
-
*
|
|
48
|
-
* @param {T} element The element to remove.
|
|
49
|
-
* @param {T[]} array The array to remove the element from.
|
|
50
|
-
* @returns {boolean} True iff given element was truly successfully removed from given array.
|
|
51
|
-
*/
|
|
52
|
-
static RemoveElement<T>(element: T, array: T[]): boolean;
|
|
53
|
-
static IsArrayWithElements<T>(arrayToCheck: T[], classItemsMustBeInstanceOf?: any): boolean;
|
|
54
|
-
static RemoveElementsByFilter(array: any[], filterFunction: (item: any) => boolean): boolean;
|
|
55
|
-
static MoveElement<T>(element: T, toIndex: number, array: T[]): boolean;
|
|
56
|
-
static PlaceElementAfterOther(array: any[], elementToPlace: any, afterThisElement: any): void;
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isNill(value: any): boolean;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare class StringUtils {
|
|
2
|
-
/**
|
|
3
|
-
* Returns a new string where given placeholder in given source string are replaced by given replacement texts.
|
|
4
|
-
*
|
|
5
|
-
* Example usage:
|
|
6
|
-
*
|
|
7
|
-
* source = "ABCDABCD"
|
|
8
|
-
* placeholder = "BC"
|
|
9
|
-
* replacementTexts = "Z", "Z" (REST arguments)
|
|
10
|
-
* OUTPUT = "AZDAZD"
|
|
11
|
-
*
|
|
12
|
-
* @param {string} source
|
|
13
|
-
* @param {string} placeholder
|
|
14
|
-
* @param {string} replacementTexts If only one is given, this function replaces all placeholders with that single replacementText.
|
|
15
|
-
* If more are given, placeholders without a corresponding replacementText will remain their original placeholder characters.
|
|
16
|
-
*/
|
|
17
|
-
static ReplaceOccurrencesIn(source: string, placeholder: string, ...replacementTexts: string[]): string;
|
|
18
|
-
static ParseString(arg: any, defaultValue?: string): string;
|
|
19
|
-
static IsString(str: any): boolean;
|
|
20
|
-
static IsStringWithLength(str: string): boolean;
|
|
21
|
-
private static _escapeRegExp;
|
|
22
|
-
}
|