@jooler/inputs 0.0.53 → 0.0.55
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/ag-grid-select-mixin.mjs +1 -1
- 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/dictionary-to-params-converter.mjs +15 -0
- package/esm2022/lib/enum-helper-functions.mjs +15 -27
- package/esm2022/lib/enum-helper.model.mjs +1 -1
- package/esm2022/lib/models/choose-item-full-object-control-config.enum.mjs +6 -0
- package/fesm2022/inputs.mjs +377 -449
- 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/dictionary-to-params-converter.d.ts +4 -0
- package/lib/models/choose-item-full-object-control-config.enum.d.ts +4 -0
- package/package.json +1 -1
- package/esm2022/lib/custom-colors/bom-production-type.enum.mjs +0 -11
- package/esm2022/lib/custom-colors/enum-custom-color-mapping.mjs +0 -32
- package/esm2022/lib/custom-colors/enum-custom-colors.mjs +0 -21
- package/esm2022/lib/custom-colors/sales-order-status.enum.mjs +0 -27
- package/esm2022/lib/enum-custom-label-mapping.mjs +0 -32
- package/esm2022/lib/enum-models/bill-status.model.mjs +0 -25
- package/esm2022/lib/enum-models/charge-level.enum.mjs +0 -6
- package/esm2022/lib/enum-models/custom-order-request-status.enum.mjs +0 -29
- package/esm2022/lib/enum-models/invitation-status.model.mjs +0 -15
- package/esm2022/lib/enum-models/invoice-status.model.mjs +0 -15
- package/esm2022/lib/enum-models/locker-transfer-status.enum.mjs +0 -11
- package/esm2022/lib/enum-models/priority.model.mjs +0 -13
- package/esm2022/lib/enum-models/quotation-status.model.mjs +0 -19
- package/esm2022/lib/enum-models/request-status.model.mjs +0 -15
- package/esm2022/lib/enum-string-class-map.mjs +0 -26
- package/esm2022/lib/json/enum-custom-label-mappings.json +0 -10
- package/lib/custom-colors/bom-production-type.enum.d.ts +0 -5
- package/lib/custom-colors/enum-custom-color-mapping.d.ts +0 -11
- package/lib/custom-colors/enum-custom-colors.d.ts +0 -2
- package/lib/custom-colors/sales-order-status.enum.d.ts +0 -13
- package/lib/enum-custom-label-mapping.d.ts +0 -7
- package/lib/enum-models/bill-status.model.d.ts +0 -12
- package/lib/enum-models/charge-level.enum.d.ts +0 -4
- package/lib/enum-models/custom-order-request-status.enum.d.ts +0 -14
- package/lib/enum-models/invitation-status.model.d.ts +0 -7
- package/lib/enum-models/invoice-status.model.d.ts +0 -13
- package/lib/enum-models/locker-transfer-status.enum.d.ts +0 -5
- package/lib/enum-models/priority.model.d.ts +0 -6
- package/lib/enum-models/quotation-status.model.d.ts +0 -9
- package/lib/enum-models/request-status.model.d.ts +0 -7
- package/lib/enum-string-class-map.d.ts +0 -3
package/fesm2022/inputs.mjs
CHANGED
|
@@ -1,275 +1,23 @@
|
|
|
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';
|
|
4
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, NgModel, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import * as i1 from '@angular/common';
|
|
6
6
|
import { CurrencyPipe, DecimalPipe, CommonModule } from '@angular/common';
|
|
7
7
|
import * as i2 from '@ng-select/ng-select';
|
|
8
8
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
9
9
|
import * as i4 from '@jooler/shared-general-components';
|
|
10
|
-
import { SharedGeneralComponentsModule } 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
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
static $primaryBlueColor = '#155ED4';
|
|
22
|
-
static $primaryPinkColor = '#F0509C';
|
|
23
|
-
static $primaryTealColor = '#12957E';
|
|
24
|
-
static $primaryCarbonColor = '#32353B';
|
|
25
|
-
static $primaryGrayColor = '#676767';
|
|
26
|
-
static $primaryPurpleColor = '#E3B1EB';
|
|
27
|
-
static $primaryRedColor = '#A80002';
|
|
28
|
-
static $primaryLightRedColor = '#FFDBDB';
|
|
29
|
-
static $primaryLightGrayBlueColor = '#f7f8f9';
|
|
30
|
-
static $primaryLightGrayColor = '#f0f0f0';
|
|
31
|
-
static $primaryLightBlueColor = '#b9cff2';
|
|
32
|
-
static $primaryYellowColor = '#F2CD5C';
|
|
33
|
-
static $primaryOrangeColor = '#F2921D';
|
|
34
|
-
static $primaryLimeGreenColor = '#AFFF00';
|
|
35
|
-
static $primaryNavyBlueColor = '#000080';
|
|
36
|
-
static $primaryOrangeRedColor = '#FF4500';
|
|
37
|
-
static $primaryDarkPurpleColor = '#7600BC';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
var BOMProductionType;
|
|
41
|
-
(function (BOMProductionType) {
|
|
42
|
-
BOMProductionType[BOMProductionType["MANUFACTURED_IN_HOUSE"] = 0] = "MANUFACTURED_IN_HOUSE";
|
|
43
|
-
BOMProductionType[BOMProductionType["PARTIALLY_MANUFACTURED_IN_HOUSE"] = 1] = "PARTIALLY_MANUFACTURED_IN_HOUSE";
|
|
44
|
-
})(BOMProductionType || (BOMProductionType = {}));
|
|
45
|
-
const bomProductionTypeColors = Object.values({
|
|
46
|
-
[BOMProductionType.MANUFACTURED_IN_HOUSE]: PrimaryColors.$primaryLimeGreenColor,
|
|
47
|
-
[BOMProductionType.PARTIALLY_MANUFACTURED_IN_HOUSE]: PrimaryColors.$primaryBlueColor,
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
var SalesOrderStatus;
|
|
51
|
-
(function (SalesOrderStatus) {
|
|
52
|
-
SalesOrderStatus[SalesOrderStatus["DRAFT"] = 0] = "DRAFT";
|
|
53
|
-
SalesOrderStatus[SalesOrderStatus["PENDING_APPROVAL"] = 1] = "PENDING_APPROVAL";
|
|
54
|
-
SalesOrderStatus[SalesOrderStatus["APPROVED"] = 2] = "APPROVED";
|
|
55
|
-
SalesOrderStatus[SalesOrderStatus["TO_DELIVER_AND_TO_BILL"] = 3] = "TO_DELIVER_AND_TO_BILL";
|
|
56
|
-
SalesOrderStatus[SalesOrderStatus["TO_BILL"] = 4] = "TO_BILL";
|
|
57
|
-
SalesOrderStatus[SalesOrderStatus["PARTIALLY_DELIVERED_AND_PARTIALLY_BILLED"] = 5] = "PARTIALLY_DELIVERED_AND_PARTIALLY_BILLED";
|
|
58
|
-
SalesOrderStatus[SalesOrderStatus["PARTIALLY_DELIVERED_AND_TO_BILL"] = 6] = "PARTIALLY_DELIVERED_AND_TO_BILL";
|
|
59
|
-
SalesOrderStatus[SalesOrderStatus["COMPLETED"] = 7] = "COMPLETED";
|
|
60
|
-
SalesOrderStatus[SalesOrderStatus["CANCELED"] = 8] = "CANCELED";
|
|
61
|
-
SalesOrderStatus[SalesOrderStatus["CLOSED"] = 9] = "CLOSED";
|
|
62
|
-
})(SalesOrderStatus || (SalesOrderStatus = {}));
|
|
63
|
-
const salesOrderStatusColors = Object.values({
|
|
64
|
-
[SalesOrderStatus.DRAFT]: PrimaryColors.$primaryBlueColor,
|
|
65
|
-
[SalesOrderStatus.PENDING_APPROVAL]: PrimaryColors.$primaryYellowColor,
|
|
66
|
-
[SalesOrderStatus.APPROVED]: PrimaryColors.$primaryTealColor,
|
|
67
|
-
[SalesOrderStatus.TO_DELIVER_AND_TO_BILL]: PrimaryColors.$primaryPurpleColor,
|
|
68
|
-
[SalesOrderStatus.TO_BILL]: PrimaryColors.$primaryPinkColor,
|
|
69
|
-
[SalesOrderStatus.PARTIALLY_DELIVERED_AND_PARTIALLY_BILLED]: PrimaryColors.$primaryOrangeColor,
|
|
70
|
-
[SalesOrderStatus.PARTIALLY_DELIVERED_AND_TO_BILL]: PrimaryColors.$primaryNavyBlueColor,
|
|
71
|
-
[SalesOrderStatus.COMPLETED]: PrimaryColors.$primaryLimeGreenColor,
|
|
72
|
-
[SalesOrderStatus.CANCELED]: PrimaryColors.$primaryGrayColor,
|
|
73
|
-
[SalesOrderStatus.CLOSED]: PrimaryColors.$primaryCarbonColor,
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
var BillStatus;
|
|
77
|
-
(function (BillStatus) {
|
|
78
|
-
BillStatus[BillStatus["DRAFT"] = 0] = "DRAFT";
|
|
79
|
-
BillStatus[BillStatus["RECEIVED"] = 1] = "RECEIVED";
|
|
80
|
-
BillStatus[BillStatus["PAID"] = 2] = "PAID";
|
|
81
|
-
BillStatus[BillStatus["CANCELLED"] = 3] = "CANCELLED";
|
|
82
|
-
BillStatus[BillStatus["RETURN"] = 4] = "RETURN";
|
|
83
|
-
BillStatus[BillStatus["DEBIT_NOTE_ISSUED"] = 5] = "DEBIT_NOTE_ISSUED";
|
|
84
|
-
BillStatus[BillStatus["PARTLY_PAID"] = 6] = "PARTLY_PAID";
|
|
85
|
-
BillStatus[BillStatus["UNPAID"] = 7] = "UNPAID";
|
|
86
|
-
BillStatus[BillStatus["OVERDUE"] = 8] = "OVERDUE";
|
|
87
|
-
})(BillStatus || (BillStatus = {}));
|
|
88
|
-
const billStatusColors = Object.values({
|
|
89
|
-
[BillStatus.DRAFT]: PrimaryColors.$primaryBlueColor,
|
|
90
|
-
[BillStatus.RECEIVED]: PrimaryColors.$primaryTealColor,
|
|
91
|
-
[BillStatus.PAID]: PrimaryColors.$primaryPurpleColor,
|
|
92
|
-
[BillStatus.CANCELLED]: PrimaryColors.$primaryGrayColor,
|
|
93
|
-
[BillStatus.RETURN]: PrimaryColors.$primaryPinkColor,
|
|
94
|
-
[BillStatus.DEBIT_NOTE_ISSUED]: PrimaryColors.$primaryNavyBlueColor,
|
|
95
|
-
[BillStatus.PARTLY_PAID]: PrimaryColors.$primaryYellowColor,
|
|
96
|
-
[BillStatus.UNPAID]: PrimaryColors.$primaryRedColor,
|
|
97
|
-
[BillStatus.OVERDUE]: PrimaryColors.$primaryOrangeColor,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
var ChargeLevel;
|
|
101
|
-
(function (ChargeLevel) {
|
|
102
|
-
ChargeLevel[ChargeLevel["MAIN"] = 0] = "MAIN";
|
|
103
|
-
ChargeLevel[ChargeLevel["LINE"] = 1] = "LINE";
|
|
104
|
-
})(ChargeLevel || (ChargeLevel = {}));
|
|
105
|
-
|
|
106
|
-
var CustomOrderRequestStatus;
|
|
107
|
-
(function (CustomOrderRequestStatus) {
|
|
108
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["DRAFT"] = 0] = "DRAFT";
|
|
109
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["SENT"] = 1] = "SENT";
|
|
110
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["RESPONDED"] = 2] = "RESPONDED";
|
|
111
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["REJECTED"] = 3] = "REJECTED";
|
|
112
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["CANCELED"] = 4] = "CANCELED";
|
|
113
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["DECLINED"] = 5] = "DECLINED";
|
|
114
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["ACCEPTED"] = 6] = "ACCEPTED";
|
|
115
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["ORDER_CONFIRMED"] = 7] = "ORDER_CONFIRMED";
|
|
116
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["DELIVERED"] = 8] = "DELIVERED";
|
|
117
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["ON_HOLD"] = 9] = "ON_HOLD";
|
|
118
|
-
CustomOrderRequestStatus[CustomOrderRequestStatus["IN_PRODUCTION"] = 10] = "IN_PRODUCTION";
|
|
119
|
-
})(CustomOrderRequestStatus || (CustomOrderRequestStatus = {}));
|
|
120
|
-
const customOrderRequestStatusColors = Object.values({
|
|
121
|
-
[CustomOrderRequestStatus.DRAFT]: PrimaryColors.$primaryBlueColor,
|
|
122
|
-
[CustomOrderRequestStatus.SENT]: PrimaryColors.$primaryNavyBlueColor,
|
|
123
|
-
[CustomOrderRequestStatus.RESPONDED]: PrimaryColors.$primaryPurpleColor,
|
|
124
|
-
[CustomOrderRequestStatus.REJECTED]: PrimaryColors.$primaryRedColor,
|
|
125
|
-
[CustomOrderRequestStatus.CANCELED]: PrimaryColors.$primaryGrayColor,
|
|
126
|
-
[CustomOrderRequestStatus.DECLINED]: PrimaryColors.$primaryPinkColor,
|
|
127
|
-
[CustomOrderRequestStatus.ACCEPTED]: PrimaryColors.$primaryPurpleColor,
|
|
128
|
-
[CustomOrderRequestStatus.ORDER_CONFIRMED]: PrimaryColors.$primaryDarkPurpleColor,
|
|
129
|
-
[CustomOrderRequestStatus.IN_PRODUCTION]: PrimaryColors.$primaryLimeGreenColor,
|
|
130
|
-
[CustomOrderRequestStatus.DELIVERED]: PrimaryColors.$primaryTealColor,
|
|
131
|
-
[CustomOrderRequestStatus.ON_HOLD]: PrimaryColors.$primaryOrangeColor,
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
var InvitationStatus;
|
|
135
|
-
(function (InvitationStatus) {
|
|
136
|
-
InvitationStatus[InvitationStatus["PENDING"] = 0] = "PENDING";
|
|
137
|
-
InvitationStatus[InvitationStatus["ACCEPTED"] = 1] = "ACCEPTED";
|
|
138
|
-
InvitationStatus[InvitationStatus["EXPIRED"] = 2] = "EXPIRED";
|
|
139
|
-
InvitationStatus[InvitationStatus["CANCELED"] = 3] = "CANCELED";
|
|
140
|
-
})(InvitationStatus || (InvitationStatus = {}));
|
|
141
|
-
const invitationStatusColors = Object.values({
|
|
142
|
-
[InvitationStatus.PENDING]: PrimaryColors.$primaryYellowColor,
|
|
143
|
-
[InvitationStatus.ACCEPTED]: PrimaryColors.$primaryTealColor,
|
|
144
|
-
[InvitationStatus.EXPIRED]: PrimaryColors.$primaryGrayColor,
|
|
145
|
-
[InvitationStatus.CANCELED]: PrimaryColors.$primaryPinkColor,
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
var InvoiceStatus;
|
|
149
|
-
(function (InvoiceStatus) {
|
|
150
|
-
InvoiceStatus[InvoiceStatus["DRAFT"] = 0] = "DRAFT";
|
|
151
|
-
InvoiceStatus[InvoiceStatus["SUBMITTED"] = 1] = "SUBMITTED";
|
|
152
|
-
InvoiceStatus[InvoiceStatus["PAID"] = 2] = "PAID";
|
|
153
|
-
InvoiceStatus[InvoiceStatus["UNPAID"] = 3] = "UNPAID";
|
|
154
|
-
InvoiceStatus[InvoiceStatus["PARTLY_PAID"] = 4] = "PARTLY_PAID";
|
|
155
|
-
InvoiceStatus[InvoiceStatus["CANCELLED"] = 5] = "CANCELLED";
|
|
156
|
-
InvoiceStatus[InvoiceStatus["OVERDUE"] = 6] = "OVERDUE";
|
|
157
|
-
InvoiceStatus[InvoiceStatus["CREDIT_NOTE_ISSUED"] = 7] = "CREDIT_NOTE_ISSUED";
|
|
158
|
-
InvoiceStatus[InvoiceStatus["RETURN"] = 8] = "RETURN";
|
|
159
|
-
InvoiceStatus[InvoiceStatus["UNPAID_AND_DISCOUNTED"] = 9] = "UNPAID_AND_DISCOUNTED";
|
|
160
|
-
InvoiceStatus[InvoiceStatus["OVERDUE_AND_DISCOUNTED"] = 10] = "OVERDUE_AND_DISCOUNTED";
|
|
161
|
-
})(InvoiceStatus || (InvoiceStatus = {}));
|
|
162
|
-
|
|
163
|
-
var LockerTransferStatus;
|
|
164
|
-
(function (LockerTransferStatus) {
|
|
165
|
-
LockerTransferStatus[LockerTransferStatus["DRAFT"] = 0] = "DRAFT";
|
|
166
|
-
LockerTransferStatus[LockerTransferStatus["POSTED"] = 1] = "POSTED";
|
|
167
|
-
})(LockerTransferStatus || (LockerTransferStatus = {}));
|
|
168
|
-
const lockerTransferStatusColors = Object.values({
|
|
169
|
-
[LockerTransferStatus.DRAFT]: PrimaryColors.$primaryBlueColor,
|
|
170
|
-
[LockerTransferStatus.POSTED]: PrimaryColors.$primaryTealColor,
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
var Priority;
|
|
174
|
-
(function (Priority) {
|
|
175
|
-
Priority[Priority["LOW"] = 0] = "LOW";
|
|
176
|
-
Priority[Priority["NORMAL"] = 1] = "NORMAL";
|
|
177
|
-
Priority[Priority["HIGH"] = 2] = "HIGH";
|
|
178
|
-
})(Priority || (Priority = {}));
|
|
179
|
-
const priorityColors = Object.values({
|
|
180
|
-
[Priority.LOW]: PrimaryColors.$primaryTealColor,
|
|
181
|
-
[Priority.NORMAL]: PrimaryColors.$primaryOrangeColor,
|
|
182
|
-
[Priority.HIGH]: PrimaryColors.$primaryRedColor,
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
var QuotationStatus;
|
|
186
|
-
(function (QuotationStatus) {
|
|
187
|
-
QuotationStatus[QuotationStatus["CREATED"] = 0] = "CREATED";
|
|
188
|
-
QuotationStatus[QuotationStatus["SENT"] = 1] = "SENT";
|
|
189
|
-
QuotationStatus[QuotationStatus["REJECTED"] = 2] = "REJECTED";
|
|
190
|
-
QuotationStatus[QuotationStatus["CANCELED"] = 3] = "CANCELED";
|
|
191
|
-
QuotationStatus[QuotationStatus["ACCEPTED"] = 4] = "ACCEPTED";
|
|
192
|
-
QuotationStatus[QuotationStatus["EXPIRED"] = 5] = "EXPIRED";
|
|
193
|
-
})(QuotationStatus || (QuotationStatus = {}));
|
|
194
|
-
const quotationStatusColors = Object.values({
|
|
195
|
-
[QuotationStatus.CREATED]: PrimaryColors.$primaryLimeGreenColor,
|
|
196
|
-
[QuotationStatus.SENT]: PrimaryColors.$primaryNavyBlueColor,
|
|
197
|
-
[QuotationStatus.REJECTED]: PrimaryColors.$primaryOrangeRedColor,
|
|
198
|
-
[QuotationStatus.CANCELED]: PrimaryColors.$primaryOrangeColor,
|
|
199
|
-
[QuotationStatus.ACCEPTED]: PrimaryColors.$primaryTealColor,
|
|
200
|
-
[QuotationStatus.EXPIRED]: PrimaryColors.$primaryGrayColor,
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
var RequestStatus;
|
|
204
|
-
(function (RequestStatus) {
|
|
205
|
-
RequestStatus[RequestStatus["PENDING"] = 0] = "PENDING";
|
|
206
|
-
RequestStatus[RequestStatus["REJECTED"] = 1] = "REJECTED";
|
|
207
|
-
RequestStatus[RequestStatus["APPROVED"] = 2] = "APPROVED";
|
|
208
|
-
RequestStatus[RequestStatus["CANCELED"] = 3] = "CANCELED";
|
|
209
|
-
})(RequestStatus || (RequestStatus = {}));
|
|
210
|
-
const requestStatusColors = Object.values({
|
|
211
|
-
[RequestStatus.PENDING]: PrimaryColors.$primaryYellowColor,
|
|
212
|
-
[RequestStatus.REJECTED]: PrimaryColors.$primaryRedColor,
|
|
213
|
-
[RequestStatus.APPROVED]: PrimaryColors.$primaryTealColor,
|
|
214
|
-
[RequestStatus.CANCELED]: PrimaryColors.$primaryGrayColor,
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
// Enum Class Mapping
|
|
218
|
-
const enumClassMap = {
|
|
219
|
-
BOMProductionType: BOMProductionType,
|
|
220
|
-
InvoiceStatus: InvoiceStatus,
|
|
221
|
-
CustomOrderRequestStatus: CustomOrderRequestStatus,
|
|
222
|
-
Priority: Priority,
|
|
223
|
-
QuotationStatus: QuotationStatus,
|
|
224
|
-
LockerTransferStatus: LockerTransferStatus,
|
|
225
|
-
BillStatus: BillStatus,
|
|
226
|
-
SalesOrderStatus: SalesOrderStatus,
|
|
227
|
-
RequestStatus: RequestStatus,
|
|
228
|
-
InvitationStatus: InvitationStatus,
|
|
229
|
-
ChargeLevel: ChargeLevel,
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
const enumCustomColors = [
|
|
233
|
-
{ enumClass: 'CustomOrderRequestStatus', colors: customOrderRequestStatusColors },
|
|
234
|
-
{ enumClass: 'Priority', colors: priorityColors },
|
|
235
|
-
{ enumClass: 'QuotationStatus', colors: quotationStatusColors },
|
|
236
|
-
{ enumClass: 'LockerTransferStatus', colors: lockerTransferStatusColors },
|
|
237
|
-
{ enumClass: 'BillStatus', colors: billStatusColors },
|
|
238
|
-
{ enumClass: 'SalesOrderStatus', colors: salesOrderStatusColors },
|
|
239
|
-
{ enumClass: 'RequestStatus', colors: requestStatusColors },
|
|
240
|
-
{ enumClass: 'InvitationStatus', colors: invitationStatusColors },
|
|
241
|
-
{ enumClass: 'BOMProductionType', colors: bomProductionTypeColors },
|
|
242
|
-
];
|
|
243
|
-
|
|
244
|
-
class EnumCustomColorMapping {
|
|
245
|
-
enumClass;
|
|
246
|
-
colors;
|
|
247
|
-
constructor(enumClass, colors) {
|
|
248
|
-
this.enumClass = enumClass;
|
|
249
|
-
if (this.validateColors(enumClass, colors)) {
|
|
250
|
-
this.colors = colors;
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
throw new Error(`The length of your custom colors list does not match the enum class provided.`);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
validateColors(enumClass, colors) {
|
|
257
|
-
// Get the total number of enum values by counting keys
|
|
258
|
-
const enumValues = Object.keys(enumClass).filter(key => isNaN(Number(key))).length;
|
|
259
|
-
return colors.length === enumValues;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
// Function to create EnumCustomColorMapping instances from JSON array
|
|
263
|
-
function createEnumCustomColorMappings(mappings) {
|
|
264
|
-
return mappings.map(json => {
|
|
265
|
-
const enumClass = enumClassMap[json.enumClass];
|
|
266
|
-
if (!enumClass) {
|
|
267
|
-
throw new Error(`Enum class "${json.enumClass}" not found.`);
|
|
268
|
-
}
|
|
269
|
-
return new EnumCustomColorMapping(enumClass, json.colors);
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
const enumCustomColorMappings = createEnumCustomColorMappings(enumCustomColors);
|
|
18
|
+
import * as i3 from '@angular/material/menu';
|
|
19
|
+
import * as i3$1 from '@angular/material/button';
|
|
20
|
+
import { AppMaterialModule } from '@jooler/app-material';
|
|
273
21
|
|
|
274
22
|
class CustomTheme {
|
|
275
23
|
static $joolerBlue = [
|
|
@@ -375,53 +123,6 @@ class CustomTheme {
|
|
|
375
123
|
];
|
|
376
124
|
}
|
|
377
125
|
|
|
378
|
-
var enumCustomLabelMappingsJSON = [
|
|
379
|
-
{
|
|
380
|
-
enumClass: "BOMProductionType",
|
|
381
|
-
labels: [
|
|
382
|
-
"Manufactured In-House",
|
|
383
|
-
"Partially Manufactured In-House"
|
|
384
|
-
]
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
enumClass: "ChargeLevel",
|
|
388
|
-
labels: [
|
|
389
|
-
"Header",
|
|
390
|
-
"Line"
|
|
391
|
-
]
|
|
392
|
-
}
|
|
393
|
-
];
|
|
394
|
-
|
|
395
|
-
class EnumCustomLabelMapping {
|
|
396
|
-
enumClass;
|
|
397
|
-
labels;
|
|
398
|
-
constructor(enumClass, labels) {
|
|
399
|
-
this.enumClass = enumClass;
|
|
400
|
-
if (this.validateLabels(enumClass, labels)) {
|
|
401
|
-
this.labels = labels;
|
|
402
|
-
}
|
|
403
|
-
else {
|
|
404
|
-
throw new Error('The length of your custom labels list does not match the enum class provided.');
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
validateLabels(enumClass, labels) {
|
|
408
|
-
// Get the total number of enum values by counting keys
|
|
409
|
-
const enumValues = Object.keys(enumClass).filter(key => isNaN(Number(key))).length;
|
|
410
|
-
return labels.length === enumValues;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
// Function to create EnumCustomLabelMapping instances from JSON array
|
|
414
|
-
function createEnumCustomLabelMappingsFromJSON(jsonArray) {
|
|
415
|
-
return jsonArray.map(json => {
|
|
416
|
-
const enumClass = enumClassMap[json.enumClass];
|
|
417
|
-
if (!enumClass) {
|
|
418
|
-
throw new Error(`Enum class "${json.enumClass}" not found.`);
|
|
419
|
-
}
|
|
420
|
-
return new EnumCustomLabelMapping(enumClass, json.labels);
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
const enumCustomLabelMappings = createEnumCustomLabelMappingsFromJSON(enumCustomLabelMappingsJSON);
|
|
424
|
-
|
|
425
126
|
class EnumOption {
|
|
426
127
|
value;
|
|
427
128
|
label;
|
|
@@ -461,10 +162,6 @@ class EnumHelperBaseClass {
|
|
|
461
162
|
}
|
|
462
163
|
static getColorsForEnumClass(enumClass, stringValues, customColors) {
|
|
463
164
|
let colors = CustomTheme.$joolerCombo;
|
|
464
|
-
let enumSpecificColors = enumCustomColorMappings.find(item => Object.keys(item.enumClass).toString() == Object.keys(enumClass).toString());
|
|
465
|
-
if (enumSpecificColors) {
|
|
466
|
-
colors = enumSpecificColors.colors;
|
|
467
|
-
}
|
|
468
165
|
if (customColors && customColors.length > 0) {
|
|
469
166
|
colors = customColors;
|
|
470
167
|
}
|
|
@@ -478,29 +175,23 @@ class EnumHelperBaseClass {
|
|
|
478
175
|
}
|
|
479
176
|
static getStringValuesForEnumClass(enumClass, isAllCaps) {
|
|
480
177
|
let stringValues = [];
|
|
481
|
-
let
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
stringValues.push(item);
|
|
490
|
-
let splitStr = item.toLowerCase().split('_');
|
|
491
|
-
if (!isAllCaps) {
|
|
492
|
-
for (let i = 0; i < splitStr.length; i++) {
|
|
493
|
-
splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);
|
|
494
|
-
}
|
|
178
|
+
for (let item in enumClass) {
|
|
179
|
+
if (isNaN(Number(item))) {
|
|
180
|
+
let joinedString;
|
|
181
|
+
stringValues.push(item);
|
|
182
|
+
let splitStr = item.toLowerCase().split('_');
|
|
183
|
+
if (!isAllCaps) {
|
|
184
|
+
for (let i = 0; i < splitStr.length; i++) {
|
|
185
|
+
splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);
|
|
495
186
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
for (let i = 0; i < splitStr.length; i++) {
|
|
190
|
+
splitStr[i] = splitStr[i].toUpperCase();
|
|
500
191
|
}
|
|
501
|
-
joinedString = splitStr.join(' ');
|
|
502
|
-
stringValues.splice(stringValues.indexOf(item), 1, joinedString);
|
|
503
192
|
}
|
|
193
|
+
joinedString = splitStr.join(' ');
|
|
194
|
+
stringValues.splice(stringValues.indexOf(item), 1, joinedString);
|
|
504
195
|
}
|
|
505
196
|
}
|
|
506
197
|
return stringValues;
|
|
@@ -847,6 +538,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
847
538
|
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"] }]
|
|
848
539
|
}], ctorParameters: function () { return []; } });
|
|
849
540
|
|
|
541
|
+
class PrimaryColors {
|
|
542
|
+
static $primaryBlueColor = '#155ED4';
|
|
543
|
+
static $primaryPinkColor = '#F0509C';
|
|
544
|
+
static $primaryTealColor = '#12957E';
|
|
545
|
+
static $primaryCarbonColor = '#32353B';
|
|
546
|
+
static $primaryGrayColor = '#676767';
|
|
547
|
+
static $primaryPurpleColor = '#E3B1EB';
|
|
548
|
+
static $primaryRedColor = '#A80002';
|
|
549
|
+
static $primaryLightRedColor = '#FFDBDB';
|
|
550
|
+
static $primaryLightGrayBlueColor = '#f7f8f9';
|
|
551
|
+
static $primaryLightGrayColor = '#f0f0f0';
|
|
552
|
+
static $primaryLightBlueColor = '#b9cff2';
|
|
553
|
+
static $primaryYellowColor = '#F2CD5C';
|
|
554
|
+
static $primaryOrangeColor = '#F2921D';
|
|
555
|
+
static $primaryLimeGreenColor = '#AFFF00';
|
|
556
|
+
static $primaryNavyBlueColor = '#000080';
|
|
557
|
+
static $primaryOrangeRedColor = '#FF4500';
|
|
558
|
+
static $primaryDarkPurpleColor = '#7600BC';
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
var ChooseObjectTemplateType;
|
|
562
|
+
(function (ChooseObjectTemplateType) {
|
|
563
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["DEFAULT"] = 0] = "DEFAULT";
|
|
564
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["BASIC"] = 1] = "BASIC";
|
|
565
|
+
ChooseObjectTemplateType[ChooseObjectTemplateType["CONTENT_PROJECTION"] = 2] = "CONTENT_PROJECTION";
|
|
566
|
+
})(ChooseObjectTemplateType || (ChooseObjectTemplateType = {}));
|
|
567
|
+
|
|
568
|
+
var ChooseItemFullObjectControlConfig;
|
|
569
|
+
(function (ChooseItemFullObjectControlConfig) {
|
|
570
|
+
ChooseItemFullObjectControlConfig[ChooseItemFullObjectControlConfig["OBJECT"] = 1] = "OBJECT";
|
|
571
|
+
ChooseItemFullObjectControlConfig[ChooseItemFullObjectControlConfig["ID"] = 2] = "ID";
|
|
572
|
+
})(ChooseItemFullObjectControlConfig || (ChooseItemFullObjectControlConfig = {}));
|
|
573
|
+
|
|
574
|
+
class DictionaryToHttpParamsConverter {
|
|
575
|
+
static dictionaryToHttpParamsConverter(form_dictionary) {
|
|
576
|
+
let queryParams = new HttpParams();
|
|
577
|
+
for (let key in form_dictionary) {
|
|
578
|
+
if (form_dictionary[key] !== null &&
|
|
579
|
+
form_dictionary[key] !== '' &&
|
|
580
|
+
form_dictionary[key] !== undefined &&
|
|
581
|
+
form_dictionary[key]?.length !== 0)
|
|
582
|
+
queryParams = queryParams.append(key, form_dictionary[key]);
|
|
583
|
+
}
|
|
584
|
+
return queryParams;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
850
588
|
// import { environment } from '../../environments/environment';
|
|
851
589
|
class ChooseGeneralItemService {
|
|
852
590
|
http;
|
|
@@ -864,6 +602,21 @@ class ChooseGeneralItemService {
|
|
|
864
602
|
});
|
|
865
603
|
return { headers: httpHeaders };
|
|
866
604
|
}
|
|
605
|
+
getHeadersAndParams(dictionary) {
|
|
606
|
+
let httpHeaders;
|
|
607
|
+
const token = localStorage.getItem('token');
|
|
608
|
+
if (token) {
|
|
609
|
+
httpHeaders = new HttpHeaders({
|
|
610
|
+
'Content-Type': 'application/json; charset-utf-8',
|
|
611
|
+
Authorization: 'Token ' + token,
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
615
|
+
httpHeaders = new HttpHeaders();
|
|
616
|
+
}
|
|
617
|
+
const params = DictionaryToHttpParamsConverter.dictionaryToHttpParamsConverter(dictionary);
|
|
618
|
+
return { headers: httpHeaders, params: params };
|
|
619
|
+
}
|
|
867
620
|
getAuthenticationHeadersWithQueryParams(params) {
|
|
868
621
|
const token = localStorage.getItem("token");
|
|
869
622
|
const httpHeaders = new HttpHeaders({
|
|
@@ -872,8 +625,13 @@ class ChooseGeneralItemService {
|
|
|
872
625
|
});
|
|
873
626
|
return { headers: httpHeaders, params: params };
|
|
874
627
|
}
|
|
875
|
-
getData(apiPath) {
|
|
876
|
-
|
|
628
|
+
getData(apiPath, filterParams) {
|
|
629
|
+
if (filterParams) {
|
|
630
|
+
return this.http.get(`${this.env.apiURL}${apiPath}`, this.getHeadersAndParams(filterParams));
|
|
631
|
+
}
|
|
632
|
+
else {
|
|
633
|
+
return this.http.get(`${this.env.apiURL}${apiPath}`, this.getHeaders());
|
|
634
|
+
}
|
|
877
635
|
}
|
|
878
636
|
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 });
|
|
879
637
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemService, providedIn: 'root' });
|
|
@@ -888,22 +646,97 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
888
646
|
args: ['env']
|
|
889
647
|
}] }]; } });
|
|
890
648
|
|
|
649
|
+
var DropdownActionType;
|
|
650
|
+
(function (DropdownActionType) {
|
|
651
|
+
DropdownActionType[DropdownActionType["ADD"] = 0] = "ADD";
|
|
652
|
+
DropdownActionType[DropdownActionType["MENU"] = 1] = "MENU";
|
|
653
|
+
})(DropdownActionType || (DropdownActionType = {}));
|
|
654
|
+
|
|
655
|
+
class DropdownActionsComponent {
|
|
656
|
+
_Router;
|
|
657
|
+
dropdownActionTypes = DropdownActionType;
|
|
658
|
+
canRoute = true;
|
|
659
|
+
disabled;
|
|
660
|
+
labelsAndRoutes = [];
|
|
661
|
+
route;
|
|
662
|
+
dropdownActionType = this.dropdownActionTypes.ADD;
|
|
663
|
+
addClicked = new EventEmitter();
|
|
664
|
+
constructor(_Router) {
|
|
665
|
+
this._Router = _Router;
|
|
666
|
+
}
|
|
667
|
+
ngOnInit() {
|
|
668
|
+
this.validateActions();
|
|
669
|
+
}
|
|
670
|
+
validateActions() {
|
|
671
|
+
if (this.dropdownActionType == this.dropdownActionTypes.ADD) {
|
|
672
|
+
if (this.canRoute) {
|
|
673
|
+
if (this.route == "" || this.route == undefined || this.route == null) {
|
|
674
|
+
throw Error("Route needs to be provided.");
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
else {
|
|
678
|
+
if (this.route) {
|
|
679
|
+
throw Error("Route shouldn't be provided since canRoute is false");
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
else if (this.dropdownActionType == this.dropdownActionTypes.MENU) {
|
|
684
|
+
if (!this.labelsAndRoutes.length) {
|
|
685
|
+
throw Error("A list of labels & Routes need to be provided for the actions menu.");
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
else {
|
|
689
|
+
throw Error("Dropdown Action Type is not recognized.");
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
onClickAdd($event) {
|
|
693
|
+
$event.preventDefault();
|
|
694
|
+
if (this.canRoute && this.route) {
|
|
695
|
+
this._Router.navigate([this.route]);
|
|
696
|
+
}
|
|
697
|
+
this.addClicked.emit();
|
|
698
|
+
}
|
|
699
|
+
onClickLabel(route, $event) {
|
|
700
|
+
$event.preventDefault();
|
|
701
|
+
this._Router.navigate([route]);
|
|
702
|
+
}
|
|
703
|
+
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 });
|
|
704
|
+
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"] }] });
|
|
705
|
+
}
|
|
706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, decorators: [{
|
|
707
|
+
type: Component,
|
|
708
|
+
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"] }]
|
|
709
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }]; }, propDecorators: { canRoute: [{
|
|
710
|
+
type: Input
|
|
711
|
+
}], disabled: [{
|
|
712
|
+
type: Input
|
|
713
|
+
}], labelsAndRoutes: [{
|
|
714
|
+
type: Input
|
|
715
|
+
}], route: [{
|
|
716
|
+
type: Input
|
|
717
|
+
}], dropdownActionType: [{
|
|
718
|
+
type: Input
|
|
719
|
+
}], addClicked: [{
|
|
720
|
+
type: Output
|
|
721
|
+
}] } });
|
|
722
|
+
|
|
891
723
|
class ChooseGeneralItemComponent {
|
|
892
724
|
_ChooseGeneralItemService;
|
|
893
|
-
|
|
725
|
+
dialog;
|
|
726
|
+
_cdr;
|
|
727
|
+
primaryRed = PrimaryColors.$primaryRedColor;
|
|
728
|
+
isLoading = false;
|
|
894
729
|
items;
|
|
895
|
-
label;
|
|
896
|
-
appendTo;
|
|
730
|
+
label = 'label';
|
|
731
|
+
appendTo = 'body';
|
|
897
732
|
placeholder;
|
|
898
733
|
apiPath;
|
|
899
|
-
isMultiple;
|
|
734
|
+
isMultiple = false;
|
|
900
735
|
hideSelectedItem;
|
|
901
736
|
objects;
|
|
902
|
-
showLabel;
|
|
737
|
+
showLabel = false;
|
|
903
738
|
separator;
|
|
904
|
-
width
|
|
905
|
-
fontWeight;
|
|
906
|
-
fontSize;
|
|
739
|
+
width;
|
|
907
740
|
isChip = false;
|
|
908
741
|
isTypeDate;
|
|
909
742
|
chipColor = 'black';
|
|
@@ -911,20 +744,81 @@ class ChooseGeneralItemComponent {
|
|
|
911
744
|
chipWidth = 11;
|
|
912
745
|
selectedItemId;
|
|
913
746
|
disabled;
|
|
747
|
+
readOnly;
|
|
914
748
|
useFullObject = false;
|
|
915
|
-
|
|
749
|
+
showAdd = false;
|
|
750
|
+
dialogComponentClass;
|
|
751
|
+
showDialogDefaultButtons = false;
|
|
752
|
+
dialogComponentInputs = {
|
|
753
|
+
isDialog: true,
|
|
754
|
+
};
|
|
755
|
+
bindValueKey = 'id'; // or null for full object
|
|
756
|
+
addRoute;
|
|
757
|
+
canActionsRoute;
|
|
758
|
+
dialogTitle;
|
|
759
|
+
clearable = true;
|
|
760
|
+
filterParams;
|
|
761
|
+
templateType = ChooseObjectTemplateType.DEFAULT;
|
|
762
|
+
basicTemplateData;
|
|
763
|
+
contentProjectionLabelKey;
|
|
764
|
+
fullObjectControlConfig = ChooseItemFullObjectControlConfig.ID;
|
|
765
|
+
change = new EventEmitter();
|
|
766
|
+
blur = new EventEmitter();
|
|
767
|
+
customOptionTemplate;
|
|
768
|
+
ChooseObjectTemplateType = ChooseObjectTemplateType;
|
|
769
|
+
chipInputTypes = ChipInputType;
|
|
770
|
+
constructor(_ChooseGeneralItemService, dialog, _cdr) {
|
|
916
771
|
this._ChooseGeneralItemService = _ChooseGeneralItemService;
|
|
772
|
+
this.dialog = dialog;
|
|
773
|
+
this._cdr = _cdr;
|
|
917
774
|
}
|
|
918
775
|
ngOnInit() {
|
|
919
|
-
if (
|
|
776
|
+
if (this.templateType == ChooseObjectTemplateType.BASIC) {
|
|
777
|
+
this.setupBasicTemplate();
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
setupBasicTemplate() { }
|
|
781
|
+
ngOnChanges(changes) {
|
|
782
|
+
if (changes['items'] && !changes.items) {
|
|
783
|
+
this.items = undefined;
|
|
784
|
+
}
|
|
785
|
+
if (changes['apiPath'] && !changes.apiPath) {
|
|
786
|
+
this.apiPath = undefined;
|
|
787
|
+
}
|
|
788
|
+
this.validateInputs(changes);
|
|
789
|
+
if (this.showAdd) {
|
|
790
|
+
this.validateAddConfiguration();
|
|
791
|
+
}
|
|
792
|
+
if (!changes['items'] || !changes['items'].currentValue) {
|
|
793
|
+
this.isLoading = true;
|
|
920
794
|
this.getData();
|
|
795
|
+
}
|
|
796
|
+
else {
|
|
797
|
+
this.isLoading = false;
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
validateAddConfiguration() {
|
|
801
|
+
if ((this.addRoute == '' || this.addRoute == null || this.addRoute == undefined) &&
|
|
802
|
+
(this.dialogComponentClass == null || this.dialogComponentClass == undefined)) {
|
|
803
|
+
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.');
|
|
804
|
+
}
|
|
921
805
|
}
|
|
922
806
|
writeValue(item) {
|
|
923
|
-
if (item != undefined) {
|
|
924
|
-
this.
|
|
807
|
+
if (item != undefined || item != null) {
|
|
808
|
+
if (!this.useFullObject) {
|
|
809
|
+
this.selectedItemId = item;
|
|
810
|
+
}
|
|
811
|
+
else {
|
|
812
|
+
if (Array.isArray(item)) {
|
|
813
|
+
this.selectedItemId = item.map(item => item.id);
|
|
814
|
+
}
|
|
815
|
+
else {
|
|
816
|
+
this.selectedItemId = item.id;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
925
819
|
}
|
|
926
|
-
else
|
|
927
|
-
this.selectedItemId =
|
|
820
|
+
else {
|
|
821
|
+
this.selectedItemId = null;
|
|
928
822
|
}
|
|
929
823
|
}
|
|
930
824
|
registerOnChange(fn) {
|
|
@@ -935,44 +829,116 @@ class ChooseGeneralItemComponent {
|
|
|
935
829
|
}
|
|
936
830
|
propagateChange = (_) => { };
|
|
937
831
|
propogateTouch = () => { };
|
|
832
|
+
onValidationChange = () => { };
|
|
938
833
|
updateBlur() {
|
|
939
834
|
this.propogateTouch();
|
|
835
|
+
this.blur.emit();
|
|
940
836
|
}
|
|
941
837
|
onSelectedItemChanged($event) {
|
|
942
|
-
|
|
943
|
-
|
|
838
|
+
let valueToPropagate;
|
|
839
|
+
if (this.fullObjectControlConfig == ChooseItemFullObjectControlConfig.ID) {
|
|
840
|
+
valueToPropagate = this.selectedItemId;
|
|
841
|
+
}
|
|
842
|
+
else if (this.fullObjectControlConfig == ChooseItemFullObjectControlConfig.OBJECT) {
|
|
843
|
+
valueToPropagate = $event;
|
|
844
|
+
}
|
|
845
|
+
else {
|
|
846
|
+
throw Error('ChooseItemFullObjectControlConfig is not recognized.');
|
|
847
|
+
}
|
|
848
|
+
this.propagateChange(valueToPropagate);
|
|
849
|
+
this.change.emit($event);
|
|
850
|
+
this.onValidationChange();
|
|
851
|
+
}
|
|
852
|
+
validateInputs(changes) {
|
|
853
|
+
if (changes.apiPath &&
|
|
854
|
+
changes.apiPath.currentValue &&
|
|
855
|
+
changes.items &&
|
|
856
|
+
changes.items.currentValue) {
|
|
857
|
+
throw Error('Both an API path and an items list was provided.');
|
|
858
|
+
}
|
|
944
859
|
}
|
|
945
860
|
getData() {
|
|
946
861
|
if (this.apiPath) {
|
|
947
|
-
this._ChooseGeneralItemService.getData(this.apiPath).subscribe({
|
|
862
|
+
this._ChooseGeneralItemService.getData(this.apiPath, this.filterParams).subscribe({
|
|
948
863
|
next: (response) => {
|
|
949
864
|
this.items = response;
|
|
865
|
+
this.isLoading = false;
|
|
866
|
+
this._cdr.markForCheck();
|
|
867
|
+
console.log("response: items from '", this.apiPath, "' found: ", this.items);
|
|
950
868
|
},
|
|
951
|
-
error:
|
|
869
|
+
error: error => console.error('error', error),
|
|
952
870
|
});
|
|
953
871
|
}
|
|
954
872
|
}
|
|
955
873
|
setWidth() {
|
|
956
|
-
let style = {
|
|
957
|
-
|
|
958
|
-
|
|
874
|
+
let style = {};
|
|
875
|
+
if (this.width) {
|
|
876
|
+
style = {
|
|
877
|
+
width: this.width + 'rem',
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
else {
|
|
881
|
+
style = {
|
|
882
|
+
width: '100%',
|
|
883
|
+
};
|
|
884
|
+
}
|
|
959
885
|
return style;
|
|
960
886
|
}
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
887
|
+
onClickAddNew() {
|
|
888
|
+
console.log('DYNAMIC DIALOG NOT IMPLEMENTED IN LIBRARY YET');
|
|
889
|
+
// Add dynamic dialog later
|
|
890
|
+
// let dialogRef = this.dialog.open(DynamicDialogComponent, {
|
|
891
|
+
// panelClass: 'custom-dialog-padding',
|
|
892
|
+
// width: '90%',
|
|
893
|
+
// minWidth: '90%',
|
|
894
|
+
// maxHeight: '90vh',
|
|
895
|
+
// data: {
|
|
896
|
+
// component: this.dialogComponentClass,
|
|
897
|
+
// showDefaultButtons: this.showDialogDefaultButtons,
|
|
898
|
+
// title: this.dialogTitle,
|
|
899
|
+
// inputs: this.dialogComponentInputs,
|
|
900
|
+
// },
|
|
901
|
+
// });
|
|
902
|
+
// dialogRef.afterClosed().subscribe((data: any) => {
|
|
903
|
+
// if (data) {
|
|
904
|
+
// console.log('New item Added: ', data);
|
|
905
|
+
// this.items.push(data);
|
|
906
|
+
// this.items = [...this.items];
|
|
907
|
+
// }
|
|
908
|
+
// });
|
|
967
909
|
}
|
|
968
|
-
|
|
969
|
-
|
|
910
|
+
setDisabledState(isDisabled) {
|
|
911
|
+
this.disabled = isDisabled;
|
|
912
|
+
}
|
|
913
|
+
registerOnValidatorChange(fn) {
|
|
914
|
+
this.onValidationChange = fn;
|
|
915
|
+
}
|
|
916
|
+
validate(control) {
|
|
917
|
+
return null;
|
|
918
|
+
if (control) {
|
|
919
|
+
const errors = control.errors;
|
|
920
|
+
if (errors) {
|
|
921
|
+
console.log('errorssss: ', errors);
|
|
922
|
+
return errors;
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
return null;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
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 });
|
|
930
|
+
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: [
|
|
970
931
|
{
|
|
971
932
|
provide: NG_VALUE_ACCESSOR,
|
|
972
933
|
useExisting: forwardRef(() => ChooseGeneralItemComponent),
|
|
973
934
|
multi: true,
|
|
974
935
|
},
|
|
975
|
-
|
|
936
|
+
{
|
|
937
|
+
provide: NG_VALIDATORS,
|
|
938
|
+
useExisting: ChooseGeneralItemComponent,
|
|
939
|
+
multi: true,
|
|
940
|
+
},
|
|
941
|
+
], 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" }] });
|
|
976
942
|
}
|
|
977
943
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemComponent, decorators: [{
|
|
978
944
|
type: Component,
|
|
@@ -982,10 +948,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
982
948
|
useExisting: forwardRef(() => ChooseGeneralItemComponent),
|
|
983
949
|
multi: true,
|
|
984
950
|
},
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
951
|
+
{
|
|
952
|
+
provide: NG_VALIDATORS,
|
|
953
|
+
useExisting: ChooseGeneralItemComponent,
|
|
954
|
+
multi: true,
|
|
955
|
+
},
|
|
956
|
+
], 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"] }]
|
|
957
|
+
}], ctorParameters: function () { return [{ type: ChooseGeneralItemService }, { type: i2$3.MatDialog }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { items: [{
|
|
989
958
|
type: Input
|
|
990
959
|
}], label: [{
|
|
991
960
|
type: Input
|
|
@@ -1007,10 +976,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1007
976
|
type: Input
|
|
1008
977
|
}], width: [{
|
|
1009
978
|
type: Input
|
|
1010
|
-
}], fontWeight: [{
|
|
1011
|
-
type: Input
|
|
1012
|
-
}], fontSize: [{
|
|
1013
|
-
type: Input
|
|
1014
979
|
}], isChip: [{
|
|
1015
980
|
type: Input
|
|
1016
981
|
}], isTypeDate: [{
|
|
@@ -1025,8 +990,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1025
990
|
type: Input
|
|
1026
991
|
}], disabled: [{
|
|
1027
992
|
type: Input
|
|
993
|
+
}], readOnly: [{
|
|
994
|
+
type: Input
|
|
1028
995
|
}], useFullObject: [{
|
|
1029
996
|
type: Input
|
|
997
|
+
}], showAdd: [{
|
|
998
|
+
type: Input
|
|
999
|
+
}], dialogComponentClass: [{
|
|
1000
|
+
type: Input
|
|
1001
|
+
}], showDialogDefaultButtons: [{
|
|
1002
|
+
type: Input
|
|
1003
|
+
}], dialogComponentInputs: [{
|
|
1004
|
+
type: Input
|
|
1005
|
+
}], bindValueKey: [{
|
|
1006
|
+
type: Input
|
|
1007
|
+
}], addRoute: [{
|
|
1008
|
+
type: Input
|
|
1009
|
+
}], canActionsRoute: [{
|
|
1010
|
+
type: Input
|
|
1011
|
+
}], dialogTitle: [{
|
|
1012
|
+
type: Input
|
|
1013
|
+
}], clearable: [{
|
|
1014
|
+
type: Input
|
|
1015
|
+
}], filterParams: [{
|
|
1016
|
+
type: Input
|
|
1017
|
+
}], templateType: [{
|
|
1018
|
+
type: Input
|
|
1019
|
+
}], basicTemplateData: [{
|
|
1020
|
+
type: Input
|
|
1021
|
+
}], contentProjectionLabelKey: [{
|
|
1022
|
+
type: Input
|
|
1023
|
+
}], fullObjectControlConfig: [{
|
|
1024
|
+
type: Input
|
|
1025
|
+
}], change: [{
|
|
1026
|
+
type: Output
|
|
1027
|
+
}], blur: [{
|
|
1028
|
+
type: Output
|
|
1029
|
+
}], customOptionTemplate: [{
|
|
1030
|
+
type: ContentChild,
|
|
1031
|
+
args: ['customOption']
|
|
1030
1032
|
}] } });
|
|
1031
1033
|
|
|
1032
1034
|
class ChooseGeneralItemRendererComponent {
|
|
@@ -1056,11 +1058,11 @@ class ChooseGeneralItemRendererComponent {
|
|
|
1056
1058
|
return true;
|
|
1057
1059
|
}
|
|
1058
1060
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1059
|
-
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\"
|
|
1061
|
+
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"] }] });
|
|
1060
1062
|
}
|
|
1061
1063
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ChooseGeneralItemRendererComponent, decorators: [{
|
|
1062
1064
|
type: Component,
|
|
1063
|
-
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\"
|
|
1065
|
+
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"] }]
|
|
1064
1066
|
}], ctorParameters: function () { return []; } });
|
|
1065
1067
|
|
|
1066
1068
|
var LineType;
|
|
@@ -1365,7 +1367,7 @@ class EditableSavableInputComponent {
|
|
|
1365
1367
|
useExisting: forwardRef(() => EditableSavableInputComponent),
|
|
1366
1368
|
multi: true
|
|
1367
1369
|
}
|
|
1368
|
-
], 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" }] });
|
|
1370
|
+
], 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" }] });
|
|
1369
1371
|
}
|
|
1370
1372
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: EditableSavableInputComponent, decorators: [{
|
|
1371
1373
|
type: Component,
|
|
@@ -1759,80 +1761,6 @@ class LabelAndField {
|
|
|
1759
1761
|
field;
|
|
1760
1762
|
}
|
|
1761
1763
|
|
|
1762
|
-
var DropdownActionType;
|
|
1763
|
-
(function (DropdownActionType) {
|
|
1764
|
-
DropdownActionType[DropdownActionType["ADD"] = 0] = "ADD";
|
|
1765
|
-
DropdownActionType[DropdownActionType["MENU"] = 1] = "MENU";
|
|
1766
|
-
})(DropdownActionType || (DropdownActionType = {}));
|
|
1767
|
-
|
|
1768
|
-
class DropdownActionsComponent {
|
|
1769
|
-
_Router;
|
|
1770
|
-
dropdownActionTypes = DropdownActionType;
|
|
1771
|
-
canRoute = true;
|
|
1772
|
-
disabled;
|
|
1773
|
-
labelsAndRoutes = [];
|
|
1774
|
-
route;
|
|
1775
|
-
dropdownActionType = this.dropdownActionTypes.ADD;
|
|
1776
|
-
addClicked = new EventEmitter();
|
|
1777
|
-
constructor(_Router) {
|
|
1778
|
-
this._Router = _Router;
|
|
1779
|
-
}
|
|
1780
|
-
ngOnInit() {
|
|
1781
|
-
this.validateActions();
|
|
1782
|
-
}
|
|
1783
|
-
validateActions() {
|
|
1784
|
-
if (this.dropdownActionType == this.dropdownActionTypes.ADD) {
|
|
1785
|
-
if (this.canRoute) {
|
|
1786
|
-
if (this.route == "" || this.route == undefined || this.route == null) {
|
|
1787
|
-
throw Error("Route needs to be provided.");
|
|
1788
|
-
}
|
|
1789
|
-
}
|
|
1790
|
-
else {
|
|
1791
|
-
if (this.route) {
|
|
1792
|
-
throw Error("Route shouldn't be provided since canRoute is false");
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
}
|
|
1796
|
-
else if (this.dropdownActionType == this.dropdownActionTypes.MENU) {
|
|
1797
|
-
if (!this.labelsAndRoutes.length) {
|
|
1798
|
-
throw Error("A list of labels & Routes need to be provided for the actions menu.");
|
|
1799
|
-
}
|
|
1800
|
-
}
|
|
1801
|
-
else {
|
|
1802
|
-
throw Error("Dropdown Action Type is not recognized.");
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
onClickAdd($event) {
|
|
1806
|
-
$event.preventDefault();
|
|
1807
|
-
if (this.canRoute && this.route) {
|
|
1808
|
-
this._Router.navigate([this.route]);
|
|
1809
|
-
}
|
|
1810
|
-
this.addClicked.emit();
|
|
1811
|
-
}
|
|
1812
|
-
onClickLabel(route, $event) {
|
|
1813
|
-
$event.preventDefault();
|
|
1814
|
-
this._Router.navigate([route]);
|
|
1815
|
-
}
|
|
1816
|
-
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 });
|
|
1817
|
-
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"] }] });
|
|
1818
|
-
}
|
|
1819
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownActionsComponent, decorators: [{
|
|
1820
|
-
type: Component,
|
|
1821
|
-
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"] }]
|
|
1822
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }]; }, propDecorators: { canRoute: [{
|
|
1823
|
-
type: Input
|
|
1824
|
-
}], disabled: [{
|
|
1825
|
-
type: Input
|
|
1826
|
-
}], labelsAndRoutes: [{
|
|
1827
|
-
type: Input
|
|
1828
|
-
}], route: [{
|
|
1829
|
-
type: Input
|
|
1830
|
-
}], dropdownActionType: [{
|
|
1831
|
-
type: Input
|
|
1832
|
-
}], addClicked: [{
|
|
1833
|
-
type: Output
|
|
1834
|
-
}] } });
|
|
1835
|
-
|
|
1836
1764
|
class AddAsteriskDirective {
|
|
1837
1765
|
elem;
|
|
1838
1766
|
show = true;
|