@colijnit/sharedcomponents 1.0.7 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/bundles/colijnit-sharedcomponents.umd.js +746 -0
  2. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -0
  3. package/colijnit-sharedcomponents.d.ts +6 -0
  4. package/colijnit-sharedcomponents.metadata.json +1 -0
  5. package/esm2015/colijnit-sharedcomponents.js +7 -0
  6. package/esm2015/lib/components/docsign/component/signature/signature.component.js +75 -0
  7. package/esm2015/lib/components/docsign/component/signatures/signatures.component.js +44 -0
  8. package/esm2015/lib/components/docsign/docsign.component.js +225 -0
  9. package/esm2015/lib/components/docsign/docsign.module.js +23 -0
  10. package/esm2015/public-api.js +6 -0
  11. package/fesm2015/colijnit-sharedcomponents.js +372 -0
  12. package/fesm2015/colijnit-sharedcomponents.js.map +1 -0
  13. package/lib/components/docsign/component/signature/signature.component.d.ts +16 -0
  14. package/{src/lib → lib}/components/docsign/component/signature/style/_layout.scss +0 -0
  15. package/{src/lib → lib}/components/docsign/component/signature/style/_material-definition.scss +0 -0
  16. package/{src/lib → lib}/components/docsign/component/signature/style/_theme.scss +0 -0
  17. package/{src/lib → lib}/components/docsign/component/signature/style/material.scss +0 -0
  18. package/lib/components/docsign/component/signatures/signatures.component.d.ts +12 -0
  19. package/{src/lib → lib}/components/docsign/component/signatures/style/_layout.scss +0 -0
  20. package/{src/lib → lib}/components/docsign/component/signatures/style/_material-definition.scss +0 -0
  21. package/{src/lib → lib}/components/docsign/component/signatures/style/_theme.scss +0 -0
  22. package/{src/lib → lib}/components/docsign/component/signatures/style/material.scss +0 -0
  23. package/lib/components/docsign/docsign.component.d.ts +92 -0
  24. package/lib/components/docsign/docsign.module.d.ts +2 -0
  25. package/{src/lib → lib}/components/docsign/style/_layout.scss +0 -0
  26. package/{src/lib → lib}/components/docsign/style/_material-definition.scss +0 -0
  27. package/{src/lib → lib}/components/docsign/style/_theme.scss +0 -0
  28. package/{src/lib → lib}/components/docsign/style/material.scss +0 -0
  29. package/{src/lib → lib}/style/_mixin.scss +0 -0
  30. package/{src/lib → lib}/style/_variables.scss +0 -0
  31. package/package.json +25 -15
  32. package/public-api.d.ts +2 -0
  33. package/.browserslistrc +0 -16
  34. package/colijnit-sharedcomponents-1.0.7.tgz +0 -0
  35. package/karma.conf.js +0 -44
  36. package/ng-package.json +0 -17
  37. package/src/lib/components/docsign/component/signature/signature.component.ts +0 -82
  38. package/src/lib/components/docsign/component/signatures/signatures.component.ts +0 -50
  39. package/src/lib/components/docsign/docsign.component.ts +0 -252
  40. package/src/lib/components/docsign/docsign.module.ts +0 -22
  41. package/src/lib/components/send-method-dialog/enums/send-option.ts +0 -6
  42. package/src/lib/components/send-method-dialog/send-method-dialog.component.ts +0 -215
  43. package/src/lib/components/send-method-dialog/send-method-dialog.module.ts +0 -27
  44. package/src/lib/components/send-method-dialog/style/_layout.scss +0 -186
  45. package/src/lib/components/send-method-dialog/style/_material-definition.scss +0 -1
  46. package/src/lib/components/send-method-dialog/style/_theme.scss +0 -7
  47. package/src/lib/components/send-method-dialog/style/material.scss +0 -4
  48. package/src/lib/components/stock/stock-information/stock-information.component.ts +0 -59
  49. package/src/lib/components/stock/stock-information-grid/stock-information-grid.component.ts +0 -278
  50. package/src/lib/components/stock/stock-location/stock-location.component.ts +0 -82
  51. package/src/lib/components/stock/stock-transfer/co-drop-down-list-fields.interface.ts +0 -4
  52. package/src/lib/components/stock/stock-transfer/stock-transfer.component.ts +0 -111
  53. package/src/lib/components/stock/stock.component.ts +0 -78
  54. package/src/lib/components/stock/stock.module.ts +0 -47
  55. package/src/lib/components/stock/style/_layout.scss +0 -206
  56. package/src/lib/components/stock/style/_material-definition.scss +0 -20
  57. package/src/lib/components/stock/style/_theme.scss +0 -8
  58. package/src/lib/components/stock/style/material.scss +0 -4
  59. package/src/lib/enum/icon.enum.ts +0 -22
  60. package/src/lib/factory/business-object-factory.ts +0 -120
  61. package/src/lib/factory/decorators/boolean.decorator.ts +0 -113
  62. package/src/lib/factory/decorators/complex-array.decorator.ts +0 -61
  63. package/src/lib/factory/decorators/complex-field.decorator.ts +0 -63
  64. package/src/lib/factory/decorators/date-field.decorator.ts +0 -41
  65. package/src/lib/factory/decorators/string-number.decorator.ts +0 -48
  66. package/src/lib/model/business-object.ts +0 -85
  67. package/src/lib/model/icon-svg.ts +0 -22
  68. package/src/lib/service/icon-cache.service.ts +0 -51
  69. package/src/lib/service/ione-connector-adapter.service.ts +0 -113
  70. package/src/lib/service/stock.service.ts +0 -35
  71. package/src/lib/utils/array-utils.ts +0 -202
  72. package/src/lib/utils/is-nill.function.ts +0 -4
  73. package/src/public-api.ts +0 -10
  74. package/src/test.ts +0 -27
  75. package/tsconfig.lib.json +0 -18
  76. package/tsconfig.lib.prod.json +0 -10
  77. package/tsconfig.spec.json +0 -17
@@ -1,206 +0,0 @@
1
- @import "../../../style/mixin";
2
-
3
- @include export-module('co-stock-layout') {
4
- .co-stock {
5
-
6
- .stock-info-container {
7
- max-width: $sc-stock-info-container-width;
8
- padding: $sc-stock-info-container-padding;
9
- }
10
-
11
- .stock-info {
12
- margin-top: $sc-stock-info-margin;
13
- padding: $sc-stock-info-padding;
14
- display: inline-flex;
15
- width: 90%;
16
- justify-content: space-between;
17
- }
18
-
19
- .stock-info-row {
20
- display: inline-flex;
21
- }
22
-
23
- .stock-info-row-image {
24
- display: inline-flex;
25
- gap: $sc-stock-gap;
26
- }
27
-
28
- .stock-image {
29
- height: $sc-stock-image-height;
30
- }
31
-
32
- .stock-good-info {
33
- display: block;
34
- }
35
-
36
- .stock-status {
37
- display: grid;
38
- gap: $sc-stock-gap;
39
- }
40
-
41
- .stock-info > div:not(:first-child) {
42
- padding: 0 10px;
43
- border-left: $sc-stock-border-left;
44
- }
45
-
46
- .stock-line {
47
- font-weight: $sc-stock-line-font-weight;
48
- margin: $sc-stock-line-margin;
49
- }
50
-
51
- .simple-grid-column-header-wrapper {
52
- font-size: $sc-stock-simple-grid-header-fontsize;
53
- display: flex;
54
- flex-direction: row;
55
- background-color: white;
56
- border-bottom: $sc-stock-simple-grid-column-header-wrapper-border-bottom;
57
- }
58
-
59
- .simple-grid-column-header {
60
- display: flex;
61
- flex-direction: row;
62
- padding-right: 5px;
63
- flex-basis: 100%;
64
- }
65
-
66
- .simple-grid-row {
67
- font-size: $sc-stock-simple-grid-row-fontsize;
68
- display: flex;
69
- flex-direction: row;
70
- border: $sc-stock-simple-grid-row-border;
71
- border-bottom: $sc-stock-simple-grid-row-border-bottom;
72
- }
73
-
74
- .simple-grid-column-cell {
75
- display: flex;
76
- padding: $sc-stock-simple-grid-column-cell-padding;
77
- flex-basis: 100%;
78
- }
79
-
80
- .stock-lines-button {
81
- margin-bottom: 5%;
82
- }
83
-
84
- .tab-link {
85
- gap: 30px;
86
- padding: 20px 20px;
87
- &.hide {
88
- display: none;
89
- }
90
-
91
- &.show {
92
- display: flex;
93
- }
94
- flex-direction: row;
95
- }
96
-
97
- .tab-link > div {
98
- margin: 25px 0;
99
- padding-right: 10px;
100
-
101
- &.inactive {
102
- font-weight: normal;
103
- }
104
- }
105
-
106
- .stock-grid {
107
- margin: $sc-stock-grid-margin;
108
- }
109
-
110
- .buttons-wrapper {
111
- display: flex;
112
- }
113
-
114
- .dropdown-wrapper {
115
- display: flex;
116
- float: right;
117
- max-width: 20%;
118
- }
119
-
120
- .stock-location-group {
121
- margin-bottom: 20px;
122
- display: flex;
123
- }
124
-
125
- .stock-location-left-group {
126
- float: left;
127
- display: flex;
128
- flex: 1;
129
- justify-content: flex-start;
130
- }
131
-
132
- .stock-location-right-group {
133
- float: right;
134
- display: flex;
135
- flex: 1;
136
- justify-content: flex-end;
137
- }
138
-
139
- .stock-button-toolbar {
140
- display: flex;
141
- justify-content: space-between;
142
- margin: 10px;
143
- }
144
-
145
- .stock-button-left-group {
146
- display: flex;
147
- flex: 1;
148
- justify-content: flex-start;
149
-
150
- .co-button {
151
- margin-right: 10px;
152
- width: 100px;
153
- }
154
- }
155
- .stock-button-middle-group {
156
- display: flex;
157
- flex: 1;
158
- margin-top: 10px;
159
- }
160
-
161
- .stock-transfer-right-column {
162
- display: flex;
163
- flex-direction: column;
164
- width: 25%;
165
- float: right;
166
- }
167
-
168
- .stock-transfer-left-column {
169
- display: flex;
170
- flex-direction: column;
171
- width: 25%;
172
- float: left;
173
- }
174
-
175
- .ok-cancel-buttons {
176
- display: flex;
177
- width: 100%;
178
- justify-content: center;
179
- padding: 25px;
180
- }
181
-
182
- .stock-transfer-columns {
183
- display: flex;
184
- width: 100%;
185
- justify-content: space-around;
186
- }
187
-
188
- .tab-link-buttons {
189
- cursor: $sc-stock-tab-link-buttons-pointer;
190
- }
191
-
192
- .active {
193
- color: $sc-color-action;
194
- }
195
-
196
- .stock-button-back {
197
- color: $sc-color-action;
198
- cursor: pointer;
199
- }
200
-
201
- .drop-list-group {
202
- height: $sc-stock-grid-height;
203
- overflow-y: $sc-stock-grid-overflow-y;
204
- }
205
- }
206
- }
@@ -1,20 +0,0 @@
1
- $sc-stock-info-margin: 10px !default;
2
- $sc-stock-info-padding: 0 10px !default;
3
- $sc-stock-gap: 10px !default;
4
- $sc-stock-border-left: solid 1px lightgray !default;
5
- $sc-stock-line-margin: 10px 0 20px 0 !default;
6
- $sc-stock-line-font-weight: bold !default;
7
- $sc-stock-simple-grid-header-fontsize: 14px !default;
8
- $sc-stock-simple-grid-row-fontsize: 12px !default;
9
- $sc-stock-simple-grid-row-border-bottom: 1px solid black !default;
10
- $sc-stock-simple-grid-row-border: none !default;
11
- $sc-stock-simple-grid-column-cell-padding: 10px 5px !default;
12
- $sc-stock-tab-link-buttons-active-color: $sc-color-action !default;
13
- $sc-stock-tab-link-buttons-pointer: pointer !default;
14
- $sc-stock-grid-margin: 50px 0 0 0 !default;
15
- $sc-stock-simple-grid-column-header-wrapper-border-bottom: 1px solid black !default;
16
- $sc-stock-info-container-width: 100% !default;
17
- $sc-stock-info-container-padding: 0px !default;
18
- $sc-stock-image-height: 50px !default;
19
- $sc-stock-grid-height: 300px !default;
20
- $sc-stock-grid-overflow-y: auto !default;
@@ -1,8 +0,0 @@
1
- @import "../../../style/mixin";
2
- @import "./material-definition";
3
-
4
- @include export-module('co-stock-theme') {
5
- .co-stock {
6
-
7
- }
8
- }
@@ -1,4 +0,0 @@
1
- @import "../../../style/variables";
2
- @import "./material-definition";
3
- @import "./layout";
4
- @import "./theme";
@@ -1,22 +0,0 @@
1
- /** AUTO GENERATED FILE. DO NOT CHANGE.. OR YOU WILL SUFFER THE CONSEQUENCES OF YOUR ACTIONS **/
2
-
3
- export enum Icon {
4
- ArrowFatRight = "arrow_fat_right",
5
- ArrowPointDown = "arrow_point_down",
6
- ArrowPointLeft = "arrow_point_left",
7
- ArrowPointRight = "arrow_point_right",
8
- CalendarDay = "calendar_day",
9
- Cancel = "cancel",
10
- DeliveryTruck = "delivery_truck",
11
- EditPencil = "edit_pencil",
12
- Email = "email",
13
- Pdf = "pdf",
14
- PlusRound = "plus_round",
15
- Print = "print",
16
- SignatureField = "signature_field",
17
- Tag = "tag",
18
- ThickLines = "thick_lines",
19
- ThinLines = "thin_lines",
20
- Txt = "txt",
21
- Xml = "xml"
22
- }
@@ -1,120 +0,0 @@
1
- import {ComplexFieldDecorator} from "./decorators/complex-field.decorator";
2
- import {ComplexArrayDecorator} from "./decorators/complex-array.decorator";
3
- import {BooleanTextDecorator} from "./decorators/boolean.decorator";
4
- import {DateFieldFieldDecorator} from "./decorators/date-field.decorator";
5
- import {StringNumberDecorator} from "./decorators/string-number.decorator";
6
- import {isNill} from "../utils/is-nill.function";
7
- import {ArrayUtils} from "../utils/array-utils";
8
- import {BusinessObject} from "../model/business-object";
9
-
10
- // Factory service creates businessobjects, using their decorators in the process.
11
- export class BusinessObjectFactory {
12
- constructor() {
13
- }
14
-
15
- /**
16
- * Creates and returns a new business data object instance of given class, with all given data properties applied to it in a
17
- * complex-aware style. That is, all properties on given class that are decorated with @ComplexField(..) or @ComplexArray(..) decorators
18
- * become strongly typed business objects, with methods that are usable and such.
19
- *
20
- * @param modelClass
21
- * @param {Object} rawData The object with all (possibly raw/flat/not alive) data to be applied to the created model object
22
- */
23
- public makeWithRawBackendData(modelClass: any, rawData: Object): BusinessObject {
24
- if (!modelClass) {
25
- return undefined;
26
- }
27
- if (typeof modelClass !== typeof BusinessObject) {
28
- return undefined;
29
- }
30
-
31
- const model: BusinessObject = new modelClass();
32
- this._copyAllPropertiesDecoratorProcessedFrom(rawData, model);
33
- return model;
34
- }
35
-
36
- // see makeWithRawBackendData, this is a loop-wrapper around that method
37
- public makeBOArrayFromRawBackendDataArray(modelClass: any, arrayOfRawDatas: Object[]): BusinessObject[] {
38
- if (!modelClass) {
39
- return undefined;
40
- }
41
-
42
- const trueClientBos: BusinessObject[] = [];
43
- if (arrayOfRawDatas) {
44
- for (let i: number = 0, len: number = arrayOfRawDatas.length; i < len; i++) {
45
- trueClientBos.push(this.makeWithRawBackendData(modelClass, arrayOfRawDatas[i]));
46
- }
47
- }
48
- return trueClientBos;
49
- }
50
-
51
- public instantiateNewBo(modelClass: any): BusinessObject {
52
- return this.makeWithRawBackendData(modelClass, {});
53
- }
54
-
55
- /**
56
- * Applies all properties of given 'source' object to the given 'destination' businessobject, if destination has that property.
57
- * Works with the @ComplexField(), @ComplexArray, @BooleanText, @CoInject and @DateField annotations of given destination model.
58
- *
59
- * @param sourceData Raw data to copy to destination model
60
- * @param {BusinessObject} destinationModel InOut: The annotated businessobject to apply source properties to
61
- */
62
- private _copyAllPropertiesDecoratorProcessedFrom(sourceData: any, destinationModel: BusinessObject): void {
63
- if (!sourceData || !destinationModel) {
64
- return;
65
- }
66
-
67
- // process all source data into destinationModel
68
- for (const srcPropKey in sourceData) {
69
- if (!sourceData.hasOwnProperty(srcPropKey)) {
70
- continue;
71
- }
72
-
73
- const srcPropVal: any = sourceData[srcPropKey];
74
-
75
- if (ComplexFieldDecorator.IsComplexField(destinationModel, srcPropKey)) {
76
- const classOfField: any = ComplexFieldDecorator.GetComplexFieldType(destinationModel, srcPropKey);
77
- destinationModel[srcPropKey] = this.makeWithRawBackendData(classOfField, srcPropVal);
78
- } else if (ComplexArrayDecorator.IsComplexArray(destinationModel, srcPropKey)) {
79
- const sourceArray: any[] = srcPropVal;
80
- if (!sourceArray) {
81
- continue;
82
- }
83
- const classOfArrayItems: any = ComplexArrayDecorator.GetComplexArrayType(destinationModel, srcPropKey);
84
- const tempArray: any[] = [];
85
- for (let i: number = 0, len: number = sourceArray.length; i < len; i++) {
86
- tempArray.push(this.makeWithRawBackendData(classOfArrayItems, sourceArray[i]));
87
- }
88
- destinationModel[srcPropKey] = tempArray;
89
- } else if (BooleanTextDecorator.IsBooleanTextField(destinationModel, srcPropKey)) {
90
- // logical 'true' and 'false' also allowed as incoming values for @BooleanText() properties: then just copy their value
91
- if (typeof srcPropVal === "boolean") {
92
- destinationModel[srcPropKey] = srcPropVal;
93
- // here, it should be a 'J' or 'N' (or 'T' or 'F'): assign the associated boolean value
94
- } else {
95
- destinationModel[srcPropKey] = BooleanTextDecorator.GetLogicalBooleanValue(srcPropVal);
96
- }
97
- } else if (DateFieldFieldDecorator.IsDateField(destinationModel, srcPropKey)) {
98
- destinationModel[srcPropKey] = DateFieldFieldDecorator.StringAsDate(srcPropVal);
99
- } else if (StringNumberDecorator.IsStringNumber(destinationModel, srcPropKey)) {
100
- destinationModel[srcPropKey] = StringNumberDecorator.StringAsNumber(srcPropVal);
101
- }
102
- // non-decorated prop
103
- else {
104
- if (isNill(srcPropVal)) {
105
- destinationModel[srcPropKey] = undefined;
106
- } else if (Array.isArray(srcPropVal)) {
107
- destinationModel[srcPropKey] = ArrayUtils.CloneArray(srcPropVal);
108
- } else if (typeof srcPropVal === "object") {
109
- if (srcPropVal instanceof Map) { //just copy the value in case of maps
110
- destinationModel[srcPropKey] = srcPropVal;
111
- } else {
112
- destinationModel[srcPropKey] = Object.assign({}, srcPropVal);
113
- }
114
- } else {
115
- destinationModel[srcPropKey] = srcPropVal;
116
- }
117
- }
118
- }
119
- }
120
- }
@@ -1,113 +0,0 @@
1
- import {GetYesNoDbBooleanValue} from "@colijnit/articleapi/build/enum/yes-no-db-type.enum";
2
- import {GetTrueFalseDbBooleanValue} from "@colijnit/articleapi/build/enum/true-false-db-type.enum";
3
- import {GetOneZeroDbBooleanValue} from "@colijnit/articleapi/build/enum/one-zero-bool-db-type.enum";
4
- import {DbBooleanValueType, GetLogicalBooleanValue} from "@colijnit/articleapi/build/enum/db-boolean-value-type.enum";
5
-
6
- const PROP_META_KEY_JN: string = "booleanTextJN";
7
- const PROP_META_KEY_TF: string = "booleanTextTF";
8
- const PROP_META_KEY_10: string = "booleanText10";
9
-
10
- /**
11
- * 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
12
- * our client application.
13
- *
14
- * The values 'J' and 'N' seem to be most commonly used. This is the default setting when using this decorator.
15
- * You can pass 'T' or 1 for the other variants as follows:
16
- *
17
- * Usage:
18
- *
19
- * @BooleanText() or @BooleanText("J") (the default, uses YesNoDbType char values)
20
- * public foo: boolean // 'J' and 'N' become true and false after BusinessObjectFactoryService and -SerializerService processing
21
- *
22
- * @BooleanText('T') (uses TrueFalseDbType char values)
23
- * public bar: boolean // 'T' and 'F' become true and false after BusinessObjectFactoryService and -SerializerService processing
24
- *
25
- * @BooleanText(1)
26
- * public baz: boolean // 1 and 0 become true and false after BusinessObjectFactoryService and -SerializerService processing
27
- */
28
- export function BooleanText(type?: "J" | "T" | 1): PropertyDecorator {
29
- return function (target: any, propertyKey: string): void {
30
- if (!target || !propertyKey) {
31
- return;
32
- }
33
- // by default, it's a J N boolean text
34
- if (!type || type === "J") {
35
- Reflect.defineMetadata(PROP_META_KEY_JN, true, target, propertyKey);
36
- } else if (type === "T") {
37
- Reflect.defineMetadata(PROP_META_KEY_TF, true, target, propertyKey);
38
- } else if (type === 1) {
39
- Reflect.defineMetadata(PROP_META_KEY_10, true, target, propertyKey);
40
- }
41
- };
42
- }
43
-
44
- // Utility function holder of the BooleanTextDecorator decorator.
45
- export class BooleanTextDecorator {
46
-
47
- /**
48
- * Returns whether given property (as a string) on given object is a boolean text field. That is, it's a field that is decorated
49
- * with the @BooleanText decorator.
50
- */
51
- public static IsBooleanTextField(target: Object, propertyKey: string): boolean {
52
- if (!target || !propertyKey || typeof target !== "object") {
53
- return false;
54
- }
55
- return (
56
- Reflect.getMetadata(PROP_META_KEY_JN, target, propertyKey) === true
57
- ||
58
- Reflect.getMetadata(PROP_META_KEY_TF, target, propertyKey) === true
59
- ||
60
- Reflect.getMetadata(PROP_META_KEY_10, target, propertyKey) === true
61
- );
62
- }
63
-
64
- /**
65
- * Returns the logical true or false value of given character ('J', 'N', 'T' or 'F') or number (0 or 1).
66
- * Returns UNDEFINED if given boolChar was not recognised as a boolean text.
67
- */
68
- public static GetLogicalBooleanValue(dbBoolChar: DbBooleanValueType | string): boolean {
69
- return GetLogicalBooleanValue(dbBoolChar);
70
- }
71
-
72
- /**
73
- * Returns the boolean character / number of given logical bool property on target object. Uses its @BooleanText() annotation to decide
74
- * what character / number to return.
75
- * Used in BusinessObjectSerializerServiceService to convert logical bools to their original boolean character.
76
- * @returns {string|number} The original, reverse-engineered boolean character (or number) of given object property, or undefined.
77
- */
78
- public static GetDbBooleanValue(target: Object, propertyKey: string): DbBooleanValueType {
79
- if (!target || !propertyKey || typeof target !== "object") {
80
- return undefined;
81
- }
82
-
83
- let dbBoolVal: any = undefined;
84
-
85
- const curBoolVal: boolean = target[propertyKey];
86
-
87
- if (BooleanTextDecorator._IsJaNeeProp(target, propertyKey)) {
88
- dbBoolVal = GetYesNoDbBooleanValue(curBoolVal);
89
- } else if (BooleanTextDecorator._IsTrueFalseProp(target, propertyKey)) {
90
- dbBoolVal = GetTrueFalseDbBooleanValue(curBoolVal);
91
- } else if (BooleanTextDecorator._IsZeroOneProp(target, propertyKey)) {
92
- dbBoolVal = GetOneZeroDbBooleanValue(curBoolVal);
93
- }
94
-
95
- return dbBoolVal as any as DbBooleanValueType;
96
- }
97
-
98
- private static _IsJaNeeProp(target: Object, propertyKey: string): boolean {
99
- return BooleanTextDecorator._IsProp(PROP_META_KEY_JN, target, propertyKey);
100
- }
101
-
102
- private static _IsTrueFalseProp(target: Object, propertyKey: string): boolean {
103
- return BooleanTextDecorator._IsProp(PROP_META_KEY_TF, target, propertyKey);
104
- }
105
-
106
- private static _IsZeroOneProp(target: Object, propertyKey: string): boolean {
107
- return BooleanTextDecorator._IsProp(PROP_META_KEY_10, target, propertyKey);
108
- }
109
-
110
- private static _IsProp(prop: string, target: Object, propertyKey: string): boolean {
111
- return !!target && !!propertyKey && typeof target === "object" && Reflect.hasMetadata(prop, target, propertyKey);
112
- }
113
- }
@@ -1,61 +0,0 @@
1
- import {notNill} from "@colijnit/articleapi/build/utils/function/not-nill.function";
2
- import {ObjectUtils} from "@colijnit/articleapi/build/utils/object-utils";
3
-
4
- const PROP_META_KEY: string = "complexArray";
5
-
6
- /**
7
- * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
8
- */
9
-
10
- /**
11
- * Property decorator for properties of businessobject classes that are an array of other strongly typed businessobjects.
12
- * Ensures that the BusinessObjectFactoryService makes properly typed objects from incoming raw persistence data. Otherwise we couldn't add methods
13
- * to our own businessobjects and use them, since all fields would be flat data without methods after BusinessObjectFactoryService creation.
14
- *
15
- * Usage:
16
- *
17
- * @ComplexArray(TransactionLine)
18
- * public transactionLines: TransactionLine[]
19
- */
20
- export function ComplexArray(type: any): PropertyDecorator {
21
- return function (target: any, propertyKey: string): void {
22
- if (!target || !propertyKey || typeof target !== "object") {
23
- return;
24
- }
25
- // warn the programmer if given type was undefined; it's probably an import order glitch that caused this, because decorators seem
26
- // to be immediately processed when a class is first imported
27
- if (!type) {
28
- console.warn(`@ComplexArray(type): type was UNDEFINED. Called on prop (${ObjectUtils.GetClassName(target)}, ${propertyKey}). ` +
29
- `Class will not properly serialize and deserialize now. We've always been able to fix this by CHANGING IMPORT ORDERS ` +
30
- `where both classes and their dependencies are used, e.g. factory, repository or models..`);
31
- return;
32
- }
33
- Reflect.defineMetadata(PROP_META_KEY, type, target, propertyKey);
34
- };
35
- }
36
-
37
- // Utility function holder of the ComplexArrayDecorator decorator.
38
- export class ComplexArrayDecorator {
39
- /**
40
- * Returns whether given property (as a string) on given object is a complex array. A complex array is an array field that is decorated
41
- * with the @ComplexArray decorator.
42
- */
43
- public static IsComplexArray(target: Object, propertyKey: string): boolean {
44
- if (!target || !propertyKey || typeof target !== "object") {
45
- return false;
46
- }
47
-
48
- return (notNill(Reflect.getMetadata(PROP_META_KEY, target, propertyKey)));
49
- }
50
-
51
- /**
52
- * Returns the VALUE of the @ComplexArray(VALUE) property decorator on the given propertyKey on the given modelobject.
53
- */
54
- public static GetComplexArrayType(target: Object, propertyKey: string): any {
55
- if (!target || !propertyKey || typeof target !== "object") {
56
- return undefined;
57
- }
58
-
59
- return Reflect.getMetadata(PROP_META_KEY, target, propertyKey);
60
- }
61
- }
@@ -1,63 +0,0 @@
1
- import {notNill} from "@colijnit/articleapi/build/utils/function/not-nill.function";
2
- import {ObjectUtils} from "@colijnit/articleapi/build/utils/object-utils";
3
-
4
- const PROP_META_KEY: string = "complexField";
5
-
6
- /**
7
- * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
8
- */
9
-
10
- /**
11
- * Property decorator for properties of businessobject classes that are other strongly typed businessobjects.
12
- * Ensures that the BusinessObjectFactoryService makes properly typed objects from incoming raw persistence data. Otherwise we couldn't add methods
13
- * to our own businessobjects and use them, since all fields would be flat data without methods after BusinessObjectFactoryService creation.
14
- *
15
- * Usage:
16
- *
17
- * @ComplexField(Transaction)
18
- * public transaction: Transaction
19
- *
20
- * Also keeps track of a "complexFieldProps" metadata on the class-level, as a reflect-metadata workaround to be able to
21
- * retrieve all properties that have the @ComplexField(..) decorator (impossible with current Reflect API).
22
- */
23
- export function ComplexField(type: any): PropertyDecorator {
24
- return function (target: any, propertyKey: string): void {
25
- if (!target || !propertyKey) {
26
- return;
27
- }
28
-
29
- // warn the programmer if given type was undefined; it's probably an import order glitch that caused this, because decorators seem
30
- // to be immediately processed when a class is first imported
31
- if (!type) {
32
- // eslint-disable-next-line no-console
33
- console.warn(`@ComplexField(type): type was UNDEFINED. Called on prop (${ObjectUtils.GetClassName(target)}, ${propertyKey}). ` +
34
- `Class will not properly serialize and deserialize now. We've always been able to fix this by CHANGING IMPORT ORDERS ` +
35
- `where both classes and their dependencies are used, e.g. factory, repository or models..`);
36
- return;
37
- }
38
- Reflect.defineMetadata(PROP_META_KEY, type, target, propertyKey);
39
- };
40
- }
41
-
42
- // Utility function holder of the ComplexFieldDecorator decorator.
43
- export class ComplexFieldDecorator {
44
-
45
- /**
46
- * Returns whether given property (as a string) on given object is a complex field. A complex field is a field that is decorated
47
- * with the @ComplexField decorator.
48
- */
49
- public static IsComplexField(target: Object, propertyKey: string): boolean {
50
- if (!target || !propertyKey || typeof target !== "object") {
51
- return false;
52
- }
53
- return (notNill(Reflect.getMetadata(PROP_META_KEY, target, propertyKey)));
54
- }
55
-
56
- // Returns the VALUE of the @ComplexField(VALUE) property decorator on the given propertyKey on the given modelObject.
57
- public static GetComplexFieldType(target: Object, propertyKey: string): any {
58
- if (!target || !propertyKey || typeof target !== "object") {
59
- return undefined;
60
- }
61
- return Reflect.getMetadata(PROP_META_KEY, target, propertyKey);
62
- }
63
- }
@@ -1,41 +0,0 @@
1
- import {DateUtils} from "@colijnit/articleapi/build/utils/date-utils";
2
-
3
- const PROP_META_KEY: string = "dateField";
4
-
5
- /**
6
- * !! just a TAG DECORATOR for now, there is no code that uses this meta data within the ione connector lib itself.
7
- */
8
-
9
- /**
10
- * Property decorator for properties of businessobject classes that are of type Date, but are sent to us as strings.
11
- * Ensures that the BusinessObjectFactory makes proper JavaScript Date objects from incoming strings for @DateField() decorated properties.
12
- *
13
- * Usage:
14
- *
15
- * @DateField()
16
- * public expectedDeliveryDate: Date
17
- */
18
- export function DateField(): PropertyDecorator {
19
- return function (target: any, propertyKey: string): void {
20
- if (!target || !propertyKey) {
21
- return;
22
- }
23
- Reflect.defineMetadata(PROP_META_KEY, undefined, target, propertyKey);
24
- };
25
- }
26
-
27
- // Utility function holder of the @DateField() decorator.
28
- export class DateFieldFieldDecorator {
29
-
30
- // Returns whether given property (as a string) on given object is decorated with @DateField().
31
- public static IsDateField(target: Object, propertyKey: string): boolean {
32
- if (!target || !propertyKey || typeof target !== "object") {
33
- return false;
34
- }
35
- return Reflect.hasMetadata(PROP_META_KEY, target, propertyKey);
36
- }
37
-
38
- public static StringAsDate(str: string): Date {
39
- return DateUtils.StringAsDate(str);
40
- }
41
- }