@colijnit/mainapi 1.0.37 → 1.0.38
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/build/enum/absence-type.enum.d.ts +10 -10
- package/build/enum/absence-type.enum.js +14 -14
- package/build/enum/activities-object-name.enum.d.ts +4 -4
- package/build/enum/activities-object-name.enum.js +8 -8
- package/build/enum/activities-operation-name.enum.d.ts +8 -8
- package/build/enum/activities-operation-name.enum.js +12 -12
- package/build/enum/activity-sort-type.enum.d.ts +5 -5
- package/build/enum/activity-sort-type.enum.js +9 -9
- package/build/enum/activity-type.d.ts +9 -9
- package/build/enum/activity-type.js +13 -13
- package/build/enum/article-publication.enum.d.ts +5 -5
- package/build/enum/article-publication.enum.js +9 -9
- package/build/enum/backend-service-name.enum.d.ts +9 -9
- package/build/enum/backend-service-name.enum.js +13 -13
- package/build/enum/co-document-image-display-kind.enum.d.ts +5 -5
- package/build/enum/co-document-image-display-kind.enum.js +9 -9
- package/build/enum/co-document-type.enum.d.ts +5 -5
- package/build/enum/co-document-type.enum.js +9 -9
- package/build/enum/co-sub-report.bo.d.ts +11 -11
- package/build/enum/co-sub-report.bo.js +21 -21
- package/build/enum/config-object-name.enum.d.ts +3 -3
- package/build/enum/config-object-name.enum.js +7 -7
- package/build/enum/data-mapping.enum.d.ts +5 -5
- package/build/enum/data-mapping.enum.js +9 -9
- package/build/enum/data-service-method.enum.d.ts +15 -15
- package/build/enum/data-service-method.enum.js +19 -19
- package/build/enum/db-boolean-value-type.enum.d.ts +12 -12
- package/build/enum/db-boolean-value-type.enum.js +32 -32
- package/build/enum/delivery-time-unit-type.enum.d.ts +4 -4
- package/build/enum/delivery-time-unit-type.enum.js +8 -8
- package/build/enum/document-allowed-type.enum.d.ts +10 -10
- package/build/enum/document-allowed-type.enum.js +14 -14
- package/build/enum/document-method.enum.d.ts +6 -6
- package/build/enum/document-method.enum.js +10 -10
- package/build/enum/domain-name.enum.d.ts +64 -64
- package/build/enum/domain-name.enum.js +68 -68
- package/build/enum/file-type-internal.enum.d.ts +11 -11
- package/build/enum/file-type-internal.enum.js +15 -15
- package/build/enum/file-type.enum.d.ts +5 -5
- package/build/enum/file-type.enum.js +9 -9
- package/build/enum/general-method.enum.d.ts +37 -37
- package/build/enum/general-method.enum.js +41 -41
- package/build/enum/insured-interest-type.enum.d.ts +10 -10
- package/build/enum/insured-interest-type.enum.js +14 -14
- package/build/enum/internal-param.enum.d.ts +10 -10
- package/build/enum/internal-param.enum.js +14 -14
- package/build/enum/ione-module-name.enum.d.ts +39 -39
- package/build/enum/ione-module-name.enum.js +55 -55
- package/build/enum/master-data-object-name.enum.d.ts +25 -25
- package/build/enum/master-data-object-name.enum.js +29 -29
- package/build/enum/message-type.enum.d.ts +6 -6
- package/build/enum/message-type.enum.js +10 -10
- package/build/enum/module-name.enum.d.ts +14 -14
- package/build/enum/module-name.enum.js +18 -18
- package/build/enum/module-navigation-link.d.ts +5 -5
- package/build/enum/module-navigation-link.js +2 -2
- package/build/enum/note-display-type.enum.d.ts +5 -5
- package/build/enum/note-display-type.enum.js +9 -9
- package/build/enum/one-zero-bool-db-type.enum.d.ts +5 -5
- package/build/enum/one-zero-bool-db-type.enum.js +20 -20
- package/build/enum/own-risk.enum.d.ts +7 -7
- package/build/enum/own-risk.enum.js +11 -11
- package/build/enum/period.enum.d.ts +7 -7
- package/build/enum/period.enum.js +11 -11
- package/build/enum/personal-activity-tab.enum.d.ts +4 -4
- package/build/enum/personal-activity-tab.enum.js +8 -8
- package/build/enum/preset-object-name.enum.d.ts +3 -3
- package/build/enum/preset-object-name.enum.js +7 -7
- package/build/enum/price-type.enum.d.ts +4 -4
- package/build/enum/price-type.enum.js +8 -8
- package/build/enum/printing-service-method.d.ts +8 -8
- package/build/enum/printing-service-method.js +12 -12
- package/build/enum/priority-type.enum.d.ts +7 -7
- package/build/enum/priority-type.enum.js +11 -11
- package/build/enum/product-kind.enum.d.ts +6 -6
- package/build/enum/product-kind.enum.js +10 -10
- package/build/enum/public-service-method.d.ts +20 -20
- package/build/enum/public-service-method.js +24 -24
- package/build/enum/relation-kind.d.ts +10 -10
- package/build/enum/relation-kind.js +14 -14
- package/build/enum/relman-complete-name.d.ts +5 -5
- package/build/enum/relman-complete-name.js +2 -2
- package/build/enum/report-method.enum.d.ts +15 -15
- package/build/enum/report-method.enum.js +19 -19
- package/build/enum/report-object-name.enum.d.ts +3 -3
- package/build/enum/report-object-name.enum.js +7 -7
- package/build/enum/report-param-type.enum.d.ts +15 -15
- package/build/enum/report-param-type.enum.js +19 -19
- package/build/enum/report-type.enum.d.ts +45 -45
- package/build/enum/report-type.enum.js +49 -49
- package/build/enum/reporting-documents-method.enum.d.ts +4 -4
- package/build/enum/reporting-documents-method.enum.js +8 -8
- package/build/enum/send-method-type.enum.d.ts +10 -10
- package/build/enum/send-method-type.enum.js +14 -14
- package/build/enum/sequence-name.enum.d.ts +31 -31
- package/build/enum/sequence-name.enum.js +35 -35
- package/build/enum/simple-base-data-object-name.enum.d.ts +5 -5
- package/build/enum/simple-base-data-object-name.enum.js +9 -9
- package/build/enum/simple-base-data-operation-name.enum.d.ts +4 -4
- package/build/enum/simple-base-data-operation-name.enum.js +8 -8
- package/build/enum/tab-category.enum.d.ts +19 -19
- package/build/enum/tab-category.enum.js +23 -23
- package/build/enum/table-name.enum.d.ts +82 -82
- package/build/enum/table-name.enum.js +86 -86
- package/build/enum/tag-method.enum.d.ts +4 -4
- package/build/enum/tag-method.enum.js +8 -8
- package/build/enum/tag-object.enum.d.ts +3 -3
- package/build/enum/tag-object.enum.js +7 -7
- package/build/enum/tag-operation-name.enum.d.ts +3 -3
- package/build/enum/tag-operation-name.enum.js +7 -7
- package/build/enum/text-standard-type-text.d.ts +7 -7
- package/build/enum/text-standard-type-text.js +11 -11
- package/build/enum/text-standard-type.d.ts +7 -7
- package/build/enum/text-standard-type.js +11 -11
- package/build/enum/transaction-kind.d.ts +13 -13
- package/build/enum/transaction-kind.js +17 -17
- package/build/enum/true-false-db-type.enum.d.ts +5 -5
- package/build/enum/true-false-db-type.enum.js +20 -20
- package/build/enum/vat-type.enum.d.ts +4 -4
- package/build/enum/vat-type.enum.js +8 -8
- package/build/enum/workflow-category.enum.d.ts +18 -18
- package/build/enum/workflow-category.enum.js +22 -22
- package/build/enum/workflow-trigger-type.enum.d.ts +8 -8
- package/build/enum/workflow-trigger-type.enum.js +12 -12
- package/build/enum/yes-no-db-type.enum.d.ts +5 -5
- package/build/enum/yes-no-db-type.enum.js +20 -20
- package/build/main-api-connection.d.ts +66 -66
- package/build/main-api-connection.js +14 -14
- package/build/main-api.d.ts +81 -81
- package/build/main-api.js +219 -219
- package/build/main-api.unit.test.d.ts +1 -1
- package/build/main-api.unit.test.js +128 -128
- package/build/main-auth.d.ts +62 -62
- package/build/main-auth.js +556 -556
- package/build/main-public.d.ts +62 -62
- package/build/main-public.js +248 -248
- package/build/model/activity-list-view-model.d.ts +11 -11
- package/build/model/activity-list-view-model.js +20 -20
- package/build/model/activity-view-model.d.ts +13 -13
- package/build/model/activity-view-model.js +27 -27
- package/build/model/activity.bo.d.ts +58 -58
- package/build/model/activity.bo.js +484 -484
- package/build/model/article-seo-value.d.ts +5 -5
- package/build/model/article-seo-value.js +6 -6
- package/build/model/branch.bo.d.ts +8 -8
- package/build/model/branch.bo.js +7 -7
- package/build/model/brand.d.ts +8 -8
- package/build/model/brand.js +10 -10
- package/build/model/category.bo.d.ts +12 -12
- package/build/model/category.bo.js +16 -16
- package/build/model/co-document-right.d.ts +7 -7
- package/build/model/co-document-right.js +7 -7
- package/build/model/co-document.d.ts +64 -64
- package/build/model/co-document.js +180 -180
- package/build/model/co-domain-value.bo.d.ts +10 -10
- package/build/model/co-domain-value.bo.js +20 -20
- package/build/model/co-notition-right.bo.d.ts +10 -10
- package/build/model/co-notition-right.bo.js +13 -13
- package/build/model/co-notition.bo.d.ts +24 -24
- package/build/model/co-notition.bo.js +79 -79
- package/build/model/co-report-category-link.bo.d.ts +8 -8
- package/build/model/co-report-category-link.bo.js +7 -7
- package/build/model/co-report-sjablonen-documenten.bo.d.ts +6 -6
- package/build/model/co-report-sjablonen-documenten.bo.js +7 -7
- package/build/model/co-report.bo.d.ts +47 -47
- package/build/model/co-report.bo.js +68 -68
- package/build/model/co-rv-domain-value.bo.d.ts +10 -10
- package/build/model/co-rv-domain-value.bo.js +20 -20
- package/build/model/co-text.d.ts +26 -26
- package/build/model/co-text.js +28 -28
- package/build/model/color.bo.d.ts +7 -7
- package/build/model/color.bo.js +10 -10
- package/build/model/constant/java-constants.d.ts +2 -2
- package/build/model/constant/java-constants.js +5 -5
- package/build/model/contact-moment.bo.d.ts +17 -17
- package/build/model/contact-moment.bo.js +39 -39
- package/build/model/currency.bo.d.ts +13 -13
- package/build/model/currency.bo.js +33 -33
- package/build/model/department.bo.d.ts +12 -12
- package/build/model/department.bo.js +69 -69
- package/build/model/document-allowed-extension.bo.d.ts +6 -6
- package/build/model/document-allowed-extension.bo.js +7 -7
- package/build/model/form-question-response.bo.d.ts +10 -10
- package/build/model/form-question-response.bo.js +31 -31
- package/build/model/form.bo.d.ts +16 -16
- package/build/model/form.bo.js +13 -13
- package/build/model/get-postal-code-retrieval-output-params.d.ts +7 -7
- package/build/model/get-postal-code-retrieval-output-params.js +6 -6
- package/build/model/insured-interest.bo.d.ts +13 -13
- package/build/model/insured-interest.bo.js +39 -39
- package/build/model/language.bo.d.ts +5 -5
- package/build/model/language.bo.js +7 -7
- package/build/model/order-line-set-category.bo.d.ts +8 -8
- package/build/model/order-line-set-category.bo.js +7 -7
- package/build/model/own-risk.bo.d.ts +11 -11
- package/build/model/own-risk.bo.js +39 -39
- package/build/model/payment-condition-ledger-account.bo.d.ts +6 -6
- package/build/model/payment-condition-ledger-account.bo.js +7 -7
- package/build/model/payment-condition.bo.d.ts +11 -11
- package/build/model/payment-condition.bo.js +34 -34
- package/build/model/preset.bo.d.ts +12 -12
- package/build/model/preset.bo.js +16 -16
- package/build/model/printer.bo.d.ts +8 -8
- package/build/model/printer.bo.js +13 -13
- package/build/model/printing-service-request-data.d.ts +16 -16
- package/build/model/printing-service-request-data.js +2 -2
- package/build/model/privacy-setting.bo.d.ts +9 -9
- package/build/model/privacy-setting.bo.js +13 -13
- package/build/model/relation-small-object.bo.d.ts +28 -28
- package/build/model/relation-small-object.bo.js +63 -63
- package/build/model/remark.bo.d.ts +17 -17
- package/build/model/remark.bo.js +52 -52
- package/build/model/report-category.bo.d.ts +6 -6
- package/build/model/report-category.bo.js +7 -7
- package/build/model/report-layout-selection-base.bo.d.ts +9 -9
- package/build/model/report-layout-selection-base.bo.js +7 -7
- package/build/model/report-layout-selection-email.bo.d.ts +4 -4
- package/build/model/report-layout-selection-email.bo.js +7 -7
- package/build/model/report-layout-selection-print.bo.d.ts +5 -5
- package/build/model/report-layout-selection-print.bo.js +7 -7
- package/build/model/report-param.d.ts +16 -16
- package/build/model/report-param.js +9 -9
- package/build/model/reporting-document-base-request.d.ts +4 -4
- package/build/model/reporting-document-base-request.js +6 -6
- package/build/model/reporting-document-email-base-request.d.ts +5 -5
- package/build/model/reporting-document-email-base-request.js +7 -7
- package/build/model/reporting-document-email-sign-doc-base-request.d.ts +4 -4
- package/build/model/reporting-document-email-sign-doc-base-request.js +7 -7
- package/build/model/reporting-document-pdf-base-request.d.ts +3 -3
- package/build/model/reporting-document-pdf-base-request.js +7 -7
- package/build/model/reporting-document-print-base-request.d.ts +7 -7
- package/build/model/reporting-document-print-base-request.js +7 -7
- package/build/model/reporting-document-print-sign-doc-base-request.d.ts +4 -4
- package/build/model/reporting-document-print-sign-doc-base-request.js +7 -7
- package/build/model/send-method.bo.d.ts +5 -5
- package/build/model/send-method.bo.js +7 -7
- package/build/model/store-group.bo.d.ts +9 -9
- package/build/model/store-group.bo.js +7 -7
- package/build/model/tag-stock-item.bo.d.ts +24 -24
- package/build/model/tag-stock-item.bo.js +21 -21
- package/build/model/tag-tree-item.bo.d.ts +18 -18
- package/build/model/tag-tree-item.bo.js +52 -52
- package/build/model/tag.d.ts +11 -11
- package/build/model/tag.js +41 -41
- package/build/model/task-category.bo.d.ts +13 -13
- package/build/model/task-category.bo.js +28 -28
- package/build/model/task.bo.d.ts +83 -83
- package/build/model/task.bo.js +257 -257
- package/build/model/title.bo.d.ts +9 -9
- package/build/model/title.bo.js +13 -13
- package/build/model/transition.bo.d.ts +5 -5
- package/build/model/transition.bo.js +21 -21
- package/build/model/tree-object.d.ts +8 -8
- package/build/model/tree-object.js +29 -29
- package/build/model/user-group.bo.d.ts +13 -13
- package/build/model/user-group.bo.js +16 -16
- package/build/model/work.bo.d.ts +19 -19
- package/build/model/work.bo.js +53 -53
- package/build/model/workflow-generic-transition.bo.d.ts +22 -22
- package/build/model/workflow-generic-transition.bo.js +28 -28
- package/build/model/workflow-trigger.bo.d.ts +44 -44
- package/build/model/workflow-trigger.bo.js +52 -52
- package/build/model/workflow.bo.d.ts +36 -36
- package/build/model/workflow.bo.js +151 -151
- package/build/utils/css-utils.d.ts +18 -18
- package/build/utils/css-utils.js +148 -148
- package/build/utils/file-utils.d.ts +34 -34
- package/build/utils/file-utils.js +397 -397
- package/build/utils/time-utils.d.ts +6 -6
- package/build/utils/time-utils.js +44 -44
- package/package.json +3 -3
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Workflow = void 0;
|
|
13
|
-
const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
|
|
14
|
-
const boolean_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/boolean.decorator");
|
|
15
|
-
const complex_array_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator");
|
|
16
|
-
const workflow_trigger_bo_1 = require("./workflow-trigger.bo");
|
|
17
|
-
const no_db_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/no-db-field.decorator");
|
|
18
|
-
const workflow_trigger_type_enum_1 = require("../enum/workflow-trigger-type.enum");
|
|
19
|
-
class Workflow extends business_object_1.BusinessObject {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.manualTriggers = [];
|
|
23
|
-
this.manualGenericTriggers = [];
|
|
24
|
-
this.useSingleTaskTriggerAsTask = false;
|
|
25
|
-
}
|
|
26
|
-
get workFlowHasOneTaskTrigger() {
|
|
27
|
-
return this.useSingleTaskTriggerAsTask && this.manualTriggers.length === 1 &&
|
|
28
|
-
this.manualTriggers.find(t => t.triggerType === workflow_trigger_type_enum_1.WorkflowTriggerType.Task) !== undefined;
|
|
29
|
-
}
|
|
30
|
-
get hasTriggers() {
|
|
31
|
-
return ((this.manualTriggers && this.manualTriggers.length > 0) ||
|
|
32
|
-
(this.manualGenericTriggers && this.manualGenericTriggers.length > 0)) &&
|
|
33
|
-
!this.workFlowHasOneTaskTrigger;
|
|
34
|
-
}
|
|
35
|
-
get linkLabel() {
|
|
36
|
-
if (this.workFlowHasOneTaskTrigger) {
|
|
37
|
-
return "OPEN_TASK";
|
|
38
|
-
}
|
|
39
|
-
return "";
|
|
40
|
-
}
|
|
41
|
-
get taskIdFromTaskTrigger() {
|
|
42
|
-
return this.manualTriggers.find(t => t.triggerType === workflow_trigger_type_enum_1.WorkflowTriggerType.Task).taskId;
|
|
43
|
-
}
|
|
44
|
-
get name() {
|
|
45
|
-
if (this.workFlowHasOneTaskTrigger) {
|
|
46
|
-
return this.manualTriggers.find(t => t.triggerType === workflow_trigger_type_enum_1.WorkflowTriggerType.Task).name;
|
|
47
|
-
}
|
|
48
|
-
return this.workflowName;
|
|
49
|
-
}
|
|
50
|
-
get description() {
|
|
51
|
-
if (this.workFlowHasOneTaskTrigger) {
|
|
52
|
-
return this.manualTriggers.find(t => t.triggerType === workflow_trigger_type_enum_1.WorkflowTriggerType.Task).description;
|
|
53
|
-
}
|
|
54
|
-
return this.state;
|
|
55
|
-
}
|
|
56
|
-
get urls() {
|
|
57
|
-
const result = [];
|
|
58
|
-
if (this.manualTriggers) {
|
|
59
|
-
for (const trigger of this.manualTriggers) {
|
|
60
|
-
if (trigger.url) {
|
|
61
|
-
result.push(trigger.url);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
get overDue() {
|
|
68
|
-
const len = this.manualTriggers.length;
|
|
69
|
-
for (let i = 0; i < len; i++) {
|
|
70
|
-
if (this.manualTriggers[i].overDue) {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
get combinedTriggerIds() {
|
|
77
|
-
return this.manualTriggers.map(t => t.triggerId).join('_');
|
|
78
|
-
}
|
|
79
|
-
getId() {
|
|
80
|
-
return this.workflowProcessId;
|
|
81
|
-
}
|
|
82
|
-
setId(value) {
|
|
83
|
-
this.workflowProcessId = value;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
__decorate([
|
|
87
|
-
boolean_decorator_1.BooleanText("T"),
|
|
88
|
-
__metadata("design:type", Boolean)
|
|
89
|
-
], Workflow.prototype, "closed", void 0);
|
|
90
|
-
__decorate([
|
|
91
|
-
boolean_decorator_1.BooleanText("T"),
|
|
92
|
-
__metadata("design:type", Boolean)
|
|
93
|
-
], Workflow.prototype, "ended", void 0);
|
|
94
|
-
__decorate([
|
|
95
|
-
boolean_decorator_1.BooleanText("T"),
|
|
96
|
-
__metadata("design:type", Boolean)
|
|
97
|
-
], Workflow.prototype, "beginState", void 0);
|
|
98
|
-
__decorate([
|
|
99
|
-
complex_array_decorator_1.ComplexArray(workflow_trigger_bo_1.WorkflowTrigger),
|
|
100
|
-
__metadata("design:type", Array)
|
|
101
|
-
], Workflow.prototype, "manualTriggers", void 0);
|
|
102
|
-
__decorate([
|
|
103
|
-
no_db_field_decorator_1.NoDbField(),
|
|
104
|
-
__metadata("design:type", Boolean)
|
|
105
|
-
], Workflow.prototype, "useSingleTaskTriggerAsTask", void 0);
|
|
106
|
-
__decorate([
|
|
107
|
-
no_db_field_decorator_1.NoDbField(),
|
|
108
|
-
__metadata("design:type", Boolean),
|
|
109
|
-
__metadata("design:paramtypes", [])
|
|
110
|
-
], Workflow.prototype, "workFlowHasOneTaskTrigger", null);
|
|
111
|
-
__decorate([
|
|
112
|
-
no_db_field_decorator_1.NoDbField(),
|
|
113
|
-
__metadata("design:type", Boolean),
|
|
114
|
-
__metadata("design:paramtypes", [])
|
|
115
|
-
], Workflow.prototype, "hasTriggers", null);
|
|
116
|
-
__decorate([
|
|
117
|
-
no_db_field_decorator_1.NoDbField(),
|
|
118
|
-
__metadata("design:type", String),
|
|
119
|
-
__metadata("design:paramtypes", [])
|
|
120
|
-
], Workflow.prototype, "linkLabel", null);
|
|
121
|
-
__decorate([
|
|
122
|
-
no_db_field_decorator_1.NoDbField(),
|
|
123
|
-
__metadata("design:type", Number),
|
|
124
|
-
__metadata("design:paramtypes", [])
|
|
125
|
-
], Workflow.prototype, "taskIdFromTaskTrigger", null);
|
|
126
|
-
__decorate([
|
|
127
|
-
no_db_field_decorator_1.NoDbField(),
|
|
128
|
-
__metadata("design:type", String),
|
|
129
|
-
__metadata("design:paramtypes", [])
|
|
130
|
-
], Workflow.prototype, "name", null);
|
|
131
|
-
__decorate([
|
|
132
|
-
no_db_field_decorator_1.NoDbField(),
|
|
133
|
-
__metadata("design:type", String),
|
|
134
|
-
__metadata("design:paramtypes", [])
|
|
135
|
-
], Workflow.prototype, "description", null);
|
|
136
|
-
__decorate([
|
|
137
|
-
no_db_field_decorator_1.NoDbField(),
|
|
138
|
-
__metadata("design:type", Array),
|
|
139
|
-
__metadata("design:paramtypes", [])
|
|
140
|
-
], Workflow.prototype, "urls", null);
|
|
141
|
-
__decorate([
|
|
142
|
-
no_db_field_decorator_1.NoDbField(),
|
|
143
|
-
__metadata("design:type", Boolean),
|
|
144
|
-
__metadata("design:paramtypes", [])
|
|
145
|
-
], Workflow.prototype, "overDue", null);
|
|
146
|
-
__decorate([
|
|
147
|
-
no_db_field_decorator_1.NoDbField(),
|
|
148
|
-
__metadata("design:type", String),
|
|
149
|
-
__metadata("design:paramtypes", [])
|
|
150
|
-
], Workflow.prototype, "combinedTriggerIds", null);
|
|
151
|
-
exports.Workflow = Workflow;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Workflow = void 0;
|
|
13
|
+
const business_object_1 = require("@colijnit/ioneconnector/build/model/business-object");
|
|
14
|
+
const boolean_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/boolean.decorator");
|
|
15
|
+
const complex_array_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/complex-array.decorator");
|
|
16
|
+
const workflow_trigger_bo_1 = require("./workflow-trigger.bo");
|
|
17
|
+
const no_db_field_decorator_1 = require("@colijnit/ioneconnector/build/factory/decorators/no-db-field.decorator");
|
|
18
|
+
const workflow_trigger_type_enum_1 = require("../enum/workflow-trigger-type.enum");
|
|
19
|
+
class Workflow extends business_object_1.BusinessObject {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.manualTriggers = [];
|
|
23
|
+
this.manualGenericTriggers = [];
|
|
24
|
+
this.useSingleTaskTriggerAsTask = false;
|
|
25
|
+
}
|
|
26
|
+
get workFlowHasOneTaskTrigger() {
|
|
27
|
+
return this.useSingleTaskTriggerAsTask && this.manualTriggers.length === 1 &&
|
|
28
|
+
this.manualTriggers.find(t => t.triggerType === workflow_trigger_type_enum_1.WorkflowTriggerType.Task) !== undefined;
|
|
29
|
+
}
|
|
30
|
+
get hasTriggers() {
|
|
31
|
+
return ((this.manualTriggers && this.manualTriggers.length > 0) ||
|
|
32
|
+
(this.manualGenericTriggers && this.manualGenericTriggers.length > 0)) &&
|
|
33
|
+
!this.workFlowHasOneTaskTrigger;
|
|
34
|
+
}
|
|
35
|
+
get linkLabel() {
|
|
36
|
+
if (this.workFlowHasOneTaskTrigger) {
|
|
37
|
+
return "OPEN_TASK";
|
|
38
|
+
}
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
get taskIdFromTaskTrigger() {
|
|
42
|
+
return this.manualTriggers.find(t => t.triggerType === workflow_trigger_type_enum_1.WorkflowTriggerType.Task).taskId;
|
|
43
|
+
}
|
|
44
|
+
get name() {
|
|
45
|
+
if (this.workFlowHasOneTaskTrigger) {
|
|
46
|
+
return this.manualTriggers.find(t => t.triggerType === workflow_trigger_type_enum_1.WorkflowTriggerType.Task).name;
|
|
47
|
+
}
|
|
48
|
+
return this.workflowName;
|
|
49
|
+
}
|
|
50
|
+
get description() {
|
|
51
|
+
if (this.workFlowHasOneTaskTrigger) {
|
|
52
|
+
return this.manualTriggers.find(t => t.triggerType === workflow_trigger_type_enum_1.WorkflowTriggerType.Task).description;
|
|
53
|
+
}
|
|
54
|
+
return this.state;
|
|
55
|
+
}
|
|
56
|
+
get urls() {
|
|
57
|
+
const result = [];
|
|
58
|
+
if (this.manualTriggers) {
|
|
59
|
+
for (const trigger of this.manualTriggers) {
|
|
60
|
+
if (trigger.url) {
|
|
61
|
+
result.push(trigger.url);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
get overDue() {
|
|
68
|
+
const len = this.manualTriggers.length;
|
|
69
|
+
for (let i = 0; i < len; i++) {
|
|
70
|
+
if (this.manualTriggers[i].overDue) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
get combinedTriggerIds() {
|
|
77
|
+
return this.manualTriggers.map(t => t.triggerId).join('_');
|
|
78
|
+
}
|
|
79
|
+
getId() {
|
|
80
|
+
return this.workflowProcessId;
|
|
81
|
+
}
|
|
82
|
+
setId(value) {
|
|
83
|
+
this.workflowProcessId = value;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
__decorate([
|
|
87
|
+
boolean_decorator_1.BooleanText("T"),
|
|
88
|
+
__metadata("design:type", Boolean)
|
|
89
|
+
], Workflow.prototype, "closed", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
boolean_decorator_1.BooleanText("T"),
|
|
92
|
+
__metadata("design:type", Boolean)
|
|
93
|
+
], Workflow.prototype, "ended", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
boolean_decorator_1.BooleanText("T"),
|
|
96
|
+
__metadata("design:type", Boolean)
|
|
97
|
+
], Workflow.prototype, "beginState", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
complex_array_decorator_1.ComplexArray(workflow_trigger_bo_1.WorkflowTrigger),
|
|
100
|
+
__metadata("design:type", Array)
|
|
101
|
+
], Workflow.prototype, "manualTriggers", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
no_db_field_decorator_1.NoDbField(),
|
|
104
|
+
__metadata("design:type", Boolean)
|
|
105
|
+
], Workflow.prototype, "useSingleTaskTriggerAsTask", void 0);
|
|
106
|
+
__decorate([
|
|
107
|
+
no_db_field_decorator_1.NoDbField(),
|
|
108
|
+
__metadata("design:type", Boolean),
|
|
109
|
+
__metadata("design:paramtypes", [])
|
|
110
|
+
], Workflow.prototype, "workFlowHasOneTaskTrigger", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
no_db_field_decorator_1.NoDbField(),
|
|
113
|
+
__metadata("design:type", Boolean),
|
|
114
|
+
__metadata("design:paramtypes", [])
|
|
115
|
+
], Workflow.prototype, "hasTriggers", null);
|
|
116
|
+
__decorate([
|
|
117
|
+
no_db_field_decorator_1.NoDbField(),
|
|
118
|
+
__metadata("design:type", String),
|
|
119
|
+
__metadata("design:paramtypes", [])
|
|
120
|
+
], Workflow.prototype, "linkLabel", null);
|
|
121
|
+
__decorate([
|
|
122
|
+
no_db_field_decorator_1.NoDbField(),
|
|
123
|
+
__metadata("design:type", Number),
|
|
124
|
+
__metadata("design:paramtypes", [])
|
|
125
|
+
], Workflow.prototype, "taskIdFromTaskTrigger", null);
|
|
126
|
+
__decorate([
|
|
127
|
+
no_db_field_decorator_1.NoDbField(),
|
|
128
|
+
__metadata("design:type", String),
|
|
129
|
+
__metadata("design:paramtypes", [])
|
|
130
|
+
], Workflow.prototype, "name", null);
|
|
131
|
+
__decorate([
|
|
132
|
+
no_db_field_decorator_1.NoDbField(),
|
|
133
|
+
__metadata("design:type", String),
|
|
134
|
+
__metadata("design:paramtypes", [])
|
|
135
|
+
], Workflow.prototype, "description", null);
|
|
136
|
+
__decorate([
|
|
137
|
+
no_db_field_decorator_1.NoDbField(),
|
|
138
|
+
__metadata("design:type", Array),
|
|
139
|
+
__metadata("design:paramtypes", [])
|
|
140
|
+
], Workflow.prototype, "urls", null);
|
|
141
|
+
__decorate([
|
|
142
|
+
no_db_field_decorator_1.NoDbField(),
|
|
143
|
+
__metadata("design:type", Boolean),
|
|
144
|
+
__metadata("design:paramtypes", [])
|
|
145
|
+
], Workflow.prototype, "overDue", null);
|
|
146
|
+
__decorate([
|
|
147
|
+
no_db_field_decorator_1.NoDbField(),
|
|
148
|
+
__metadata("design:type", String),
|
|
149
|
+
__metadata("design:paramtypes", [])
|
|
150
|
+
], Workflow.prototype, "combinedTriggerIds", null);
|
|
151
|
+
exports.Workflow = Workflow;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare class CssUtils {
|
|
2
|
-
static AnimateMaxWidthTransitionOn(nativeElement: any, transitionTime?: number, startWidth?: string, endWidth?: string): Promise<void>;
|
|
3
|
-
static AnimateMaxHeightTransitionOn(nativeElement: any, transitionTime?: number, startHeight?: string, endHeight?: string): Promise<void>;
|
|
4
|
-
static FindOffsetWidthOfElementWithTransition(nativeElement: any): string;
|
|
5
|
-
static FindOffsetHeightOfElementWithTransition(nativeElement: any): string;
|
|
6
|
-
static GetComputedStyleVal(nativeElement: any, styleName: string): any;
|
|
7
|
-
static ElementHasStyle(nativeElement: any, styleName: string, styleValue: string): boolean;
|
|
8
|
-
static SetStyleOnElement(nativeElement: any, styleName: string, styleValue: string, pushChanges?: boolean): void;
|
|
9
|
-
static HideElement(nativeElement: any): void;
|
|
10
|
-
static GetStyleValue(nativeElement: any, styleName: string): any;
|
|
11
|
-
static DbRgbColorStringToCssRgbColor(dbRgbColorStr: string): string;
|
|
12
|
-
static PushCssChanges(nativeElement: any): void;
|
|
13
|
-
static TransparentColor(hexColor: string, opacity: number): string;
|
|
14
|
-
static ElementHasClass(element: Element, cssClass: string): boolean;
|
|
15
|
-
private static _FindOffsetHeightOrWidthOfElementWithTransition;
|
|
16
|
-
private static _AddTransitionStyleOn;
|
|
17
|
-
private static _returnPromise;
|
|
18
|
-
}
|
|
1
|
+
export declare class CssUtils {
|
|
2
|
+
static AnimateMaxWidthTransitionOn(nativeElement: any, transitionTime?: number, startWidth?: string, endWidth?: string): Promise<void>;
|
|
3
|
+
static AnimateMaxHeightTransitionOn(nativeElement: any, transitionTime?: number, startHeight?: string, endHeight?: string): Promise<void>;
|
|
4
|
+
static FindOffsetWidthOfElementWithTransition(nativeElement: any): string;
|
|
5
|
+
static FindOffsetHeightOfElementWithTransition(nativeElement: any): string;
|
|
6
|
+
static GetComputedStyleVal(nativeElement: any, styleName: string): any;
|
|
7
|
+
static ElementHasStyle(nativeElement: any, styleName: string, styleValue: string): boolean;
|
|
8
|
+
static SetStyleOnElement(nativeElement: any, styleName: string, styleValue: string, pushChanges?: boolean): void;
|
|
9
|
+
static HideElement(nativeElement: any): void;
|
|
10
|
+
static GetStyleValue(nativeElement: any, styleName: string): any;
|
|
11
|
+
static DbRgbColorStringToCssRgbColor(dbRgbColorStr: string): string;
|
|
12
|
+
static PushCssChanges(nativeElement: any): void;
|
|
13
|
+
static TransparentColor(hexColor: string, opacity: number): string;
|
|
14
|
+
static ElementHasClass(element: Element, cssClass: string): boolean;
|
|
15
|
+
private static _FindOffsetHeightOrWidthOfElementWithTransition;
|
|
16
|
+
private static _AddTransitionStyleOn;
|
|
17
|
+
private static _returnPromise;
|
|
18
|
+
}
|
package/build/utils/css-utils.js
CHANGED
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CssUtils = void 0;
|
|
4
|
-
class CssUtils {
|
|
5
|
-
static AnimateMaxWidthTransitionOn(nativeElement, transitionTime = 0.2, startWidth = "0px", endWidth) {
|
|
6
|
-
if (!nativeElement) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (!endWidth) {
|
|
10
|
-
endWidth = CssUtils.FindOffsetWidthOfElementWithTransition(nativeElement);
|
|
11
|
-
}
|
|
12
|
-
const transitionStyle = `max-width ${transitionTime}s ease-out`;
|
|
13
|
-
if (!CssUtils.ElementHasStyle(nativeElement, "transition", transitionStyle)) {
|
|
14
|
-
CssUtils._AddTransitionStyleOn(nativeElement, transitionStyle);
|
|
15
|
-
}
|
|
16
|
-
nativeElement.style.maxWidth = startWidth;
|
|
17
|
-
CssUtils.PushCssChanges(nativeElement);
|
|
18
|
-
nativeElement.style.maxWidth = endWidth;
|
|
19
|
-
return this._returnPromise(transitionTime);
|
|
20
|
-
}
|
|
21
|
-
static AnimateMaxHeightTransitionOn(nativeElement, transitionTime = 0.2, startHeight = "0px", endHeight) {
|
|
22
|
-
if (!nativeElement) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (!endHeight) {
|
|
26
|
-
endHeight = CssUtils.FindOffsetHeightOfElementWithTransition(nativeElement);
|
|
27
|
-
}
|
|
28
|
-
const transitionStyle = `max-height ${transitionTime}s ease-out`;
|
|
29
|
-
if (!CssUtils.ElementHasStyle(nativeElement, "transition", transitionStyle)) {
|
|
30
|
-
CssUtils._AddTransitionStyleOn(nativeElement, transitionStyle);
|
|
31
|
-
}
|
|
32
|
-
nativeElement.style.maxHeight = startHeight;
|
|
33
|
-
CssUtils.PushCssChanges(nativeElement);
|
|
34
|
-
nativeElement.style.maxHeight = endHeight;
|
|
35
|
-
return this._returnPromise(transitionTime);
|
|
36
|
-
}
|
|
37
|
-
static FindOffsetWidthOfElementWithTransition(nativeElement) {
|
|
38
|
-
return this._FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, false);
|
|
39
|
-
}
|
|
40
|
-
static FindOffsetHeightOfElementWithTransition(nativeElement) {
|
|
41
|
-
return this._FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, true);
|
|
42
|
-
}
|
|
43
|
-
static GetComputedStyleVal(nativeElement, styleName) {
|
|
44
|
-
return document.defaultView.getComputedStyle(nativeElement, "").getPropertyValue("styleName");
|
|
45
|
-
}
|
|
46
|
-
static ElementHasStyle(nativeElement, styleName, styleValue) {
|
|
47
|
-
if (!nativeElement || !styleName) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
return (nativeElement.style[styleName] === styleValue);
|
|
51
|
-
}
|
|
52
|
-
static SetStyleOnElement(nativeElement, styleName, styleValue, pushChanges = false) {
|
|
53
|
-
if (!nativeElement || !styleName) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
nativeElement.style[styleName] = styleValue;
|
|
57
|
-
if (pushChanges) {
|
|
58
|
-
CssUtils.PushCssChanges(nativeElement);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
static HideElement(nativeElement) {
|
|
62
|
-
if (nativeElement) {
|
|
63
|
-
CssUtils.SetStyleOnElement(nativeElement, "display", "none");
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
static GetStyleValue(nativeElement, styleName) {
|
|
67
|
-
if (!nativeElement || !styleName) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
return nativeElement.style[styleName];
|
|
71
|
-
}
|
|
72
|
-
static DbRgbColorStringToCssRgbColor(dbRgbColorStr) {
|
|
73
|
-
if (!dbRgbColorStr || dbRgbColorStr.length === 0) {
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
dbRgbColorStr = dbRgbColorStr.split("0x")[1];
|
|
77
|
-
if (!dbRgbColorStr) {
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
const strLen = dbRgbColorStr.length;
|
|
81
|
-
if (strLen > 6) {
|
|
82
|
-
dbRgbColorStr = dbRgbColorStr.slice(0, 6);
|
|
83
|
-
}
|
|
84
|
-
else if (strLen > 3 && strLen < 6) {
|
|
85
|
-
dbRgbColorStr = dbRgbColorStr.slice(0, 3);
|
|
86
|
-
}
|
|
87
|
-
else if (strLen === 1) {
|
|
88
|
-
dbRgbColorStr += dbRgbColorStr + dbRgbColorStr;
|
|
89
|
-
}
|
|
90
|
-
else if (strLen === 2) {
|
|
91
|
-
dbRgbColorStr += dbRgbColorStr[1];
|
|
92
|
-
}
|
|
93
|
-
return "#" + dbRgbColorStr;
|
|
94
|
-
}
|
|
95
|
-
static PushCssChanges(nativeElement) {
|
|
96
|
-
const notUnused = nativeElement.offsetHeight;
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
static TransparentColor(hexColor, opacity) {
|
|
100
|
-
const hex = hexColor.replace("#", "");
|
|
101
|
-
return `rgba(${Array.from({ length: 3 }, (v, i) => parseInt(hex.substring(i * 2, (i + 1) * 2), 16)).join(",")},${opacity})`;
|
|
102
|
-
}
|
|
103
|
-
static ElementHasClass(element, cssClass) {
|
|
104
|
-
return element && element.classList && element.classList.contains(cssClass);
|
|
105
|
-
}
|
|
106
|
-
static _FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, wantHeight) {
|
|
107
|
-
if (!nativeElement) {
|
|
108
|
-
return "0px";
|
|
109
|
-
}
|
|
110
|
-
const originalTransitionStyle = nativeElement.style.transition;
|
|
111
|
-
CssUtils._AddTransitionStyleOn(nativeElement, "none");
|
|
112
|
-
if (wantHeight) {
|
|
113
|
-
nativeElement.style.maxHeight = "";
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
nativeElement.style.maxWidth = "";
|
|
117
|
-
}
|
|
118
|
-
let trueHeightOrWidth;
|
|
119
|
-
if (wantHeight) {
|
|
120
|
-
trueHeightOrWidth = nativeElement.offsetHeight;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
trueHeightOrWidth = nativeElement.offsetWidth;
|
|
124
|
-
}
|
|
125
|
-
trueHeightOrWidth += "px";
|
|
126
|
-
nativeElement.style.transition = originalTransitionStyle;
|
|
127
|
-
return trueHeightOrWidth;
|
|
128
|
-
}
|
|
129
|
-
static _AddTransitionStyleOn(nativeElement, styleText) {
|
|
130
|
-
if (!nativeElement || !styleText) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (nativeElement.style.transition) {
|
|
134
|
-
styleText = ", " + styleText;
|
|
135
|
-
}
|
|
136
|
-
nativeElement.style.transition += styleText;
|
|
137
|
-
nativeElement.style.WebkitTransition += styleText;
|
|
138
|
-
nativeElement.style.MozTransition += styleText;
|
|
139
|
-
}
|
|
140
|
-
static _returnPromise(transitionTime) {
|
|
141
|
-
return new Promise((resolve) => {
|
|
142
|
-
setTimeout(() => {
|
|
143
|
-
resolve();
|
|
144
|
-
}, transitionTime * 1000);
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
exports.CssUtils = CssUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CssUtils = void 0;
|
|
4
|
+
class CssUtils {
|
|
5
|
+
static AnimateMaxWidthTransitionOn(nativeElement, transitionTime = 0.2, startWidth = "0px", endWidth) {
|
|
6
|
+
if (!nativeElement) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (!endWidth) {
|
|
10
|
+
endWidth = CssUtils.FindOffsetWidthOfElementWithTransition(nativeElement);
|
|
11
|
+
}
|
|
12
|
+
const transitionStyle = `max-width ${transitionTime}s ease-out`;
|
|
13
|
+
if (!CssUtils.ElementHasStyle(nativeElement, "transition", transitionStyle)) {
|
|
14
|
+
CssUtils._AddTransitionStyleOn(nativeElement, transitionStyle);
|
|
15
|
+
}
|
|
16
|
+
nativeElement.style.maxWidth = startWidth;
|
|
17
|
+
CssUtils.PushCssChanges(nativeElement);
|
|
18
|
+
nativeElement.style.maxWidth = endWidth;
|
|
19
|
+
return this._returnPromise(transitionTime);
|
|
20
|
+
}
|
|
21
|
+
static AnimateMaxHeightTransitionOn(nativeElement, transitionTime = 0.2, startHeight = "0px", endHeight) {
|
|
22
|
+
if (!nativeElement) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (!endHeight) {
|
|
26
|
+
endHeight = CssUtils.FindOffsetHeightOfElementWithTransition(nativeElement);
|
|
27
|
+
}
|
|
28
|
+
const transitionStyle = `max-height ${transitionTime}s ease-out`;
|
|
29
|
+
if (!CssUtils.ElementHasStyle(nativeElement, "transition", transitionStyle)) {
|
|
30
|
+
CssUtils._AddTransitionStyleOn(nativeElement, transitionStyle);
|
|
31
|
+
}
|
|
32
|
+
nativeElement.style.maxHeight = startHeight;
|
|
33
|
+
CssUtils.PushCssChanges(nativeElement);
|
|
34
|
+
nativeElement.style.maxHeight = endHeight;
|
|
35
|
+
return this._returnPromise(transitionTime);
|
|
36
|
+
}
|
|
37
|
+
static FindOffsetWidthOfElementWithTransition(nativeElement) {
|
|
38
|
+
return this._FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, false);
|
|
39
|
+
}
|
|
40
|
+
static FindOffsetHeightOfElementWithTransition(nativeElement) {
|
|
41
|
+
return this._FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, true);
|
|
42
|
+
}
|
|
43
|
+
static GetComputedStyleVal(nativeElement, styleName) {
|
|
44
|
+
return document.defaultView.getComputedStyle(nativeElement, "").getPropertyValue("styleName");
|
|
45
|
+
}
|
|
46
|
+
static ElementHasStyle(nativeElement, styleName, styleValue) {
|
|
47
|
+
if (!nativeElement || !styleName) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return (nativeElement.style[styleName] === styleValue);
|
|
51
|
+
}
|
|
52
|
+
static SetStyleOnElement(nativeElement, styleName, styleValue, pushChanges = false) {
|
|
53
|
+
if (!nativeElement || !styleName) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
nativeElement.style[styleName] = styleValue;
|
|
57
|
+
if (pushChanges) {
|
|
58
|
+
CssUtils.PushCssChanges(nativeElement);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static HideElement(nativeElement) {
|
|
62
|
+
if (nativeElement) {
|
|
63
|
+
CssUtils.SetStyleOnElement(nativeElement, "display", "none");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
static GetStyleValue(nativeElement, styleName) {
|
|
67
|
+
if (!nativeElement || !styleName) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
return nativeElement.style[styleName];
|
|
71
|
+
}
|
|
72
|
+
static DbRgbColorStringToCssRgbColor(dbRgbColorStr) {
|
|
73
|
+
if (!dbRgbColorStr || dbRgbColorStr.length === 0) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
dbRgbColorStr = dbRgbColorStr.split("0x")[1];
|
|
77
|
+
if (!dbRgbColorStr) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const strLen = dbRgbColorStr.length;
|
|
81
|
+
if (strLen > 6) {
|
|
82
|
+
dbRgbColorStr = dbRgbColorStr.slice(0, 6);
|
|
83
|
+
}
|
|
84
|
+
else if (strLen > 3 && strLen < 6) {
|
|
85
|
+
dbRgbColorStr = dbRgbColorStr.slice(0, 3);
|
|
86
|
+
}
|
|
87
|
+
else if (strLen === 1) {
|
|
88
|
+
dbRgbColorStr += dbRgbColorStr + dbRgbColorStr;
|
|
89
|
+
}
|
|
90
|
+
else if (strLen === 2) {
|
|
91
|
+
dbRgbColorStr += dbRgbColorStr[1];
|
|
92
|
+
}
|
|
93
|
+
return "#" + dbRgbColorStr;
|
|
94
|
+
}
|
|
95
|
+
static PushCssChanges(nativeElement) {
|
|
96
|
+
const notUnused = nativeElement.offsetHeight;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
static TransparentColor(hexColor, opacity) {
|
|
100
|
+
const hex = hexColor.replace("#", "");
|
|
101
|
+
return `rgba(${Array.from({ length: 3 }, (v, i) => parseInt(hex.substring(i * 2, (i + 1) * 2), 16)).join(",")},${opacity})`;
|
|
102
|
+
}
|
|
103
|
+
static ElementHasClass(element, cssClass) {
|
|
104
|
+
return element && element.classList && element.classList.contains(cssClass);
|
|
105
|
+
}
|
|
106
|
+
static _FindOffsetHeightOrWidthOfElementWithTransition(nativeElement, wantHeight) {
|
|
107
|
+
if (!nativeElement) {
|
|
108
|
+
return "0px";
|
|
109
|
+
}
|
|
110
|
+
const originalTransitionStyle = nativeElement.style.transition;
|
|
111
|
+
CssUtils._AddTransitionStyleOn(nativeElement, "none");
|
|
112
|
+
if (wantHeight) {
|
|
113
|
+
nativeElement.style.maxHeight = "";
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
nativeElement.style.maxWidth = "";
|
|
117
|
+
}
|
|
118
|
+
let trueHeightOrWidth;
|
|
119
|
+
if (wantHeight) {
|
|
120
|
+
trueHeightOrWidth = nativeElement.offsetHeight;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
trueHeightOrWidth = nativeElement.offsetWidth;
|
|
124
|
+
}
|
|
125
|
+
trueHeightOrWidth += "px";
|
|
126
|
+
nativeElement.style.transition = originalTransitionStyle;
|
|
127
|
+
return trueHeightOrWidth;
|
|
128
|
+
}
|
|
129
|
+
static _AddTransitionStyleOn(nativeElement, styleText) {
|
|
130
|
+
if (!nativeElement || !styleText) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (nativeElement.style.transition) {
|
|
134
|
+
styleText = ", " + styleText;
|
|
135
|
+
}
|
|
136
|
+
nativeElement.style.transition += styleText;
|
|
137
|
+
nativeElement.style.WebkitTransition += styleText;
|
|
138
|
+
nativeElement.style.MozTransition += styleText;
|
|
139
|
+
}
|
|
140
|
+
static _returnPromise(transitionTime) {
|
|
141
|
+
return new Promise((resolve) => {
|
|
142
|
+
setTimeout(() => {
|
|
143
|
+
resolve();
|
|
144
|
+
}, transitionTime * 1000);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.CssUtils = CssUtils;
|