@jooler/inputs 0.0.52 → 0.0.54
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/esm2022/lib/choose-enum/choose-enum.component.mjs +2 -2
- package/esm2022/lib/choose-general-item/choose-general-item.component.mjs +222 -45
- package/esm2022/lib/choose-general-item/choose-general-item.service.mjs +24 -3
- package/esm2022/lib/choose-general-item/choose-object-basic-template-label-field.enum.mjs +7 -0
- package/esm2022/lib/choose-general-item/choose-object-basic-template.model.mjs +67 -0
- package/esm2022/lib/choose-general-item/choose-object-template-type.enum.mjs +7 -0
- package/esm2022/lib/choose-general-item-renderer/choose-general-item-renderer.component.mjs +3 -3
- package/esm2022/lib/custom-colors/bom-production-type.enum.mjs +11 -0
- package/esm2022/lib/custom-colors/enum-custom-color-mapping.mjs +32 -0
- package/esm2022/lib/custom-colors/enum-custom-colors.mjs +21 -0
- package/esm2022/lib/custom-colors/sales-order-status.enum.mjs +27 -0
- package/esm2022/lib/custom-theme.mjs +104 -0
- package/esm2022/lib/dictionary-to-params-converter.mjs +15 -0
- package/esm2022/lib/enum-custom-label-mapping.mjs +32 -0
- package/esm2022/lib/enum-helper-functions.mjs +85 -0
- package/esm2022/lib/enum-models/bill-status.model.mjs +25 -0
- package/esm2022/lib/enum-models/charge-level.enum.mjs +6 -0
- package/esm2022/lib/enum-models/custom-order-request-status.enum.mjs +29 -0
- package/esm2022/lib/enum-models/invitation-status.model.mjs +15 -0
- package/esm2022/lib/enum-models/invoice-status.model.mjs +15 -0
- package/esm2022/lib/enum-models/locker-transfer-status.enum.mjs +11 -0
- package/esm2022/lib/enum-models/priority.model.mjs +13 -0
- package/esm2022/lib/enum-models/quotation-status.model.mjs +19 -0
- package/esm2022/lib/enum-models/request-status.model.mjs +15 -0
- package/esm2022/lib/enum-string-class-map.mjs +26 -0
- package/esm2022/lib/json/enum-custom-label-mappings.json +10 -0
- package/esm2022/lib/models/choose-item-full-object-control-config.enum.mjs +6 -0
- package/esm2022/lib/primary-colors.mjs +9 -1
- package/fesm2022/inputs.mjs +844 -137
- package/fesm2022/inputs.mjs.map +1 -1
- package/lib/choose-general-item/choose-general-item.component.d.ts +44 -15
- package/lib/choose-general-item/choose-general-item.service.d.ts +5 -1
- package/lib/choose-general-item/choose-object-basic-template-label-field.enum.d.ts +5 -0
- package/lib/choose-general-item/choose-object-basic-template.model.d.ts +15 -0
- package/lib/choose-general-item/choose-object-template-type.enum.d.ts +5 -0
- package/lib/custom-colors/bom-production-type.enum.d.ts +5 -0
- package/lib/custom-colors/enum-custom-color-mapping.d.ts +11 -0
- package/lib/custom-colors/enum-custom-colors.d.ts +2 -0
- package/lib/custom-colors/sales-order-status.enum.d.ts +13 -0
- package/lib/custom-theme.d.ts +8 -0
- package/lib/dictionary-to-params-converter.d.ts +4 -0
- package/lib/enum-custom-label-mapping.d.ts +7 -0
- package/lib/enum-helper-functions.d.ts +7 -0
- package/lib/enum-models/bill-status.model.d.ts +12 -0
- package/lib/enum-models/charge-level.enum.d.ts +4 -0
- package/lib/enum-models/custom-order-request-status.enum.d.ts +14 -0
- package/lib/enum-models/invitation-status.model.d.ts +7 -0
- package/lib/enum-models/invoice-status.model.d.ts +13 -0
- package/lib/enum-models/locker-transfer-status.enum.d.ts +5 -0
- package/lib/enum-models/priority.model.d.ts +6 -0
- package/lib/enum-models/quotation-status.model.d.ts +9 -0
- package/lib/enum-models/request-status.model.d.ts +7 -0
- package/lib/enum-string-class-map.d.ts +3 -0
- package/lib/models/choose-item-full-object-control-config.enum.d.ts +4 -0
- package/lib/primary-colors.d.ts +8 -0
- package/package.json +1 -1
package/fesm2022/inputs.mjs
CHANGED
|
@@ -1,21 +1,523 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, forwardRef, Component, Input, Output, Injectable, Inject, Pipe, Directive, HostListener, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, forwardRef, Component, Input, Output, Injectable, Inject, ContentChild, Pipe, Directive, HostListener, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2$1 from '@angular/forms';
|
|
4
|
-
import { NG_VALUE_ACCESSOR, NgModel, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import * as i4 from '@jooler/shared-general-components';
|
|
6
|
-
import { EnumHelperBaseClass, SharedGeneralComponentsModule } from '@jooler/shared-general-components';
|
|
4
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgModel, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
7
5
|
import * as i1 from '@angular/common';
|
|
8
6
|
import { CurrencyPipe, DecimalPipe, CommonModule } from '@angular/common';
|
|
9
7
|
import * as i2 from '@ng-select/ng-select';
|
|
10
8
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
9
|
+
import * as i4 from '@jooler/shared-general-components';
|
|
10
|
+
import { ChipInputType, SharedGeneralComponentsModule } from '@jooler/shared-general-components';
|
|
11
11
|
import * as i2$2 from '@fortawesome/angular-fontawesome';
|
|
12
12
|
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
13
13
|
import * as i1$1 from '@angular/common/http';
|
|
14
|
-
import { HttpHeaders } from '@angular/common/http';
|
|
15
|
-
import * as
|
|
16
|
-
import
|
|
14
|
+
import { HttpParams, HttpHeaders } from '@angular/common/http';
|
|
15
|
+
import * as i2$3 from '@angular/material/dialog';
|
|
16
|
+
import * as i6 from '@angular/material/card';
|
|
17
17
|
import * as i1$2 from '@angular/router';
|
|
18
|
-
import * as i3
|
|
18
|
+
import * as i3 from '@angular/material/menu';
|
|
19
|
+
import * as i3$1 from '@angular/material/button';
|
|
20
|
+
import { AppMaterialModule } from '@jooler/app-material';
|
|
21
|
+
|
|
22
|
+
class PrimaryColors {
|
|
23
|
+
static $primaryBlueColor = '#155ED4';
|
|
24
|
+
static $primaryPinkColor = '#F0509C';
|
|
25
|
+
static $primaryTealColor = '#12957E';
|
|
26
|
+
static $primaryCarbonColor = '#32353B';
|
|
27
|
+
static $primaryGrayColor = '#676767';
|
|
28
|
+
static $primaryPurpleColor = '#E3B1EB';
|
|
29
|
+
static $primaryRedColor = '#A80002';
|
|
30
|
+
static $primaryLightRedColor = '#FFDBDB';
|
|
31
|
+
static $primaryLightGrayBlueColor = '#f7f8f9';
|
|
32
|
+
static $primaryLightGrayColor = '#f0f0f0';
|
|
33
|
+
static $primaryLightBlueColor = '#b9cff2';
|
|
34
|
+
static $primaryYellowColor = '#F2CD5C';
|
|
35
|
+
static $primaryOrangeColor = '#F2921D';
|
|
36
|
+
static $primaryLimeGreenColor = '#AFFF00';
|
|
37
|
+
static $primaryNavyBlueColor = '#000080';
|
|
38
|
+
static $primaryOrangeRedColor = '#FF4500';
|
|
39
|
+
static $primaryDarkPurpleColor = '#7600BC';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var BOMProductionType;
|
|
43
|
+
(function (BOMProductionType) {
|
|
44
|
+
BOMProductionType[BOMProductionType["MANUFACTURED_IN_HOUSE"] = 0] = "MANUFACTURED_IN_HOUSE";
|
|
45
|
+
BOMProductionType[BOMProductionType["PARTIALLY_MANUFACTURED_IN_HOUSE"] = 1] = "PARTIALLY_MANUFACTURED_IN_HOUSE";
|
|
46
|
+
})(BOMProductionType || (BOMProductionType = {}));
|
|
47
|
+
const bomProductionTypeColors = Object.values({
|
|
48
|
+
[BOMProductionType.MANUFACTURED_IN_HOUSE]: PrimaryColors.$primaryLimeGreenColor,
|
|
49
|
+
[BOMProductionType.PARTIALLY_MANUFACTURED_IN_HOUSE]: PrimaryColors.$primaryBlueColor,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
var SalesOrderStatus;
|
|
53
|
+
(function (SalesOrderStatus) {
|
|
54
|
+
SalesOrderStatus[SalesOrderStatus["DRAFT"] = 0] = "DRAFT";
|
|
55
|
+
SalesOrderStatus[SalesOrderStatus["PENDING_APPROVAL"] = 1] = "PENDING_APPROVAL";
|
|
56
|
+
SalesOrderStatus[SalesOrderStatus["APPROVED"] = 2] = "APPROVED";
|
|
57
|
+
SalesOrderStatus[SalesOrderStatus["TO_DELIVER_AND_TO_BILL"] = 3] = "TO_DELIVER_AND_TO_BILL";
|
|
58
|
+
SalesOrderStatus[SalesOrderStatus["TO_BILL"] = 4] = "TO_BILL";
|
|
59
|
+
SalesOrderStatus[SalesOrderStatus["PARTIALLY_DELIVERED_AND_PARTIALLY_BILLED"] = 5] = "PARTIALLY_DELIVERED_AND_PARTIALLY_BILLED";
|
|
60
|
+
SalesOrderStatus[SalesOrderStatus["PARTIALLY_DELIVERED_AND_TO_BILL"] = 6] = "PARTIALLY_DELIVERED_AND_TO_BILL";
|
|
61
|
+
SalesOrderStatus[SalesOrderStatus["COMPLETED"] = 7] = "COMPLETED";
|
|
62
|
+
SalesOrderStatus[SalesOrderStatus["CANCELED"] = 8] = "CANCELED";
|
|
63
|
+
SalesOrderStatus[SalesOrderStatus["CLOSED"] = 9] = "CLOSED";
|
|
64
|
+
})(SalesOrderStatus || (SalesOrderStatus = {}));
|
|
65
|
+
const salesOrderStatusColors = Object.values({
|
|
66
|
+
[SalesOrderStatus.DRAFT]: PrimaryColors.$primaryBlueColor,
|
|
67
|
+
[SalesOrderStatus.PENDING_APPROVAL]: PrimaryColors.$primaryYellowColor,
|
|
68
|
+
[SalesOrderStatus.APPROVED]: PrimaryColors.$primaryTealColor,
|
|
69
|
+
[SalesOrderStatus.TO_DELIVER_AND_TO_BILL]: PrimaryColors.$primaryPurpleColor,
|
|
70
|
+
[SalesOrderStatus.TO_BILL]: PrimaryColors.$primaryPinkColor,
|
|
71
|
+
[SalesOrderStatus.PARTIALLY_DELIVERED_AND_PARTIALLY_BILLED]: PrimaryColors.$primaryOrangeColor,
|
|
72
|
+
[SalesOrderStatus.PARTIALLY_DELIVERED_AND_TO_BILL]: PrimaryColors.$primaryNavyBlueColor,
|
|
73
|
+
[SalesOrderStatus.COMPLETED]: PrimaryColors.$primaryLimeGreenColor,
|
|
74
|
+
[SalesOrderStatus.CANCELED]: PrimaryColors.$primaryGrayColor,
|
|
75
|
+
[SalesOrderStatus.CLOSED]: PrimaryColors.$primaryCarbonColor,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
var BillStatus;
|
|
79
|
+
(function (BillStatus) {
|
|
80
|
+
BillStatus[BillStatus["DRAFT"] = 0] = "DRAFT";
|
|
81
|
+
BillStatus[BillStatus["RECEIVED"] = 1] = "RECEIVED";
|
|
82
|
+
BillStatus[BillStatus["PAID"] = 2] = "PAID";
|
|
83
|
+
BillStatus[BillStatus["CANCELLED"] = 3] = "CANCELLED";
|
|
84
|
+
BillStatus[BillStatus["RETURN"] = 4] = "RETURN";
|
|
85
|
+
BillStatus[BillStatus["DEBIT_NOTE_ISSUED"] = 5] = "DEBIT_NOTE_ISSUED";
|
|
86
|
+
BillStatus[BillStatus["PARTLY_PAID"] = 6] = "PARTLY_PAID";
|
|
87
|
+
BillStatus[BillStatus["UNPAID"] = 7] = "UNPAID";
|
|
88
|
+
BillStatus[BillStatus["OVERDUE"] = 8] = "OVERDUE";
|
|
89
|
+
})(BillStatus || (BillStatus = {}));
|
|
90
|
+
const billStatusColors = Object.values({
|
|
91
|
+
[BillStatus.DRAFT]: PrimaryColors.$primaryBlueColor,
|
|
92
|
+
[BillStatus.RECEIVED]: PrimaryColors.$primaryTealColor,
|
|
93
|
+
[BillStatus.PAID]: PrimaryColors.$primaryPurpleColor,
|
|
94
|
+
[BillStatus.CANCELLED]: PrimaryColors.$primaryGrayColor,
|
|
95
|
+
[BillStatus.RETURN]: PrimaryColors.$primaryPinkColor,
|
|
96
|
+
[BillStatus.DEBIT_NOTE_ISSUED]: PrimaryColors.$primaryNavyBlueColor,
|
|
97
|
+
[BillStatus.PARTLY_PAID]: PrimaryColors.$primaryYellowColor,
|
|
98
|
+
[BillStatus.UNPAID]: PrimaryColors.$primaryRedColor,
|
|
99
|
+
[BillStatus.OVERDUE]: PrimaryColors.$primaryOrangeColor,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
var ChargeLevel;
|
|
103
|
+
(function (ChargeLevel) {
|
|
104
|
+
ChargeLevel[ChargeLevel["MAIN"] = 0] = "MAIN";
|
|
105
|
+
ChargeLevel[ChargeLevel["LINE"] = 1] = "LINE";
|
|
106
|
+
})(ChargeLevel || (ChargeLevel = {}));
|
|
107
|
+
|
|
108
|
+
var CustomOrderRequestStatus;
|
|
109
|
+
(function (CustomOrderRequestStatus) {
|
|
110
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["DRAFT"] = 0] = "DRAFT";
|
|
111
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["SENT"] = 1] = "SENT";
|
|
112
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["RESPONDED"] = 2] = "RESPONDED";
|
|
113
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["REJECTED"] = 3] = "REJECTED";
|
|
114
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["CANCELED"] = 4] = "CANCELED";
|
|
115
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["DECLINED"] = 5] = "DECLINED";
|
|
116
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["ACCEPTED"] = 6] = "ACCEPTED";
|
|
117
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["ORDER_CONFIRMED"] = 7] = "ORDER_CONFIRMED";
|
|
118
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["DELIVERED"] = 8] = "DELIVERED";
|
|
119
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["ON_HOLD"] = 9] = "ON_HOLD";
|
|
120
|
+
CustomOrderRequestStatus[CustomOrderRequestStatus["IN_PRODUCTION"] = 10] = "IN_PRODUCTION";
|
|
121
|
+
})(CustomOrderRequestStatus || (CustomOrderRequestStatus = {}));
|
|
122
|
+
const customOrderRequestStatusColors = Object.values({
|
|
123
|
+
[CustomOrderRequestStatus.DRAFT]: PrimaryColors.$primaryBlueColor,
|
|
124
|
+
[CustomOrderRequestStatus.SENT]: PrimaryColors.$primaryNavyBlueColor,
|
|
125
|
+
[CustomOrderRequestStatus.RESPONDED]: PrimaryColors.$primaryPurpleColor,
|
|
126
|
+
[CustomOrderRequestStatus.REJECTED]: PrimaryColors.$primaryRedColor,
|
|
127
|
+
[CustomOrderRequestStatus.CANCELED]: PrimaryColors.$primaryGrayColor,
|
|
128
|
+
[CustomOrderRequestStatus.DECLINED]: PrimaryColors.$primaryPinkColor,
|
|
129
|
+
[CustomOrderRequestStatus.ACCEPTED]: PrimaryColors.$primaryPurpleColor,
|
|
130
|
+
[CustomOrderRequestStatus.ORDER_CONFIRMED]: PrimaryColors.$primaryDarkPurpleColor,
|
|
131
|
+
[CustomOrderRequestStatus.IN_PRODUCTION]: PrimaryColors.$primaryLimeGreenColor,
|
|
132
|
+
[CustomOrderRequestStatus.DELIVERED]: PrimaryColors.$primaryTealColor,
|
|
133
|
+
[CustomOrderRequestStatus.ON_HOLD]: PrimaryColors.$primaryOrangeColor,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
var InvitationStatus;
|
|
137
|
+
(function (InvitationStatus) {
|
|
138
|
+
InvitationStatus[InvitationStatus["PENDING"] = 0] = "PENDING";
|
|
139
|
+
InvitationStatus[InvitationStatus["ACCEPTED"] = 1] = "ACCEPTED";
|
|
140
|
+
InvitationStatus[InvitationStatus["EXPIRED"] = 2] = "EXPIRED";
|
|
141
|
+
InvitationStatus[InvitationStatus["CANCELED"] = 3] = "CANCELED";
|
|
142
|
+
})(InvitationStatus || (InvitationStatus = {}));
|
|
143
|
+
const invitationStatusColors = Object.values({
|
|
144
|
+
[InvitationStatus.PENDING]: PrimaryColors.$primaryYellowColor,
|
|
145
|
+
[InvitationStatus.ACCEPTED]: PrimaryColors.$primaryTealColor,
|
|
146
|
+
[InvitationStatus.EXPIRED]: PrimaryColors.$primaryGrayColor,
|
|
147
|
+
[InvitationStatus.CANCELED]: PrimaryColors.$primaryPinkColor,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
var InvoiceStatus;
|
|
151
|
+
(function (InvoiceStatus) {
|
|
152
|
+
InvoiceStatus[InvoiceStatus["DRAFT"] = 0] = "DRAFT";
|
|
153
|
+
InvoiceStatus[InvoiceStatus["SUBMITTED"] = 1] = "SUBMITTED";
|
|
154
|
+
InvoiceStatus[InvoiceStatus["PAID"] = 2] = "PAID";
|
|
155
|
+
InvoiceStatus[InvoiceStatus["UNPAID"] = 3] = "UNPAID";
|
|
156
|
+
InvoiceStatus[InvoiceStatus["PARTLY_PAID"] = 4] = "PARTLY_PAID";
|
|
157
|
+
InvoiceStatus[InvoiceStatus["CANCELLED"] = 5] = "CANCELLED";
|
|
158
|
+
InvoiceStatus[InvoiceStatus["OVERDUE"] = 6] = "OVERDUE";
|
|
159
|
+
InvoiceStatus[InvoiceStatus["CREDIT_NOTE_ISSUED"] = 7] = "CREDIT_NOTE_ISSUED";
|
|
160
|
+
InvoiceStatus[InvoiceStatus["RETURN"] = 8] = "RETURN";
|
|
161
|
+
InvoiceStatus[InvoiceStatus["UNPAID_AND_DISCOUNTED"] = 9] = "UNPAID_AND_DISCOUNTED";
|
|
162
|
+
InvoiceStatus[InvoiceStatus["OVERDUE_AND_DISCOUNTED"] = 10] = "OVERDUE_AND_DISCOUNTED";
|
|
163
|
+
})(InvoiceStatus || (InvoiceStatus = {}));
|
|
164
|
+
|
|
165
|
+
var LockerTransferStatus;
|
|
166
|
+
(function (LockerTransferStatus) {
|
|
167
|
+
LockerTransferStatus[LockerTransferStatus["DRAFT"] = 0] = "DRAFT";
|
|
168
|
+
LockerTransferStatus[LockerTransferStatus["POSTED"] = 1] = "POSTED";
|
|
169
|
+
})(LockerTransferStatus || (LockerTransferStatus = {}));
|
|
170
|
+
const lockerTransferStatusColors = Object.values({
|
|
171
|
+
[LockerTransferStatus.DRAFT]: PrimaryColors.$primaryBlueColor,
|
|
172
|
+
[LockerTransferStatus.POSTED]: PrimaryColors.$primaryTealColor,
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
var Priority;
|
|
176
|
+
(function (Priority) {
|
|
177
|
+
Priority[Priority["LOW"] = 0] = "LOW";
|
|
178
|
+
Priority[Priority["NORMAL"] = 1] = "NORMAL";
|
|
179
|
+
Priority[Priority["HIGH"] = 2] = "HIGH";
|
|
180
|
+
})(Priority || (Priority = {}));
|
|
181
|
+
const priorityColors = Object.values({
|
|
182
|
+
[Priority.LOW]: PrimaryColors.$primaryTealColor,
|
|
183
|
+
[Priority.NORMAL]: PrimaryColors.$primaryOrangeColor,
|
|
184
|
+
[Priority.HIGH]: PrimaryColors.$primaryRedColor,
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
var QuotationStatus;
|
|
188
|
+
(function (QuotationStatus) {
|
|
189
|
+
QuotationStatus[QuotationStatus["CREATED"] = 0] = "CREATED";
|
|
190
|
+
QuotationStatus[QuotationStatus["SENT"] = 1] = "SENT";
|
|
191
|
+
QuotationStatus[QuotationStatus["REJECTED"] = 2] = "REJECTED";
|
|
192
|
+
QuotationStatus[QuotationStatus["CANCELED"] = 3] = "CANCELED";
|
|
193
|
+
QuotationStatus[QuotationStatus["ACCEPTED"] = 4] = "ACCEPTED";
|
|
194
|
+
QuotationStatus[QuotationStatus["EXPIRED"] = 5] = "EXPIRED";
|
|
195
|
+
})(QuotationStatus || (QuotationStatus = {}));
|
|
196
|
+
const quotationStatusColors = Object.values({
|
|
197
|
+
[QuotationStatus.CREATED]: PrimaryColors.$primaryLimeGreenColor,
|
|
198
|
+
[QuotationStatus.SENT]: PrimaryColors.$primaryNavyBlueColor,
|
|
199
|
+
[QuotationStatus.REJECTED]: PrimaryColors.$primaryOrangeRedColor,
|
|
200
|
+
[QuotationStatus.CANCELED]: PrimaryColors.$primaryOrangeColor,
|
|
201
|
+
[QuotationStatus.ACCEPTED]: PrimaryColors.$primaryTealColor,
|
|
202
|
+
[QuotationStatus.EXPIRED]: PrimaryColors.$primaryGrayColor,
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
var RequestStatus;
|
|
206
|
+
(function (RequestStatus) {
|
|
207
|
+
RequestStatus[RequestStatus["PENDING"] = 0] = "PENDING";
|
|
208
|
+
RequestStatus[RequestStatus["REJECTED"] = 1] = "REJECTED";
|
|
209
|
+
RequestStatus[RequestStatus["APPROVED"] = 2] = "APPROVED";
|
|
210
|
+
RequestStatus[RequestStatus["CANCELED"] = 3] = "CANCELED";
|
|
211
|
+
})(RequestStatus || (RequestStatus = {}));
|
|
212
|
+
const requestStatusColors = Object.values({
|
|
213
|
+
[RequestStatus.PENDING]: PrimaryColors.$primaryYellowColor,
|
|
214
|
+
[RequestStatus.REJECTED]: PrimaryColors.$primaryRedColor,
|
|
215
|
+
[RequestStatus.APPROVED]: PrimaryColors.$primaryTealColor,
|
|
216
|
+
[RequestStatus.CANCELED]: PrimaryColors.$primaryGrayColor,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// Enum Class Mapping
|
|
220
|
+
const enumClassMap = {
|
|
221
|
+
BOMProductionType: BOMProductionType,
|
|
222
|
+
InvoiceStatus: InvoiceStatus,
|
|
223
|
+
CustomOrderRequestStatus: CustomOrderRequestStatus,
|
|
224
|
+
Priority: Priority,
|
|
225
|
+
QuotationStatus: QuotationStatus,
|
|
226
|
+
LockerTransferStatus: LockerTransferStatus,
|
|
227
|
+
BillStatus: BillStatus,
|
|
228
|
+
SalesOrderStatus: SalesOrderStatus,
|
|
229
|
+
RequestStatus: RequestStatus,
|
|
230
|
+
InvitationStatus: InvitationStatus,
|
|
231
|
+
ChargeLevel: ChargeLevel,
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
const enumCustomColors = [
|
|
235
|
+
{ enumClass: 'CustomOrderRequestStatus', colors: customOrderRequestStatusColors },
|
|
236
|
+
{ enumClass: 'Priority', colors: priorityColors },
|
|
237
|
+
{ enumClass: 'QuotationStatus', colors: quotationStatusColors },
|
|
238
|
+
{ enumClass: 'LockerTransferStatus', colors: lockerTransferStatusColors },
|
|
239
|
+
{ enumClass: 'BillStatus', colors: billStatusColors },
|
|
240
|
+
{ enumClass: 'SalesOrderStatus', colors: salesOrderStatusColors },
|
|
241
|
+
{ enumClass: 'RequestStatus', colors: requestStatusColors },
|
|
242
|
+
{ enumClass: 'InvitationStatus', colors: invitationStatusColors },
|
|
243
|
+
{ enumClass: 'BOMProductionType', colors: bomProductionTypeColors },
|
|
244
|
+
];
|
|
245
|
+
|
|
246
|
+
class EnumCustomColorMapping {
|
|
247
|
+
enumClass;
|
|
248
|
+
colors;
|
|
249
|
+
constructor(enumClass, colors) {
|
|
250
|
+
this.enumClass = enumClass;
|
|
251
|
+
if (this.validateColors(enumClass, colors)) {
|
|
252
|
+
this.colors = colors;
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
throw new Error(`The length of your custom colors list does not match the enum class provided.`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
validateColors(enumClass, colors) {
|
|
259
|
+
// Get the total number of enum values by counting keys
|
|
260
|
+
const enumValues = Object.keys(enumClass).filter(key => isNaN(Number(key))).length;
|
|
261
|
+
return colors.length === enumValues;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// Function to create EnumCustomColorMapping instances from JSON array
|
|
265
|
+
function createEnumCustomColorMappings(mappings) {
|
|
266
|
+
return mappings.map(json => {
|
|
267
|
+
const enumClass = enumClassMap[json.enumClass];
|
|
268
|
+
if (!enumClass) {
|
|
269
|
+
throw new Error(`Enum class "${json.enumClass}" not found.`);
|
|
270
|
+
}
|
|
271
|
+
return new EnumCustomColorMapping(enumClass, json.colors);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
const enumCustomColorMappings = createEnumCustomColorMappings(enumCustomColors);
|
|
275
|
+
|
|
276
|
+
class CustomTheme {
|
|
277
|
+
static $joolerBlue = [
|
|
278
|
+
'#e3ecfa',
|
|
279
|
+
'#b9cff2',
|
|
280
|
+
'#8aafea',
|
|
281
|
+
'#5b8ee1',
|
|
282
|
+
'#3876da',
|
|
283
|
+
'#155ed4',
|
|
284
|
+
'#1256cf',
|
|
285
|
+
'#0f4cc9',
|
|
286
|
+
'#0c42c3',
|
|
287
|
+
'#0631b9',
|
|
288
|
+
'#e3e8ff',
|
|
289
|
+
'#b0bfff',
|
|
290
|
+
'#7d95ff',
|
|
291
|
+
'#6481ff',
|
|
292
|
+
];
|
|
293
|
+
static $joolerTeal = [
|
|
294
|
+
'#b8dfd8',
|
|
295
|
+
'#89cabf',
|
|
296
|
+
'#59b5a5',
|
|
297
|
+
'#36a591',
|
|
298
|
+
'#12957e',
|
|
299
|
+
'#108d76',
|
|
300
|
+
'#0d826b',
|
|
301
|
+
'#0a7861',
|
|
302
|
+
'#05674e',
|
|
303
|
+
'#97ffe1',
|
|
304
|
+
'#64ffd2',
|
|
305
|
+
'#31ffc3',
|
|
306
|
+
'#18ffbc',
|
|
307
|
+
];
|
|
308
|
+
static $joolerRed = [
|
|
309
|
+
'#f5e0e1',
|
|
310
|
+
'#e5b3b3',
|
|
311
|
+
'#d48081',
|
|
312
|
+
'#c24d4e',
|
|
313
|
+
'#b52628',
|
|
314
|
+
'#a80002',
|
|
315
|
+
'#a00002',
|
|
316
|
+
'#970001',
|
|
317
|
+
'#8d0001',
|
|
318
|
+
'#7d0001',
|
|
319
|
+
'#ffaaaa',
|
|
320
|
+
'#ff7777',
|
|
321
|
+
'#ff4444',
|
|
322
|
+
'#ff2a2a',
|
|
323
|
+
];
|
|
324
|
+
static $joolerPink = [
|
|
325
|
+
'#fdeaf3',
|
|
326
|
+
'#fbcbe1',
|
|
327
|
+
'#f8a8ce',
|
|
328
|
+
'#f585ba',
|
|
329
|
+
'#f26aab',
|
|
330
|
+
'#f0509c',
|
|
331
|
+
'#ee4994',
|
|
332
|
+
'#ec408a',
|
|
333
|
+
'#e93780',
|
|
334
|
+
'#e5276e',
|
|
335
|
+
'#ffffff',
|
|
336
|
+
'#ffeef4',
|
|
337
|
+
'#ffbbd3',
|
|
338
|
+
'#ffa1c2',
|
|
339
|
+
];
|
|
340
|
+
static $joolerPurple = [
|
|
341
|
+
'#fcf6fd',
|
|
342
|
+
'#f7e8f9',
|
|
343
|
+
'#f1d8f5',
|
|
344
|
+
'#ebc8f1',
|
|
345
|
+
'#e7bdee',
|
|
346
|
+
'#e3b1eb',
|
|
347
|
+
'#e0aae9',
|
|
348
|
+
'#dca1e5',
|
|
349
|
+
'#d898e2',
|
|
350
|
+
'#d088dd',
|
|
351
|
+
'#ffffff',
|
|
352
|
+
'#ffffff',
|
|
353
|
+
'#ffffff',
|
|
354
|
+
'#fcecff',
|
|
355
|
+
];
|
|
356
|
+
static $joolerCombo = [
|
|
357
|
+
'#b9cff2',
|
|
358
|
+
'#b8dfd8',
|
|
359
|
+
'#ffaaaa',
|
|
360
|
+
'#fbcbe1',
|
|
361
|
+
'#f1d8f5',
|
|
362
|
+
'#8aafea',
|
|
363
|
+
'#97ffe1',
|
|
364
|
+
'#ff7777',
|
|
365
|
+
'#f585ba',
|
|
366
|
+
'#e7bdee',
|
|
367
|
+
'#6481ff',
|
|
368
|
+
'#18ffbc',
|
|
369
|
+
'#ff4444',
|
|
370
|
+
'#ffa1c2',
|
|
371
|
+
'#e0aae9',
|
|
372
|
+
'#1256cf',
|
|
373
|
+
'#108d76',
|
|
374
|
+
'#df0000',
|
|
375
|
+
'#ec408a',
|
|
376
|
+
'#d088dd',
|
|
377
|
+
];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
var enumCustomLabelMappingsJSON = [
|
|
381
|
+
{
|
|
382
|
+
enumClass: "BOMProductionType",
|
|
383
|
+
labels: [
|
|
384
|
+
"Manufactured In-House",
|
|
385
|
+
"Partially Manufactured In-House"
|
|
386
|
+
]
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
enumClass: "ChargeLevel",
|
|
390
|
+
labels: [
|
|
391
|
+
"Header",
|
|
392
|
+
"Line"
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
];
|
|
396
|
+
|
|
397
|
+
class EnumCustomLabelMapping {
|
|
398
|
+
enumClass;
|
|
399
|
+
labels;
|
|
400
|
+
constructor(enumClass, labels) {
|
|
401
|
+
this.enumClass = enumClass;
|
|
402
|
+
if (this.validateLabels(enumClass, labels)) {
|
|
403
|
+
this.labels = labels;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
throw new Error('The length of your custom labels list does not match the enum class provided.');
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
validateLabels(enumClass, labels) {
|
|
410
|
+
// Get the total number of enum values by counting keys
|
|
411
|
+
const enumValues = Object.keys(enumClass).filter(key => isNaN(Number(key))).length;
|
|
412
|
+
return labels.length === enumValues;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
// Function to create EnumCustomLabelMapping instances from JSON array
|
|
416
|
+
function createEnumCustomLabelMappingsFromJSON(jsonArray) {
|
|
417
|
+
return jsonArray.map(json => {
|
|
418
|
+
const enumClass = enumClassMap[json.enumClass];
|
|
419
|
+
if (!enumClass) {
|
|
420
|
+
throw new Error(`Enum class "${json.enumClass}" not found.`);
|
|
421
|
+
}
|
|
422
|
+
return new EnumCustomLabelMapping(enumClass, json.labels);
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
const enumCustomLabelMappings = createEnumCustomLabelMappingsFromJSON(enumCustomLabelMappingsJSON);
|
|
426
|
+
|
|
427
|
+
class EnumOption {
|
|
428
|
+
value;
|
|
429
|
+
label;
|
|
430
|
+
color;
|
|
431
|
+
description;
|
|
432
|
+
disabled;
|
|
433
|
+
constructor(value, label, color, disabled = false) {
|
|
434
|
+
this.value = value;
|
|
435
|
+
this.label = label;
|
|
436
|
+
this.color = color;
|
|
437
|
+
this.disabled = disabled;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
class EnumHelperBaseClass {
|
|
442
|
+
static getEnumOptionsFromEnumClass(enumClass, customColors, isAllCaps = false, isIntegerChoice = true) {
|
|
443
|
+
const enumOptions = [];
|
|
444
|
+
// Get string keys only (filter out numeric reverse mappings)
|
|
445
|
+
const enumKeys = Object.keys(enumClass).filter(k => isNaN(Number(k)));
|
|
446
|
+
// Prepare display labels
|
|
447
|
+
const stringValues = EnumHelperBaseClass.getStringValuesForEnumClass(enumClass, isAllCaps);
|
|
448
|
+
// Prepare colors
|
|
449
|
+
const colors = EnumHelperBaseClass.getColorsForEnumClass(enumClass, stringValues, customColors);
|
|
450
|
+
enumKeys.forEach((key, idx) => {
|
|
451
|
+
let value;
|
|
452
|
+
if (isIntegerChoice) {
|
|
453
|
+
value = enumClass[key]; // numeric value
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
value = key; // string value
|
|
457
|
+
}
|
|
458
|
+
const label = stringValues[idx];
|
|
459
|
+
const color = colors[idx];
|
|
460
|
+
enumOptions.push(new EnumOption(value, label, color));
|
|
461
|
+
});
|
|
462
|
+
return enumOptions;
|
|
463
|
+
}
|
|
464
|
+
static getColorsForEnumClass(enumClass, stringValues, customColors) {
|
|
465
|
+
let colors = CustomTheme.$joolerCombo;
|
|
466
|
+
let enumSpecificColors = enumCustomColorMappings.find(item => Object.keys(item.enumClass).toString() == Object.keys(enumClass).toString());
|
|
467
|
+
if (enumSpecificColors) {
|
|
468
|
+
colors = enumSpecificColors.colors;
|
|
469
|
+
}
|
|
470
|
+
if (customColors && customColors.length > 0) {
|
|
471
|
+
colors = customColors;
|
|
472
|
+
}
|
|
473
|
+
// in case the array of colors is smaller than the stringValues array, we repeat the the colors so that they are enough
|
|
474
|
+
if (stringValues.length > colors.length) {
|
|
475
|
+
for (let label of stringValues) {
|
|
476
|
+
colors.push(colors[stringValues.indexOf(label) % colors.length]);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return colors;
|
|
480
|
+
}
|
|
481
|
+
static getStringValuesForEnumClass(enumClass, isAllCaps) {
|
|
482
|
+
let stringValues = [];
|
|
483
|
+
let enumCustomLabels = enumCustomLabelMappings.find(item => Object.keys(item.enumClass).toString() == Object.keys(enumClass).toString());
|
|
484
|
+
if (enumCustomLabels) {
|
|
485
|
+
stringValues = enumCustomLabels.labels;
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
for (let item in enumClass) {
|
|
489
|
+
if (isNaN(Number(item))) {
|
|
490
|
+
let joinedString;
|
|
491
|
+
stringValues.push(item);
|
|
492
|
+
let splitStr = item.toLowerCase().split('_');
|
|
493
|
+
if (!isAllCaps) {
|
|
494
|
+
for (let i = 0; i < splitStr.length; i++) {
|
|
495
|
+
splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
else {
|
|
499
|
+
for (let i = 0; i < splitStr.length; i++) {
|
|
500
|
+
splitStr[i] = splitStr[i].toUpperCase();
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
joinedString = splitStr.join(' ');
|
|
504
|
+
stringValues.splice(stringValues.indexOf(item), 1, joinedString);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return stringValues;
|
|
509
|
+
}
|
|
510
|
+
static getLabelAndColorFromEnumValue(enumClass, enumValue, customColors) {
|
|
511
|
+
let enumOptions = EnumHelperBaseClass.getEnumOptionsFromEnumClass(enumClass, customColors);
|
|
512
|
+
let enumOption;
|
|
513
|
+
for (let item of enumOptions) {
|
|
514
|
+
if (enumValue == item.value) {
|
|
515
|
+
enumOption = enumOptions[enumOptions.indexOf(item)];
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
return enumOption;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
19
521
|
|
|
20
522
|
class ChooseEnumComponent {
|
|
21
523
|
items;
|
|
@@ -347,6 +849,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
347
849
|
args: [{ selector: 'choose-enum-renderer', template: "<div class=\"all\" [ngClass]=\"{ single: !showError, double: showError }\" *ngIf=\"rowLevelFG\" [formGroup]=\"rowLevelFG\">\r\n <choose-enum [clearable]=\"clearable\" [formControlName]=\"key\" [appendTo]=\"'body'\" [label]=\"params.label\"\r\n [labelTextAlign]=\"params.labelTextAlign\" [labelTextFontWeight]=\"params.labelTextFontWeight\"\r\n [labelTextFontSize]=\"params.labelTextFontSize\" [selectedItem]=\"params.value\" [valuesToHide]=\"valuesToHide\"\r\n [valuesToDisable]=\"valuesToDisable\" [isDropdownDisabled]=\"params.isDropdownDisabled\"\r\n [enumChoices]=\"params.enumChoices\" [placeholder]=\"params.placeholder\" [width]=\"params.width\" [isChip]=\"isChip\"\r\n [paddingTop]=\"params.paddingTop\" [customColors]=\"params.customColors\" (change)=\"onEnumSelected($event)\">\r\n </choose-enum>\r\n</div>", styles: [".all{display:grid;gap:.5rem;align-items:center;margin:auto}.single{grid-template-columns:auto}.double{grid-template-columns:auto max-content}\n"] }]
|
|
348
850
|
}], ctorParameters: function () { return []; } });
|
|
349
851
|
|
|
852
|
+
var ChooseObjectTemplateType;
|
|
853
|
+
(function (ChooseObjectTemplateType) {
|
|
854
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["DEFAULT"] = 0] = "DEFAULT";
|
|
855
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["BASIC"] = 1] = "BASIC";
|
|
856
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["CONTENT_PROJECTION"] = 2] = "CONTENT_PROJECTION";
|
|
857
|
+
})(ChooseObjectTemplateType || (ChooseObjectTemplateType = {}));
|
|
858
|
+
|
|
859
|
+
var ChooseItemFullObjectControlConfig;
|
|
860
|
+
(function (ChooseItemFullObjectControlConfig) {
|
|
861
|
+
ChooseItemFullObjectControlConfig[ChooseItemFullObjectControlConfig["OBJECT"] = 1] = "OBJECT";
|
|
862
|
+
ChooseItemFullObjectControlConfig[ChooseItemFullObjectControlConfig["ID"] = 2] = "ID";
|
|
863
|
+
})(ChooseItemFullObjectControlConfig || (ChooseItemFullObjectControlConfig = {}));
|
|
864
|
+
|
|
865
|
+
class DictionaryToHttpParamsConverter {
|
|
866
|
+
static dictionaryToHttpParamsConverter(form_dictionary) {
|
|
867
|
+
let queryParams = new HttpParams();
|
|
868
|
+
for (let key in form_dictionary) {
|
|
869
|
+
if (form_dictionary[key] !== null &&
|
|
870
|
+
form_dictionary[key] !== '' &&
|
|
871
|
+
form_dictionary[key] !== undefined &&
|
|
872
|
+
form_dictionary[key]?.length !== 0)
|
|
873
|
+
queryParams = queryParams.append(key, form_dictionary[key]);
|
|
874
|
+
}
|
|
875
|
+
return queryParams;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
350
879
|
// import { environment } from '../../environments/environment';
|
|
351
880
|
class ChooseGeneralItemService {
|
|
352
881
|
http;
|
|
@@ -364,6 +893,21 @@ class ChooseGeneralItemService {
|
|
|
364
893
|
});
|
|
365
894
|
return { headers: httpHeaders };
|
|
366
895
|
}
|
|
896
|
+
getHeadersAndParams(dictionary) {
|
|
897
|
+
let httpHeaders;
|
|
898
|
+
const token = localStorage.getItem('token');
|
|
899
|
+
if (token) {
|
|
900
|
+
httpHeaders = new HttpHeaders({
|
|
901
|
+
'Content-Type': 'application/json; charset-utf-8',
|
|
902
|
+
Authorization: 'Token ' + token,
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
else {
|
|
906
|
+
httpHeaders = new HttpHeaders();
|
|
907
|
+
}
|
|
908
|
+
const params = DictionaryToHttpParamsConverter.dictionaryToHttpParamsConverter(dictionary);
|
|
909
|
+
return { headers: httpHeaders, params: params };
|
|
910
|
+
}
|
|
367
911
|
getAuthenticationHeadersWithQueryParams(params) {
|
|
368
912
|
const token = localStorage.getItem("token");
|
|
369
913
|
const httpHeaders = new HttpHeaders({
|
|
@@ -372,8 +916,13 @@ class ChooseGeneralItemService {
|
|
|
372
916
|
});
|
|
373
917
|
return { headers: httpHeaders, params: params };
|
|
374
918
|
}
|
|
375
|
-
getData(apiPath) {
|
|
376
|
-
|
|
919
|
+
getData(apiPath, filterParams) {
|
|
920
|
+
if (filterParams) {
|
|
921
|
+
return this.http.get(`${this.env.apiURL}${apiPath}`, this.getHeadersAndParams(filterParams));
|
|
922
|
+
}
|
|
923
|
+
else {
|
|
924
|
+
return this.http.get(`${this.env.apiURL}${apiPath}`, this.getHeaders());
|
|
925
|
+
}
|
|
377
926
|
}
|
|
378
927
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemService, deps: [{ token: i1$1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
379
928
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemService, providedIn: 'root' });
|
|
@@ -388,22 +937,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
388
937
|
args: ['env']
|
|
389
938
|
}] }]; } });
|
|
390
939
|
|
|
940
|
+
var DropdownActionType;
|
|
941
|
+
(function (DropdownActionType) {
|
|
942
|
+
DropdownActionType[DropdownActionType["ADD"] = 0] = "ADD";
|
|
943
|
+
DropdownActionType[DropdownActionType["MENU"] = 1] = "MENU";
|
|
944
|
+
})(DropdownActionType || (DropdownActionType = {}));
|
|
945
|
+
|
|
946
|
+
class DropdownActionsComponent {
|
|
947
|
+
_Router;
|
|
948
|
+
dropdownActionTypes = DropdownActionType;
|
|
949
|
+
canRoute = true;
|
|
950
|
+
disabled;
|
|
951
|
+
labelsAndRoutes = [];
|
|
952
|
+
route;
|
|
953
|
+
dropdownActionType = this.dropdownActionTypes.ADD;
|
|
954
|
+
addClicked = new EventEmitter();
|
|
955
|
+
constructor(_Router) {
|
|
956
|
+
this._Router = _Router;
|
|
957
|
+
}
|
|
958
|
+
ngOnInit() {
|
|
959
|
+
this.validateActions();
|
|
960
|
+
}
|
|
961
|
+
validateActions() {
|
|
962
|
+
if (this.dropdownActionType == this.dropdownActionTypes.ADD) {
|
|
963
|
+
if (this.canRoute) {
|
|
964
|
+
if (this.route == "" || this.route == undefined || this.route == null) {
|
|
965
|
+
throw Error("Route needs to be provided.");
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
if (this.route) {
|
|
970
|
+
throw Error("Route shouldn't be provided since canRoute is false");
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
else if (this.dropdownActionType == this.dropdownActionTypes.MENU) {
|
|
975
|
+
if (!this.labelsAndRoutes.length) {
|
|
976
|
+
throw Error("A list of labels & Routes need to be provided for the actions menu.");
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
else {
|
|
980
|
+
throw Error("Dropdown Action Type is not recognized.");
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
onClickAdd($event) {
|
|
984
|
+
$event.preventDefault();
|
|
985
|
+
if (this.canRoute && this.route) {
|
|
986
|
+
this._Router.navigate([this.route]);
|
|
987
|
+
}
|
|
988
|
+
this.addClicked.emit();
|
|
989
|
+
}
|
|
990
|
+
onClickLabel(route, $event) {
|
|
991
|
+
$event.preventDefault();
|
|
992
|
+
this._Router.navigate([route]);
|
|
993
|
+
}
|
|
994
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
995
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DropdownActionsComponent, selector: "dropdown-actions", inputs: { canRoute: "canRoute", disabled: "disabled", labelsAndRoutes: "labelsAndRoutes", route: "route", dropdownActionType: "dropdownActionType" }, outputs: { addClicked: "addClicked" }, ngImport: i0, template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i2$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }] });
|
|
996
|
+
}
|
|
997
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, decorators: [{
|
|
998
|
+
type: Component,
|
|
999
|
+
args: [{ selector: 'dropdown-actions', template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"] }]
|
|
1000
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }]; }, propDecorators: { canRoute: [{
|
|
1001
|
+
type: Input
|
|
1002
|
+
}], disabled: [{
|
|
1003
|
+
type: Input
|
|
1004
|
+
}], labelsAndRoutes: [{
|
|
1005
|
+
type: Input
|
|
1006
|
+
}], route: [{
|
|
1007
|
+
type: Input
|
|
1008
|
+
}], dropdownActionType: [{
|
|
1009
|
+
type: Input
|
|
1010
|
+
}], addClicked: [{
|
|
1011
|
+
type: Output
|
|
1012
|
+
}] } });
|
|
1013
|
+
|
|
391
1014
|
class ChooseGeneralItemComponent {
|
|
392
1015
|
_ChooseGeneralItemService;
|
|
393
|
-
|
|
1016
|
+
dialog;
|
|
1017
|
+
_cdr;
|
|
1018
|
+
primaryRed = PrimaryColors.$primaryRedColor;
|
|
1019
|
+
isLoading = false;
|
|
394
1020
|
items;
|
|
395
|
-
label;
|
|
396
|
-
appendTo;
|
|
1021
|
+
label = 'label';
|
|
1022
|
+
appendTo = 'body';
|
|
397
1023
|
placeholder;
|
|
398
1024
|
apiPath;
|
|
399
|
-
isMultiple;
|
|
1025
|
+
isMultiple = false;
|
|
400
1026
|
hideSelectedItem;
|
|
401
1027
|
objects;
|
|
402
|
-
showLabel;
|
|
1028
|
+
showLabel = false;
|
|
403
1029
|
separator;
|
|
404
|
-
width
|
|
405
|
-
fontWeight;
|
|
406
|
-
fontSize;
|
|
1030
|
+
width;
|
|
407
1031
|
isChip = false;
|
|
408
1032
|
isTypeDate;
|
|
409
1033
|
chipColor = 'black';
|
|
@@ -411,20 +1035,81 @@ class ChooseGeneralItemComponent {
|
|
|
411
1035
|
chipWidth = 11;
|
|
412
1036
|
selectedItemId;
|
|
413
1037
|
disabled;
|
|
1038
|
+
readOnly;
|
|
414
1039
|
useFullObject = false;
|
|
415
|
-
|
|
1040
|
+
showAdd = false;
|
|
1041
|
+
dialogComponentClass;
|
|
1042
|
+
showDialogDefaultButtons = false;
|
|
1043
|
+
dialogComponentInputs = {
|
|
1044
|
+
isDialog: true,
|
|
1045
|
+
};
|
|
1046
|
+
bindValueKey = 'id'; // or null for full object
|
|
1047
|
+
addRoute;
|
|
1048
|
+
canActionsRoute;
|
|
1049
|
+
dialogTitle;
|
|
1050
|
+
clearable = true;
|
|
1051
|
+
filterParams;
|
|
1052
|
+
templateType = ChooseObjectTemplateType.DEFAULT;
|
|
1053
|
+
basicTemplateData;
|
|
1054
|
+
contentProjectionLabelKey;
|
|
1055
|
+
fullObjectControlConfig = ChooseItemFullObjectControlConfig.ID;
|
|
1056
|
+
change = new EventEmitter();
|
|
1057
|
+
blur = new EventEmitter();
|
|
1058
|
+
customOptionTemplate;
|
|
1059
|
+
ChooseObjectTemplateType = ChooseObjectTemplateType;
|
|
1060
|
+
chipInputTypes = ChipInputType;
|
|
1061
|
+
constructor(_ChooseGeneralItemService, dialog, _cdr) {
|
|
416
1062
|
this._ChooseGeneralItemService = _ChooseGeneralItemService;
|
|
1063
|
+
this.dialog = dialog;
|
|
1064
|
+
this._cdr = _cdr;
|
|
417
1065
|
}
|
|
418
1066
|
ngOnInit() {
|
|
419
|
-
if (
|
|
1067
|
+
if (this.templateType == ChooseObjectTemplateType.BASIC) {
|
|
1068
|
+
this.setupBasicTemplate();
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
setupBasicTemplate() { }
|
|
1072
|
+
ngOnChanges(changes) {
|
|
1073
|
+
if (changes['items'] && !changes.items) {
|
|
1074
|
+
this.items = undefined;
|
|
1075
|
+
}
|
|
1076
|
+
if (changes['apiPath'] && !changes.apiPath) {
|
|
1077
|
+
this.apiPath = undefined;
|
|
1078
|
+
}
|
|
1079
|
+
this.validateInputs(changes);
|
|
1080
|
+
if (this.showAdd) {
|
|
1081
|
+
this.validateAddConfiguration();
|
|
1082
|
+
}
|
|
1083
|
+
if (!changes['items'] || !changes['items'].currentValue) {
|
|
1084
|
+
this.isLoading = true;
|
|
420
1085
|
this.getData();
|
|
1086
|
+
}
|
|
1087
|
+
else {
|
|
1088
|
+
this.isLoading = false;
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
validateAddConfiguration() {
|
|
1092
|
+
if ((this.addRoute == '' || this.addRoute == null || this.addRoute == undefined) &&
|
|
1093
|
+
(this.dialogComponentClass == null || this.dialogComponentClass == undefined)) {
|
|
1094
|
+
throw Error('Showing the add button requires either a route for the add button to route to, or a component class for a dialog to open up with that component.');
|
|
1095
|
+
}
|
|
421
1096
|
}
|
|
422
1097
|
writeValue(item) {
|
|
423
|
-
if (item != undefined) {
|
|
424
|
-
this.
|
|
1098
|
+
if (item != undefined || item != null) {
|
|
1099
|
+
if (!this.useFullObject) {
|
|
1100
|
+
this.selectedItemId = item;
|
|
1101
|
+
}
|
|
1102
|
+
else {
|
|
1103
|
+
if (Array.isArray(item)) {
|
|
1104
|
+
this.selectedItemId = item.map(item => item.id);
|
|
1105
|
+
}
|
|
1106
|
+
else {
|
|
1107
|
+
this.selectedItemId = item.id;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
425
1110
|
}
|
|
426
|
-
else
|
|
427
|
-
this.selectedItemId =
|
|
1111
|
+
else {
|
|
1112
|
+
this.selectedItemId = null;
|
|
428
1113
|
}
|
|
429
1114
|
}
|
|
430
1115
|
registerOnChange(fn) {
|
|
@@ -435,44 +1120,116 @@ class ChooseGeneralItemComponent {
|
|
|
435
1120
|
}
|
|
436
1121
|
propagateChange = (_) => { };
|
|
437
1122
|
propogateTouch = () => { };
|
|
1123
|
+
onValidationChange = () => { };
|
|
438
1124
|
updateBlur() {
|
|
439
1125
|
this.propogateTouch();
|
|
1126
|
+
this.blur.emit();
|
|
440
1127
|
}
|
|
441
1128
|
onSelectedItemChanged($event) {
|
|
442
|
-
|
|
443
|
-
|
|
1129
|
+
let valueToPropagate;
|
|
1130
|
+
if (this.fullObjectControlConfig == ChooseItemFullObjectControlConfig.ID) {
|
|
1131
|
+
valueToPropagate = this.selectedItemId;
|
|
1132
|
+
}
|
|
1133
|
+
else if (this.fullObjectControlConfig == ChooseItemFullObjectControlConfig.OBJECT) {
|
|
1134
|
+
valueToPropagate = $event;
|
|
1135
|
+
}
|
|
1136
|
+
else {
|
|
1137
|
+
throw Error('ChooseItemFullObjectControlConfig is not recognized.');
|
|
1138
|
+
}
|
|
1139
|
+
this.propagateChange(valueToPropagate);
|
|
1140
|
+
this.change.emit($event);
|
|
1141
|
+
this.onValidationChange();
|
|
1142
|
+
}
|
|
1143
|
+
validateInputs(changes) {
|
|
1144
|
+
if (changes.apiPath &&
|
|
1145
|
+
changes.apiPath.currentValue &&
|
|
1146
|
+
changes.items &&
|
|
1147
|
+
changes.items.currentValue) {
|
|
1148
|
+
throw Error('Both an API path and an items list was provided.');
|
|
1149
|
+
}
|
|
444
1150
|
}
|
|
445
1151
|
getData() {
|
|
446
1152
|
if (this.apiPath) {
|
|
447
|
-
this._ChooseGeneralItemService.getData(this.apiPath).subscribe({
|
|
1153
|
+
this._ChooseGeneralItemService.getData(this.apiPath, this.filterParams).subscribe({
|
|
448
1154
|
next: (response) => {
|
|
449
1155
|
this.items = response;
|
|
1156
|
+
this.isLoading = false;
|
|
1157
|
+
this._cdr.markForCheck();
|
|
1158
|
+
console.log("response: items from '", this.apiPath, "' found: ", this.items);
|
|
450
1159
|
},
|
|
451
|
-
error:
|
|
1160
|
+
error: error => console.error('error', error),
|
|
452
1161
|
});
|
|
453
1162
|
}
|
|
454
1163
|
}
|
|
455
1164
|
setWidth() {
|
|
456
|
-
let style = {
|
|
457
|
-
|
|
458
|
-
|
|
1165
|
+
let style = {};
|
|
1166
|
+
if (this.width) {
|
|
1167
|
+
style = {
|
|
1168
|
+
width: this.width + 'rem',
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
else {
|
|
1172
|
+
style = {
|
|
1173
|
+
width: '100%',
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
459
1176
|
return style;
|
|
460
1177
|
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
1178
|
+
onClickAddNew() {
|
|
1179
|
+
console.log('DYNAMIC DIALOG NOT IMPLEMENTED IN LIBRARY YET');
|
|
1180
|
+
// Add dynamic dialog later
|
|
1181
|
+
// let dialogRef = this.dialog.open(DynamicDialogComponent, {
|
|
1182
|
+
// panelClass: 'custom-dialog-padding',
|
|
1183
|
+
// width: '90%',
|
|
1184
|
+
// minWidth: '90%',
|
|
1185
|
+
// maxHeight: '90vh',
|
|
1186
|
+
// data: {
|
|
1187
|
+
// component: this.dialogComponentClass,
|
|
1188
|
+
// showDefaultButtons: this.showDialogDefaultButtons,
|
|
1189
|
+
// title: this.dialogTitle,
|
|
1190
|
+
// inputs: this.dialogComponentInputs,
|
|
1191
|
+
// },
|
|
1192
|
+
// });
|
|
1193
|
+
// dialogRef.afterClosed().subscribe((data: any) => {
|
|
1194
|
+
// if (data) {
|
|
1195
|
+
// console.log('New item Added: ', data);
|
|
1196
|
+
// this.items.push(data);
|
|
1197
|
+
// this.items = [...this.items];
|
|
1198
|
+
// }
|
|
1199
|
+
// });
|
|
467
1200
|
}
|
|
468
|
-
|
|
469
|
-
|
|
1201
|
+
setDisabledState(isDisabled) {
|
|
1202
|
+
this.disabled = isDisabled;
|
|
1203
|
+
}
|
|
1204
|
+
registerOnValidatorChange(fn) {
|
|
1205
|
+
this.onValidationChange = fn;
|
|
1206
|
+
}
|
|
1207
|
+
validate(control) {
|
|
1208
|
+
return null;
|
|
1209
|
+
if (control) {
|
|
1210
|
+
const errors = control.errors;
|
|
1211
|
+
if (errors) {
|
|
1212
|
+
console.log('errorssss: ', errors);
|
|
1213
|
+
return errors;
|
|
1214
|
+
}
|
|
1215
|
+
else {
|
|
1216
|
+
return null;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemComponent, deps: [{ token: ChooseGeneralItemService }, { token: i2$3.MatDialog }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
1221
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ChooseGeneralItemComponent, selector: "choose-general-item", inputs: { items: "items", label: "label", appendTo: "appendTo", placeholder: "placeholder", apiPath: "apiPath", isMultiple: "isMultiple", hideSelectedItem: "hideSelectedItem", objects: "objects", showLabel: "showLabel", separator: "separator", width: "width", isChip: "isChip", isTypeDate: "isTypeDate", chipColor: "chipColor", chipTextColor: "chipTextColor", chipWidth: "chipWidth", selectedItemId: "selectedItemId", disabled: "disabled", readOnly: "readOnly", useFullObject: "useFullObject", showAdd: "showAdd", dialogComponentClass: "dialogComponentClass", showDialogDefaultButtons: "showDialogDefaultButtons", dialogComponentInputs: "dialogComponentInputs", bindValueKey: "bindValueKey", addRoute: "addRoute", canActionsRoute: "canActionsRoute", dialogTitle: "dialogTitle", clearable: "clearable", filterParams: "filterParams", templateType: "templateType", basicTemplateData: "basicTemplateData", contentProjectionLabelKey: "contentProjectionLabelKey", fullObjectControlConfig: "fullObjectControlConfig" }, outputs: { change: "change", blur: "blur" }, providers: [
|
|
470
1222
|
{
|
|
471
1223
|
provide: NG_VALUE_ACCESSOR,
|
|
472
1224
|
useExisting: forwardRef(() => ChooseGeneralItemComponent),
|
|
473
1225
|
multi: true,
|
|
474
1226
|
},
|
|
475
|
-
|
|
1227
|
+
{
|
|
1228
|
+
provide: NG_VALIDATORS,
|
|
1229
|
+
useExisting: ChooseGeneralItemComponent,
|
|
1230
|
+
multi: true,
|
|
1231
|
+
},
|
|
1232
|
+
], queries: [{ propertyName: "customOptionTemplate", first: true, predicate: ["customOption"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"select\">\r\n <ng-select [readonly]=\"readOnly\" [loading]=\"isLoading\" [hideSelected]=\"hideSelectedItem\"\r\n [closeOnSelect]=\"!isMultiple\" [ngStyle]=\"setWidth()\" class=\"component\" [disabled]=\"disabled\"\r\n [appendTo]=\"appendTo\" dropdownPosition=\"bottom\" (blur)=\"updateBlur()\" [bindLabel]=\"label\"\r\n [bindValue]=\"bindValueKey\" [compareWith]=\"\" [items]=\"items\" [placeholder]=\"placeholder\"\r\n (change)=\"onSelectedItemChanged($event)\" [(ngModel)]=\"selectedItemId\" [clearable]=\"clearable\"\r\n [multiple]=\"isMultiple\">\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.DEFAULT\">\r\n <ng-template *ngIf=\"isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\"> </ng-template>\r\n\r\n <ng-template ng-label-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container *ngIf=\"objects; else nonObjectLabelTemplate\">\r\n <span class=\"template\" *ngFor=\"let object of objects; let isLast = last\">\r\n <span class=\"template-item\">\r\n {{ showLabel ? object.label + ': ' : ''\r\n }}{{\r\n isTypeDate ? (item[object.field] | date: 'mediumDate') : item[object.field]\r\n }}</span>\r\n </span>\r\n </ng-container>\r\n <ng-template #nonObjectLabelTemplate>{{ item }} </ng-template>\r\n </ng-template>\r\n\r\n <!-- Option Template -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container *ngIf=\"objects; else nonObjectOptionTemplate\">\r\n <span *ngFor=\"let object of objects; let isLast = last\">\r\n {{ showLabel ? object.label + ': ' : ''\r\n }}{{ isTypeDate ? (item[object.field] | date: 'mediumDate') : item[object.field] }}\r\n </span>\r\n </ng-container>\r\n <ng-template #nonObjectOptionTemplate>{{ item }} </ng-template>\r\n </ng-template>\r\n\r\n <ng-template *ngIf=\"isChip && !isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [clear]=\"clear\" [withCross]=\"isMultiple\"\r\n [inputType]=\"chipInputTypes.CUSTOM\"\r\n [backgroundColor]=\"item.disabled == true ? primaryRed : chipColor\" [label]=\"item[objects[0].field]\"\r\n [item]=\"item\">\r\n </ng-chip>\r\n </ng-template>\r\n <ng-template *ngIf=\"isChip && !isLoading\" ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [withCross]=\"false\" [inputType]=\"chipInputTypes.CUSTOM\"\r\n [backgroundColor]=\"item.disabled == true ? primaryRed : chipColor\" [label]=\"item[objects[0].field]\">\r\n </ng-chip>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.BASIC\">\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n {{ item[basicTemplateData.label] }}\r\n </ng-template>\r\n <ng-template ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <mat-card class=\"basic-template-card\" [ngClass]=\"{\r\n 'with-image': basicTemplateData.hasImage,\r\n 'without-image': !basicTemplateData.hasImage,\r\n }\">\r\n <div class=\"image-cont\" *ngIf=\"basicTemplateData.hasImage\">\r\n <img class=\"main-image\" [src]=\"item[basicTemplateData.image]\"\r\n onerror=\"this.src='../../../assets/images/defaultImage.jpg';\" />\r\n </div>\r\n\r\n <div class=\"info\">\r\n <div class=\"title\">\r\n {{ item[basicTemplateData.title] }}\r\n </div>\r\n <div class=\"subtitle-style\" *ngIf=\"basicTemplateData.hasSubtitleOne\">\r\n <span>{{ item[basicTemplateData.subtitleOne] }}</span>\r\n <ng-container *ngIf=\"basicTemplateData.hasSubtitleTwo\">\r\n <span class=\"col-divider\"> | </span>\r\n <span>{{ item[basicTemplateData.subtitleTwo] }}</span>\r\n </ng-container>\r\n </div>\r\n <div class=\"description\" *ngIf=\"basicTemplateData.hasDescription\">\r\n {{ item[basicTemplateData.description] }}\r\n </div>\r\n </div>\r\n </mat-card>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.CONTENT_PROJECTION\">\r\n <ng-template *ngIf=\"isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\"> </ng-template>\r\n\r\n <ng-template ng-label-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <span class=\"template\">\r\n <span class=\"template-item\"> {{ item[contentProjectionLabelKey] }} </span>\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Option Template -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container [ngTemplateOutlet]=\"customOptionTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\">\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-select>\r\n <dropdown-actions *ngIf=\"showAdd\" [canRoute]=\"canActionsRoute\" [route]=\"addRoute\"\r\n (addClicked)=\"onClickAddNew()\"></dropdown-actions>\r\n</div>\r\n ", styles: [".template{background-color:#f0f2f4;border-radius:1.6rem;height:2.6rem;line-height:2.6rem;display:inline-block}.template-item{padding:.8rem 1.2rem}.basic-template-card{display:grid;row-gap:.4rem}.basic-template-card .image-cont,.basic-template-card .image-cont .main-image{max-width:100%;max-height:100%}.basic-template-card .info{display:flex;flex-direction:column;row-gap:.4rem;padding:.6rem;white-space:normal}.basic-template-card .info .title{font-weight:600;color:#155ed4}.basic-template-card .info .subtitle-style{font-weight:400}.basic-template-card .info .description{color:#676767;font-style:italic;font-size:1.1rem}.basic-template-card .info .col-divider{color:#12957e}.with-image{grid-template-columns:8rem auto}.without-image{grid-template-columns:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i6.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i4.NgChipComponent, selector: "ng-chip", inputs: ["backgroundColor", "size", "clear", "customColors", "enumClass", "enumValue", "inputType", "item", "isClickable", "label", "width", "withCross"] }, { kind: "component", type: DropdownActionsComponent, selector: "dropdown-actions", inputs: ["canRoute", "disabled", "labelsAndRoutes", "route", "dropdownActionType"], outputs: ["addClicked"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
476
1233
|
}
|
|
477
1234
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemComponent, decorators: [{
|
|
478
1235
|
type: Component,
|
|
@@ -482,10 +1239,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
482
1239
|
useExisting: forwardRef(() => ChooseGeneralItemComponent),
|
|
483
1240
|
multi: true,
|
|
484
1241
|
},
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
1242
|
+
{
|
|
1243
|
+
provide: NG_VALIDATORS,
|
|
1244
|
+
useExisting: ChooseGeneralItemComponent,
|
|
1245
|
+
multi: true,
|
|
1246
|
+
},
|
|
1247
|
+
], template: "<div class=\"select\">\r\n <ng-select [readonly]=\"readOnly\" [loading]=\"isLoading\" [hideSelected]=\"hideSelectedItem\"\r\n [closeOnSelect]=\"!isMultiple\" [ngStyle]=\"setWidth()\" class=\"component\" [disabled]=\"disabled\"\r\n [appendTo]=\"appendTo\" dropdownPosition=\"bottom\" (blur)=\"updateBlur()\" [bindLabel]=\"label\"\r\n [bindValue]=\"bindValueKey\" [compareWith]=\"\" [items]=\"items\" [placeholder]=\"placeholder\"\r\n (change)=\"onSelectedItemChanged($event)\" [(ngModel)]=\"selectedItemId\" [clearable]=\"clearable\"\r\n [multiple]=\"isMultiple\">\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.DEFAULT\">\r\n <ng-template *ngIf=\"isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\"> </ng-template>\r\n\r\n <ng-template ng-label-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container *ngIf=\"objects; else nonObjectLabelTemplate\">\r\n <span class=\"template\" *ngFor=\"let object of objects; let isLast = last\">\r\n <span class=\"template-item\">\r\n {{ showLabel ? object.label + ': ' : ''\r\n }}{{\r\n isTypeDate ? (item[object.field] | date: 'mediumDate') : item[object.field]\r\n }}</span>\r\n </span>\r\n </ng-container>\r\n <ng-template #nonObjectLabelTemplate>{{ item }} </ng-template>\r\n </ng-template>\r\n\r\n <!-- Option Template -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container *ngIf=\"objects; else nonObjectOptionTemplate\">\r\n <span *ngFor=\"let object of objects; let isLast = last\">\r\n {{ showLabel ? object.label + ': ' : ''\r\n }}{{ isTypeDate ? (item[object.field] | date: 'mediumDate') : item[object.field] }}\r\n </span>\r\n </ng-container>\r\n <ng-template #nonObjectOptionTemplate>{{ item }} </ng-template>\r\n </ng-template>\r\n\r\n <ng-template *ngIf=\"isChip && !isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [clear]=\"clear\" [withCross]=\"isMultiple\"\r\n [inputType]=\"chipInputTypes.CUSTOM\"\r\n [backgroundColor]=\"item.disabled == true ? primaryRed : chipColor\" [label]=\"item[objects[0].field]\"\r\n [item]=\"item\">\r\n </ng-chip>\r\n </ng-template>\r\n <ng-template *ngIf=\"isChip && !isLoading\" ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [withCross]=\"false\" [inputType]=\"chipInputTypes.CUSTOM\"\r\n [backgroundColor]=\"item.disabled == true ? primaryRed : chipColor\" [label]=\"item[objects[0].field]\">\r\n </ng-chip>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.BASIC\">\r\n <ng-template ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n {{ item[basicTemplateData.label] }}\r\n </ng-template>\r\n <ng-template ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <mat-card class=\"basic-template-card\" [ngClass]=\"{\r\n 'with-image': basicTemplateData.hasImage,\r\n 'without-image': !basicTemplateData.hasImage,\r\n }\">\r\n <div class=\"image-cont\" *ngIf=\"basicTemplateData.hasImage\">\r\n <img class=\"main-image\" [src]=\"item[basicTemplateData.image]\"\r\n onerror=\"this.src='../../../assets/images/defaultImage.jpg';\" />\r\n </div>\r\n\r\n <div class=\"info\">\r\n <div class=\"title\">\r\n {{ item[basicTemplateData.title] }}\r\n </div>\r\n <div class=\"subtitle-style\" *ngIf=\"basicTemplateData.hasSubtitleOne\">\r\n <span>{{ item[basicTemplateData.subtitleOne] }}</span>\r\n <ng-container *ngIf=\"basicTemplateData.hasSubtitleTwo\">\r\n <span class=\"col-divider\"> | </span>\r\n <span>{{ item[basicTemplateData.subtitleTwo] }}</span>\r\n </ng-container>\r\n </div>\r\n <div class=\"description\" *ngIf=\"basicTemplateData.hasDescription\">\r\n {{ item[basicTemplateData.description] }}\r\n </div>\r\n </div>\r\n </mat-card>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"templateType == ChooseObjectTemplateType.CONTENT_PROJECTION\">\r\n <ng-template *ngIf=\"isLoading\" ng-label-tmp let-item=\"item\" let-clear=\"clear\"> </ng-template>\r\n\r\n <ng-template ng-label-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <span class=\"template\">\r\n <span class=\"template-item\"> {{ item[contentProjectionLabelKey] }} </span>\r\n </span>\r\n </ng-template>\r\n\r\n <!-- Option Template -->\r\n <ng-template ng-option-tmp let-item=\"item\" let-index=\"index\" let-search=\"searchTerm\">\r\n <ng-container [ngTemplateOutlet]=\"customOptionTemplate\" [ngTemplateOutletContext]=\"{ $implicit: item }\">\r\n </ng-container>\r\n </ng-template>\r\n </ng-container>\r\n </ng-select>\r\n <dropdown-actions *ngIf=\"showAdd\" [canRoute]=\"canActionsRoute\" [route]=\"addRoute\"\r\n (addClicked)=\"onClickAddNew()\"></dropdown-actions>\r\n</div>\r\n ", styles: [".template{background-color:#f0f2f4;border-radius:1.6rem;height:2.6rem;line-height:2.6rem;display:inline-block}.template-item{padding:.8rem 1.2rem}.basic-template-card{display:grid;row-gap:.4rem}.basic-template-card .image-cont,.basic-template-card .image-cont .main-image{max-width:100%;max-height:100%}.basic-template-card .info{display:flex;flex-direction:column;row-gap:.4rem;padding:.6rem;white-space:normal}.basic-template-card .info .title{font-weight:600;color:#155ed4}.basic-template-card .info .subtitle-style{font-weight:400}.basic-template-card .info .description{color:#676767;font-style:italic;font-size:1.1rem}.basic-template-card .info .col-divider{color:#12957e}.with-image{grid-template-columns:8rem auto}.without-image{grid-template-columns:auto}\n"] }]
|
|
1248
|
+
}], ctorParameters: function () { return [{ type: ChooseGeneralItemService }, { type: i2$3.MatDialog }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
|
|
489
1249
|
type: Input
|
|
490
1250
|
}], label: [{
|
|
491
1251
|
type: Input
|
|
@@ -507,10 +1267,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
507
1267
|
type: Input
|
|
508
1268
|
}], width: [{
|
|
509
1269
|
type: Input
|
|
510
|
-
}], fontWeight: [{
|
|
511
|
-
type: Input
|
|
512
|
-
}], fontSize: [{
|
|
513
|
-
type: Input
|
|
514
1270
|
}], isChip: [{
|
|
515
1271
|
type: Input
|
|
516
1272
|
}], isTypeDate: [{
|
|
@@ -525,8 +1281,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
525
1281
|
type: Input
|
|
526
1282
|
}], disabled: [{
|
|
527
1283
|
type: Input
|
|
1284
|
+
}], readOnly: [{
|
|
1285
|
+
type: Input
|
|
528
1286
|
}], useFullObject: [{
|
|
529
1287
|
type: Input
|
|
1288
|
+
}], showAdd: [{
|
|
1289
|
+
type: Input
|
|
1290
|
+
}], dialogComponentClass: [{
|
|
1291
|
+
type: Input
|
|
1292
|
+
}], showDialogDefaultButtons: [{
|
|
1293
|
+
type: Input
|
|
1294
|
+
}], dialogComponentInputs: [{
|
|
1295
|
+
type: Input
|
|
1296
|
+
}], bindValueKey: [{
|
|
1297
|
+
type: Input
|
|
1298
|
+
}], addRoute: [{
|
|
1299
|
+
type: Input
|
|
1300
|
+
}], canActionsRoute: [{
|
|
1301
|
+
type: Input
|
|
1302
|
+
}], dialogTitle: [{
|
|
1303
|
+
type: Input
|
|
1304
|
+
}], clearable: [{
|
|
1305
|
+
type: Input
|
|
1306
|
+
}], filterParams: [{
|
|
1307
|
+
type: Input
|
|
1308
|
+
}], templateType: [{
|
|
1309
|
+
type: Input
|
|
1310
|
+
}], basicTemplateData: [{
|
|
1311
|
+
type: Input
|
|
1312
|
+
}], contentProjectionLabelKey: [{
|
|
1313
|
+
type: Input
|
|
1314
|
+
}], fullObjectControlConfig: [{
|
|
1315
|
+
type: Input
|
|
1316
|
+
}], change: [{
|
|
1317
|
+
type: Output
|
|
1318
|
+
}], blur: [{
|
|
1319
|
+
type: Output
|
|
1320
|
+
}], customOptionTemplate: [{
|
|
1321
|
+
type: ContentChild,
|
|
1322
|
+
args: ['customOption']
|
|
530
1323
|
}] } });
|
|
531
1324
|
|
|
532
1325
|
class ChooseGeneralItemRendererComponent {
|
|
@@ -556,11 +1349,11 @@ class ChooseGeneralItemRendererComponent {
|
|
|
556
1349
|
return true;
|
|
557
1350
|
}
|
|
558
1351
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
559
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ChooseGeneralItemRendererComponent, selector: "choose-general-item-renderer", ngImport: i0, template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\"
|
|
1352
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ChooseGeneralItemRendererComponent, selector: "choose-general-item-renderer", ngImport: i0, template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\" [isChip]=\"params.isChip\"\r\n [isTypeDate]=\"params.isTypeDate\" [chipColor]=\"params.chipColor\" [chipTextColor]=\"params.chipTextColor\"\r\n [chipWidth]=\"params.chipWidth\" [selectedItemId]=\"itemId\" [disabled]=\"params.disabled\"\r\n (change)=\"onCellDataChanged($event)\">\r\n</choose-general-item>", styles: [".all{display:grid;gap:.5rem;align-items:center;margin:auto}.single{grid-template-columns:auto}.double{grid-template-columns:auto max-content}\n"], dependencies: [{ kind: "component", type: ChooseGeneralItemComponent, selector: "choose-general-item", inputs: ["items", "label", "appendTo", "placeholder", "apiPath", "isMultiple", "hideSelectedItem", "objects", "showLabel", "separator", "width", "isChip", "isTypeDate", "chipColor", "chipTextColor", "chipWidth", "selectedItemId", "disabled", "readOnly", "useFullObject", "showAdd", "dialogComponentClass", "showDialogDefaultButtons", "dialogComponentInputs", "bindValueKey", "addRoute", "canActionsRoute", "dialogTitle", "clearable", "filterParams", "templateType", "basicTemplateData", "contentProjectionLabelKey", "fullObjectControlConfig"], outputs: ["change", "blur"] }] });
|
|
560
1353
|
}
|
|
561
1354
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemRendererComponent, decorators: [{
|
|
562
1355
|
type: Component,
|
|
563
|
-
args: [{ selector: 'choose-general-item-renderer', template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\"
|
|
1356
|
+
args: [{ selector: 'choose-general-item-renderer', template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\" [isChip]=\"params.isChip\"\r\n [isTypeDate]=\"params.isTypeDate\" [chipColor]=\"params.chipColor\" [chipTextColor]=\"params.chipTextColor\"\r\n [chipWidth]=\"params.chipWidth\" [selectedItemId]=\"itemId\" [disabled]=\"params.disabled\"\r\n (change)=\"onCellDataChanged($event)\">\r\n</choose-general-item>", styles: [".all{display:grid;gap:.5rem;align-items:center;margin:auto}.single{grid-template-columns:auto}.double{grid-template-columns:auto max-content}\n"] }]
|
|
564
1357
|
}], ctorParameters: function () { return []; } });
|
|
565
1358
|
|
|
566
1359
|
var LineType;
|
|
@@ -865,7 +1658,7 @@ class EditableSavableInputComponent {
|
|
|
865
1658
|
useExisting: forwardRef(() => EditableSavableInputComponent),
|
|
866
1659
|
multi: true
|
|
867
1660
|
}
|
|
868
|
-
], ngImport: i0, template: "<div *ngIf=\"showHeader\" class=\"header\">\r\n {{headerLabel}}\r\n</div>\r\n<div class=\"container\" [ngClass]=\"{'closed':!isAddClickedOn, 'open': isAddClickedOn}\">\r\n <div class=\"content\">\r\n <div class=\"default-content\" *ngIf=\"!isAddClickedOn && !isUpdated && isEditable\">\r\n <div class=\"add\" (click)=\"onClickAdd()\">\r\n {{defaultvalue}} </div>\r\n </div>\r\n <div class=\"edit-content\" *ngIf=\"isAddClickedOn\">\r\n <label class=\"input-label\" for=\"input\">{{newLabel}}</label>\r\n <div class=\"input \" [ngClass]=\"{'input-with-appended-unit': showUnit}\">\r\n <span *ngIf=\"showUnit\">{{unit}}</span>\r\n <input (change)=\"onChange($event)\" (blur)=\"updateBlur()\" [ngModel]=\"value\" [value]=\"value\" id=\"input\" #input\r\n class=\"form-control\" [ngClass]=\"{'input-box': showUnit}\" [type]=\"inputType\">\r\n </div>\r\n <div class=\"edit-actions\">\r\n <button type=\"button\" class=\"btn cancel\" (click)=\"onClickCancel()\" mat-raised-button>Cancel</button>\r\n <button type=\"button\" class=\"save\" (click)=\"onClickSave(input)\" mat-raised-button color=\"primary\">Save</button>\r\n </div>\r\n </div>\r\n <div class=\"updated-content closed\" *ngIf=\"!isAddClickedOn && isUpdated\" (mouseenter)=\"onMouseEnter()\"\r\n (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"edit-icon-container\" *ngIf=\"showEdit && isEditable\" (click)=\"onClickEdit()\">\r\n <i class=\"fas fa-pencil-alt\"></i>\r\n </div>\r\n <div class=\"updated\">\r\n <span class=\"updated-label\">\r\n <label for=\"input\">{{newLabel}}</label>\r\n </span>\r\n <span *ngIf=\"!showUnit\">{{value}}</span>\r\n <span *ngIf=\"showUnit\" class=\"updated-value\">\r\n {{value | dynamicPipe: unitType}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".container{display:block;width:100%}.open{height:120px}.closed{height:40px}.edit-icon-container{position:absolute;right:0%;transform:translate(0);top:0;cursor:pointer}.edit-icon-container:hover{background-color:gray;color:#fff;padding:2px}label,.updated-label{color:gray;margin-right:5px}#input{display:inline}.cancel{grid-column:1;grid-row:2;height:80%;width:80px}.save{grid-column:2;grid-row:2;height:80%;width:80px}.default-content{position:absolute}.input{width:280px;grid-column:2;grid-row:1}.input-box{width:200px}.input-label{grid-column:1;grid-row:1}.updated{position:absolute}.add{color:#00f}.add:hover{text-decoration:underline;cursor:pointer}.content{position:relative}.btn:focus{outline:none!important}.edit-content{position:absolute;left:50%;transform:translate(-50%);display:grid;grid-template-columns:150px 200px;grid-template-rows:50px 50px}.updated-content{display:block}.header{color:gray;border-bottom:1px solid grey;height:30px;font-size:20px;margin-bottom:10px;margin-top:10px}.input-with-appended-unit input{padding-left:20px;text-align:left}.input-with-appended-unit span{position:relative;left:20px;color:gray}.edit-actions{grid-column:2;grid-row:2;display:grid;grid-template-columns:50% 50%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }] });
|
|
1661
|
+
], ngImport: i0, template: "<div *ngIf=\"showHeader\" class=\"header\">\r\n {{headerLabel}}\r\n</div>\r\n<div class=\"container\" [ngClass]=\"{'closed':!isAddClickedOn, 'open': isAddClickedOn}\">\r\n <div class=\"content\">\r\n <div class=\"default-content\" *ngIf=\"!isAddClickedOn && !isUpdated && isEditable\">\r\n <div class=\"add\" (click)=\"onClickAdd()\">\r\n {{defaultvalue}} </div>\r\n </div>\r\n <div class=\"edit-content\" *ngIf=\"isAddClickedOn\">\r\n <label class=\"input-label\" for=\"input\">{{newLabel}}</label>\r\n <div class=\"input \" [ngClass]=\"{'input-with-appended-unit': showUnit}\">\r\n <span *ngIf=\"showUnit\">{{unit}}</span>\r\n <input (change)=\"onChange($event)\" (blur)=\"updateBlur()\" [ngModel]=\"value\" [value]=\"value\" id=\"input\" #input\r\n class=\"form-control\" [ngClass]=\"{'input-box': showUnit}\" [type]=\"inputType\">\r\n </div>\r\n <div class=\"edit-actions\">\r\n <button type=\"button\" class=\"btn cancel\" (click)=\"onClickCancel()\" mat-raised-button>Cancel</button>\r\n <button type=\"button\" class=\"save\" (click)=\"onClickSave(input)\" mat-raised-button color=\"primary\">Save</button>\r\n </div>\r\n </div>\r\n <div class=\"updated-content closed\" *ngIf=\"!isAddClickedOn && isUpdated\" (mouseenter)=\"onMouseEnter()\"\r\n (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"edit-icon-container\" *ngIf=\"showEdit && isEditable\" (click)=\"onClickEdit()\">\r\n <i class=\"fas fa-pencil-alt\"></i>\r\n </div>\r\n <div class=\"updated\">\r\n <span class=\"updated-label\">\r\n <label for=\"input\">{{newLabel}}</label>\r\n </span>\r\n <span *ngIf=\"!showUnit\">{{value}}</span>\r\n <span *ngIf=\"showUnit\" class=\"updated-value\">\r\n {{value | dynamicPipe: unitType}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".container{display:block;width:100%}.open{height:120px}.closed{height:40px}.edit-icon-container{position:absolute;right:0%;transform:translate(0);top:0;cursor:pointer}.edit-icon-container:hover{background-color:gray;color:#fff;padding:2px}label,.updated-label{color:gray;margin-right:5px}#input{display:inline}.cancel{grid-column:1;grid-row:2;height:80%;width:80px}.save{grid-column:2;grid-row:2;height:80%;width:80px}.default-content{position:absolute}.input{width:280px;grid-column:2;grid-row:1}.input-box{width:200px}.input-label{grid-column:1;grid-row:1}.updated{position:absolute}.add{color:#00f}.add:hover{text-decoration:underline;cursor:pointer}.content{position:relative}.btn:focus{outline:none!important}.edit-content{position:absolute;left:50%;transform:translate(-50%);display:grid;grid-template-columns:150px 200px;grid-template-rows:50px 50px}.updated-content{display:block}.header{color:gray;border-bottom:1px solid grey;height:30px;font-size:20px;margin-bottom:10px;margin-top:10px}.input-with-appended-unit input{padding-left:20px;text-align:left}.input-with-appended-unit span{position:relative;left:20px;color:gray}.edit-actions{grid-column:2;grid-row:2;display:grid;grid-template-columns:50% 50%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }] });
|
|
869
1662
|
}
|
|
870
1663
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditableSavableInputComponent, decorators: [{
|
|
871
1664
|
type: Component,
|
|
@@ -1259,92 +2052,6 @@ class LabelAndField {
|
|
|
1259
2052
|
field;
|
|
1260
2053
|
}
|
|
1261
2054
|
|
|
1262
|
-
var DropdownActionType;
|
|
1263
|
-
(function (DropdownActionType) {
|
|
1264
|
-
DropdownActionType[DropdownActionType["ADD"] = 0] = "ADD";
|
|
1265
|
-
DropdownActionType[DropdownActionType["MENU"] = 1] = "MENU";
|
|
1266
|
-
})(DropdownActionType || (DropdownActionType = {}));
|
|
1267
|
-
|
|
1268
|
-
class DropdownActionsComponent {
|
|
1269
|
-
_Router;
|
|
1270
|
-
dropdownActionTypes = DropdownActionType;
|
|
1271
|
-
canRoute = true;
|
|
1272
|
-
disabled;
|
|
1273
|
-
labelsAndRoutes = [];
|
|
1274
|
-
route;
|
|
1275
|
-
dropdownActionType = this.dropdownActionTypes.ADD;
|
|
1276
|
-
addClicked = new EventEmitter();
|
|
1277
|
-
constructor(_Router) {
|
|
1278
|
-
this._Router = _Router;
|
|
1279
|
-
}
|
|
1280
|
-
ngOnInit() {
|
|
1281
|
-
this.validateActions();
|
|
1282
|
-
}
|
|
1283
|
-
validateActions() {
|
|
1284
|
-
if (this.dropdownActionType == this.dropdownActionTypes.ADD) {
|
|
1285
|
-
if (this.canRoute) {
|
|
1286
|
-
if (this.route == "" || this.route == undefined || this.route == null) {
|
|
1287
|
-
throw Error("Route needs to be provided.");
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
else {
|
|
1291
|
-
if (this.route) {
|
|
1292
|
-
throw Error("Route shouldn't be provided since canRoute is false");
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
else if (this.dropdownActionType == this.dropdownActionTypes.MENU) {
|
|
1297
|
-
if (!this.labelsAndRoutes.length) {
|
|
1298
|
-
throw Error("A list of labels & Routes need to be provided for the actions menu.");
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
else {
|
|
1302
|
-
throw Error("Dropdown Action Type is not recognized.");
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
onClickAdd($event) {
|
|
1306
|
-
$event.preventDefault();
|
|
1307
|
-
if (this.canRoute && this.route) {
|
|
1308
|
-
this._Router.navigate([this.route]);
|
|
1309
|
-
}
|
|
1310
|
-
this.addClicked.emit();
|
|
1311
|
-
}
|
|
1312
|
-
onClickLabel(route, $event) {
|
|
1313
|
-
$event.preventDefault();
|
|
1314
|
-
this._Router.navigate([route]);
|
|
1315
|
-
}
|
|
1316
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
|
1317
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DropdownActionsComponent, selector: "dropdown-actions", inputs: { canRoute: "canRoute", disabled: "disabled", labelsAndRoutes: "labelsAndRoutes", route: "route", dropdownActionType: "dropdownActionType" }, outputs: { addClicked: "addClicked" }, ngImport: i0, template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i2$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }] });
|
|
1318
|
-
}
|
|
1319
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, decorators: [{
|
|
1320
|
-
type: Component,
|
|
1321
|
-
args: [{ selector: 'dropdown-actions', template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"] }]
|
|
1322
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }]; }, propDecorators: { canRoute: [{
|
|
1323
|
-
type: Input
|
|
1324
|
-
}], disabled: [{
|
|
1325
|
-
type: Input
|
|
1326
|
-
}], labelsAndRoutes: [{
|
|
1327
|
-
type: Input
|
|
1328
|
-
}], route: [{
|
|
1329
|
-
type: Input
|
|
1330
|
-
}], dropdownActionType: [{
|
|
1331
|
-
type: Input
|
|
1332
|
-
}], addClicked: [{
|
|
1333
|
-
type: Output
|
|
1334
|
-
}] } });
|
|
1335
|
-
|
|
1336
|
-
class PrimaryColors {
|
|
1337
|
-
static $primaryBlueColor = '#155ED4';
|
|
1338
|
-
static $primaryPinkColor = '#F0509C';
|
|
1339
|
-
static $primaryTealColor = '#12957E';
|
|
1340
|
-
static $primaryCarbonColor = '#32353B';
|
|
1341
|
-
static $primaryPurpleColor = '#E3B1EB';
|
|
1342
|
-
static $primaryRedColor = '#A80002';
|
|
1343
|
-
static $primaryLightRedColor = '#FFDBDB';
|
|
1344
|
-
static $primaryLightGrayBlueColor = '#f7f8f9';
|
|
1345
|
-
static $primaryLightGrayColor = '#f0f0f0';
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
2055
|
class AddAsteriskDirective {
|
|
1349
2056
|
elem;
|
|
1350
2057
|
show = true;
|