cat-qw-lib 2.6.38 → 2.6.39
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/fesm2022/cat-qw-lib.mjs +161 -231
- package/fesm2022/cat-qw-lib.mjs.map +1 -1
- package/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.d.ts +15 -27
- package/lib/admin/widget-admin/components/widget-admin-form/widget-admin-form.component.d.ts.map +1 -1
- package/lib/admin/widget-admin/state/widget-admin.service.d.ts.map +1 -1
- package/lib/shared/_base/base-form/base-form.component.d.ts.map +1 -1
- package/package.json +1 -1
package/fesm2022/cat-qw-lib.mjs
CHANGED
|
@@ -4107,15 +4107,12 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4107
4107
|
baseStore;
|
|
4108
4108
|
baseQuery;
|
|
4109
4109
|
widgetItem;
|
|
4110
|
-
widgetItems = [];
|
|
4111
4110
|
dictionaries = [];
|
|
4112
4111
|
headerDictionaryItems = [];
|
|
4113
4112
|
subHeaderDictionaryItems = [];
|
|
4114
4113
|
dictionaryItemArray = [];
|
|
4115
4114
|
badgeDictionaryItemArray = [];
|
|
4116
|
-
widgetOptionsArray = [];
|
|
4117
4115
|
widgetLayoutTypeList = widgetLayoutTypeList;
|
|
4118
|
-
enableDictionaryDebugLogs = true;
|
|
4119
4116
|
constructor(service, validatorService, widgetStore, query, router, activatedRoute, baseStore, baseQuery) {
|
|
4120
4117
|
super(service, validatorService, router, activatedRoute);
|
|
4121
4118
|
this.service = service;
|
|
@@ -4135,94 +4132,31 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4135
4132
|
ngOnInit() {
|
|
4136
4133
|
super.init();
|
|
4137
4134
|
this.baseStore.setIsApiValidated(null);
|
|
4138
|
-
this.recordChange
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
// Ignore initial empty emissions to avoid clearing edit values before actual record arrives.
|
|
4145
|
-
if (!hasRecord) {
|
|
4135
|
+
this.recordChange
|
|
4136
|
+
.asObservable()
|
|
4137
|
+
.pipe(takeUntil(this.destroy$))
|
|
4138
|
+
.subscribe((record) => {
|
|
4139
|
+
const hasRecord = !!record && (!!record._id || !!record.apiConfigId || (record.dataItems?.length ?? 0) > 0 || (record.badges?.length ?? 0) > 0 || !!record.headerDictionaryID);
|
|
4140
|
+
if (!hasRecord)
|
|
4146
4141
|
return;
|
|
4147
|
-
}
|
|
4148
|
-
// recordChange can emit readonly store objects; clone before normalization/mutation.
|
|
4149
4142
|
const editableRecord = structuredClone((record || {}));
|
|
4150
4143
|
const withAliases = this.normalizeIncomingDictionaryAliases(editableRecord);
|
|
4151
4144
|
const withStyles = this.normalizeLoadedRecordStyles(withAliases);
|
|
4152
4145
|
this.record = withStyles;
|
|
4153
|
-
// Hydrate dependent dictionary-item dropdown arrays immediately on edit load.
|
|
4154
4146
|
this.refreshDictionaryItemListsForRecord();
|
|
4155
|
-
|
|
4156
|
-
this.handleAPIChange(this.record.apiConfigId);
|
|
4147
|
+
this.handleApiConfigChange(this.record.apiConfigId);
|
|
4157
4148
|
});
|
|
4158
4149
|
}
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
syncRowDictionaryKeys(row) {
|
|
4164
|
-
const dictionaryId = row?.dataDictionaryId || row?.dictionaryID || '';
|
|
4165
|
-
const dictionaryItemId = row?.dictionaryItemId || row?.dictionaryItemID || '';
|
|
4166
|
-
return {
|
|
4167
|
-
...row,
|
|
4168
|
-
dataDictionaryId: dictionaryId,
|
|
4169
|
-
dictionaryID: dictionaryId,
|
|
4170
|
-
dictionaryItemId: dictionaryItemId,
|
|
4171
|
-
dictionaryItemID: dictionaryItemId,
|
|
4172
|
-
};
|
|
4173
|
-
}
|
|
4174
|
-
/**
|
|
4175
|
-
* Normalize backend dictionary keys into UI form keys on edit load.
|
|
4176
|
-
* This lets dropdowns preselect values immediately without user re-selection.
|
|
4177
|
-
*/
|
|
4178
|
-
normalizeIncomingDictionaryAliases(record) {
|
|
4179
|
-
return {
|
|
4180
|
-
...record,
|
|
4181
|
-
dataItems: (record.dataItems || []).map((item) => this.syncRowDictionaryKeys(item)),
|
|
4182
|
-
badges: (record.badges || []).map((badge) => this.syncRowDictionaryKeys(badge)),
|
|
4183
|
-
};
|
|
4184
|
-
}
|
|
4185
|
-
handleWidgetItemAddBtnClick() {
|
|
4186
|
-
if (!(this.record.name && this.record.apiConfigId))
|
|
4187
|
-
return;
|
|
4188
|
-
if (Array.isArray(this.record.dataItems)) {
|
|
4189
|
-
const hasEmptyItem = this.record.dataItems.some((item) => {
|
|
4190
|
-
const isItemNameEmpty = !item.name || item.name.trim() === SHARED.EMPTY;
|
|
4191
|
-
const dictionaryId = item.dataDictionaryId || item.dictionaryID;
|
|
4192
|
-
const dictionaryItemId = item.dictionaryItemId || item.dictionaryItemID;
|
|
4193
|
-
const isDictionaryEmpty = !dictionaryId || dictionaryId.trim() === SHARED.EMPTY;
|
|
4194
|
-
const isDictionaryItemEmpty = !dictionaryItemId || dictionaryItemId.trim() === SHARED.EMPTY;
|
|
4195
|
-
return isItemNameEmpty && isDictionaryItemEmpty && isDictionaryEmpty;
|
|
4196
|
-
});
|
|
4197
|
-
if (hasEmptyItem) {
|
|
4198
|
-
return;
|
|
4199
|
-
}
|
|
4200
|
-
}
|
|
4201
|
-
else {
|
|
4202
|
-
this.record.dataItems = [];
|
|
4203
|
-
}
|
|
4204
|
-
this.record.dataItems = [...this.record.dataItems, new WidgetItemModel()];
|
|
4205
|
-
this.dictionaryItemArray = [...this.dictionaryItemArray, []];
|
|
4206
|
-
}
|
|
4207
|
-
handleAPIChange(apiConfigId) {
|
|
4208
|
-
this.query.getLists().subscribe((allLists) => {
|
|
4150
|
+
handleApiConfigChange(apiConfigId) {
|
|
4151
|
+
this.query.getLists()
|
|
4152
|
+
.pipe(takeUntil(this.destroy$))
|
|
4153
|
+
.subscribe((allLists) => {
|
|
4209
4154
|
const dictionaryListMeta = allLists.find((list) => list.forProperty === 'dataDictionaryId' || list.forProperty === 'dictionaryID');
|
|
4210
4155
|
const allDictionaryRecords = dictionaryListMeta?.records;
|
|
4211
|
-
if (this.enableDictionaryDebugLogs) {
|
|
4212
|
-
console.log('[WidgetAdmin] dictionary list resolved', {
|
|
4213
|
-
expectedForProperty: ['dataDictionaryId', 'dictionaryID'],
|
|
4214
|
-
actualForProperty: dictionaryListMeta?.forProperty,
|
|
4215
|
-
dataSource: dictionaryListMeta?.dataSource,
|
|
4216
|
-
totalRecords: allDictionaryRecords?.length || 0,
|
|
4217
|
-
selectedApiConfigId: apiConfigId
|
|
4218
|
-
});
|
|
4219
|
-
}
|
|
4220
4156
|
if (apiConfigId) {
|
|
4221
|
-
this.dictionaries =
|
|
4222
|
-
allDictionaryRecords?.filter((item) => String(item.apiConfigId ?? item.apiConfigID ?? '') === String(apiConfigId ?? '')) || [];
|
|
4157
|
+
this.dictionaries = allDictionaryRecords?.filter((item) => String(item.apiConfigId ?? item.apiConfigID ?? '') === String(apiConfigId ?? '')) || [];
|
|
4223
4158
|
}
|
|
4224
4159
|
else {
|
|
4225
|
-
// Edit fallback when apiConfigId is not yet available: keep dictionaries needed by currently selected IDs.
|
|
4226
4160
|
const selectedDictionaryIds = new Set();
|
|
4227
4161
|
if (this.record?.headerDictionaryID)
|
|
4228
4162
|
selectedDictionaryIds.add(String(this.record.headerDictionaryID));
|
|
@@ -4240,123 +4174,43 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4240
4174
|
});
|
|
4241
4175
|
this.dictionaries = (allDictionaryRecords || []).filter((d) => selectedDictionaryIds.has(String(d?._id)));
|
|
4242
4176
|
}
|
|
4243
|
-
|
|
4244
|
-
console.log('[WidgetAdmin] dictionary records after apiConfigId filter', {
|
|
4245
|
-
selectedApiConfigId: apiConfigId,
|
|
4246
|
-
filteredCount: this.dictionaries.length,
|
|
4247
|
-
});
|
|
4248
|
-
}
|
|
4249
|
-
this.refreshDictionaryItemListsForRecord();
|
|
4250
|
-
});
|
|
4251
|
-
}
|
|
4252
|
-
/**
|
|
4253
|
-
* Rebuilds header/subheader/widget-item/badge dictionary item options from list data
|
|
4254
|
-
* after apiConfigId changes (or on initial load). Single list read avoids races from N subscriptions.
|
|
4255
|
-
*/
|
|
4256
|
-
refreshDictionaryItemListsForRecord() {
|
|
4257
|
-
this.query.getLists().subscribe((allLists) => {
|
|
4258
|
-
const dictionaryItemListMeta = allLists.find((list) => list.forProperty === 'dictionaryItemId' || list.forProperty === 'dictionaryItemID');
|
|
4259
|
-
const allDictionaryItemRecords = dictionaryItemListMeta?.records || [];
|
|
4260
|
-
if (this.enableDictionaryDebugLogs) {
|
|
4261
|
-
console.log('[WidgetAdmin] dictionary item list resolved', {
|
|
4262
|
-
expectedForProperty: ['dictionaryItemId', 'dictionaryItemID'],
|
|
4263
|
-
actualForProperty: dictionaryItemListMeta?.forProperty,
|
|
4264
|
-
dataSource: dictionaryItemListMeta?.dataSource,
|
|
4265
|
-
totalRecords: allDictionaryItemRecords.length,
|
|
4266
|
-
});
|
|
4267
|
-
}
|
|
4268
|
-
const itemsForDictionary = (dictionaryId) => this.getDictionaryItemsByDictionaryId(allDictionaryItemRecords, dictionaryId);
|
|
4269
|
-
// Edit payload can miss dictionaryID/dataDictionaryId while providing dictionaryItemID.
|
|
4270
|
-
// Infer dictionary ids first so dictionary dropdowns can preselect correctly.
|
|
4271
|
-
this.hydrateMissingDictionaryIdsFromItemSelection(allDictionaryItemRecords);
|
|
4272
|
-
const r = this.record;
|
|
4273
|
-
this.headerDictionaryItems = itemsForDictionary(r.headerDictionaryID);
|
|
4274
|
-
this.subHeaderDictionaryItems = itemsForDictionary(r.subHeaderDictionaryID);
|
|
4275
|
-
this.dictionaryItemArray = (r.dataItems || []).map((item) => itemsForDictionary(item.dataDictionaryId || item.dictionaryID));
|
|
4276
|
-
this.badgeDictionaryItemArray = (r.badges || []).map((badge) => itemsForDictionary(badge.dataDictionaryId || badge.dictionaryID));
|
|
4177
|
+
this.applyDictionaryItemListsFromLists(allLists);
|
|
4277
4178
|
});
|
|
4278
4179
|
}
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
const inferredDictionaryId = inferDictionaryId(dictionaryItemId);
|
|
4291
|
-
const resolvedDictId = currentDictionaryId || inferredDictionaryId || this.record.headerDictionaryID || '';
|
|
4292
|
-
return this.syncRowDictionaryKeys({
|
|
4293
|
-
...item,
|
|
4294
|
-
dataDictionaryId: resolvedDictId,
|
|
4295
|
-
dictionaryID: resolvedDictId,
|
|
4296
|
-
dictionaryItemId: dictionaryItemId,
|
|
4297
|
-
dictionaryItemID: dictionaryItemId,
|
|
4298
|
-
});
|
|
4299
|
-
});
|
|
4300
|
-
this.record.badges = (this.record.badges || []).map((badge) => {
|
|
4301
|
-
const currentDictionaryId = badge?.dataDictionaryId || badge?.dictionaryID || '';
|
|
4302
|
-
const dictionaryItemId = badge?.dictionaryItemId || badge?.dictionaryItemID || '';
|
|
4303
|
-
const inferredDictionaryId = inferDictionaryId(dictionaryItemId);
|
|
4304
|
-
const resolvedDictId = currentDictionaryId || inferredDictionaryId || this.record.headerDictionaryID || '';
|
|
4305
|
-
return this.syncRowDictionaryKeys({
|
|
4306
|
-
...badge,
|
|
4307
|
-
dataDictionaryId: resolvedDictId,
|
|
4308
|
-
dictionaryID: resolvedDictId,
|
|
4309
|
-
dictionaryItemId: dictionaryItemId,
|
|
4310
|
-
dictionaryItemID: dictionaryItemId,
|
|
4180
|
+
handleWidgetItemAddBtnClick() {
|
|
4181
|
+
if (!(this.record.name && this.record.apiConfigId))
|
|
4182
|
+
return;
|
|
4183
|
+
if (Array.isArray(this.record.dataItems)) {
|
|
4184
|
+
const hasEmptyItem = this.record.dataItems.some((item) => {
|
|
4185
|
+
const isItemNameEmpty = !item.name || item.name.trim() === SHARED.EMPTY;
|
|
4186
|
+
const dictionaryId = item.dataDictionaryId || item.dictionaryID;
|
|
4187
|
+
const dictionaryItemId = item.dictionaryItemId || item.dictionaryItemID;
|
|
4188
|
+
const isDictionaryEmpty = !dictionaryId || dictionaryId.trim() === SHARED.EMPTY;
|
|
4189
|
+
const isDictionaryItemEmpty = !dictionaryItemId || dictionaryItemId.trim() === SHARED.EMPTY;
|
|
4190
|
+
return isItemNameEmpty && isDictionaryItemEmpty && isDictionaryEmpty;
|
|
4311
4191
|
});
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
getDictionaryItemsByDictionaryId(allDictionaryItemRecords, dictionaryId) {
|
|
4315
|
-
if (!dictionaryId) {
|
|
4316
|
-
return [];
|
|
4317
|
-
}
|
|
4318
|
-
const byLegacyDictionaryId = allDictionaryItemRecords.filter((item) => item.dataDictionaryId === dictionaryId || item.dictionaryID === dictionaryId);
|
|
4319
|
-
if (byLegacyDictionaryId.length > 0) {
|
|
4320
|
-
if (this.enableDictionaryDebugLogs) {
|
|
4321
|
-
console.log('[WidgetAdmin] dictionary items matched by dictionary id relation', {
|
|
4322
|
-
dictionaryId,
|
|
4323
|
-
matchedCount: byLegacyDictionaryId.length
|
|
4324
|
-
});
|
|
4325
|
-
}
|
|
4326
|
-
return byLegacyDictionaryId;
|
|
4327
|
-
}
|
|
4328
|
-
const selectedDictionary = this.dictionaries.find((d) => d._id === dictionaryId);
|
|
4329
|
-
const dictionaryItemsIds = selectedDictionary?.dictionaryItemsIds || [];
|
|
4330
|
-
if (!Array.isArray(dictionaryItemsIds) || dictionaryItemsIds.length === 0) {
|
|
4331
|
-
return [];
|
|
4192
|
+
if (hasEmptyItem)
|
|
4193
|
+
return;
|
|
4332
4194
|
}
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
if (this.enableDictionaryDebugLogs) {
|
|
4336
|
-
console.log('[WidgetAdmin] dictionary items matched by dictionaryItemsIds fallback', {
|
|
4337
|
-
dictionaryId,
|
|
4338
|
-
dictionaryItemsIdsCount: dictionaryItemsIds.length,
|
|
4339
|
-
matchedCount: byDictionaryItemsIds.length
|
|
4340
|
-
});
|
|
4195
|
+
else {
|
|
4196
|
+
this.record.dataItems = [];
|
|
4341
4197
|
}
|
|
4342
|
-
|
|
4198
|
+
this.record.dataItems = [...this.record.dataItems, new WidgetItemModel()];
|
|
4199
|
+
this.dictionaryItemArray = [...this.dictionaryItemArray, []];
|
|
4343
4200
|
}
|
|
4344
4201
|
handleHeaderDictionarySelect(dictionaryId) {
|
|
4345
|
-
this.
|
|
4346
|
-
|
|
4347
|
-
this.headerDictionaryItems = this.getDictionaryItemsByDictionaryId(allDictionaryItemRecords || [], dictionaryId);
|
|
4202
|
+
this.setDictionaryItemsForDictionaryId(dictionaryId, (items) => {
|
|
4203
|
+
this.headerDictionaryItems = items;
|
|
4348
4204
|
});
|
|
4349
4205
|
}
|
|
4350
4206
|
handleSubHeaderDictionarySelect(dictionaryId) {
|
|
4351
|
-
this.
|
|
4352
|
-
|
|
4353
|
-
this.subHeaderDictionaryItems = this.getDictionaryItemsByDictionaryId(allDictionaryItemRecords || [], dictionaryId);
|
|
4207
|
+
this.setDictionaryItemsForDictionaryId(dictionaryId, (items) => {
|
|
4208
|
+
this.subHeaderDictionaryItems = items;
|
|
4354
4209
|
});
|
|
4355
4210
|
}
|
|
4356
4211
|
handleWidgetItemDictionarySelect(dictionaryId, index) {
|
|
4357
|
-
this.
|
|
4358
|
-
|
|
4359
|
-
this.dictionaryItemArray[index] = this.getDictionaryItemsByDictionaryId(allDictionaryItemRecords || [], dictionaryId);
|
|
4212
|
+
this.setDictionaryItemsForDictionaryId(dictionaryId, (items) => {
|
|
4213
|
+
this.dictionaryItemArray[index] = items;
|
|
4360
4214
|
});
|
|
4361
4215
|
}
|
|
4362
4216
|
handleBadgeAddBtnClick() {
|
|
@@ -4370,9 +4224,8 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4370
4224
|
const isDictionaryItemEmpty = !dictionaryItemId || dictionaryItemId.trim() === SHARED.EMPTY;
|
|
4371
4225
|
return isDictionaryItemEmpty && isDictionaryEmpty;
|
|
4372
4226
|
});
|
|
4373
|
-
if (hasEmptyBadge)
|
|
4227
|
+
if (hasEmptyBadge)
|
|
4374
4228
|
return;
|
|
4375
|
-
}
|
|
4376
4229
|
}
|
|
4377
4230
|
else {
|
|
4378
4231
|
this.record.badges = [];
|
|
@@ -4381,9 +4234,8 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4381
4234
|
this.badgeDictionaryItemArray = [...this.badgeDictionaryItemArray, []];
|
|
4382
4235
|
}
|
|
4383
4236
|
handleBadgeDictionarySelect(dictionaryId, index) {
|
|
4384
|
-
this.
|
|
4385
|
-
|
|
4386
|
-
this.badgeDictionaryItemArray[index] = this.getDictionaryItemsByDictionaryId(allDictionaryItemRecords || [], dictionaryId);
|
|
4237
|
+
this.setDictionaryItemsForDictionaryId(dictionaryId, (items) => {
|
|
4238
|
+
this.badgeDictionaryItemArray[index] = items;
|
|
4387
4239
|
});
|
|
4388
4240
|
}
|
|
4389
4241
|
handleDeleteBadge(index) {
|
|
@@ -4395,7 +4247,7 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4395
4247
|
console.error(ERROR.INVALID_INDEX, index);
|
|
4396
4248
|
}
|
|
4397
4249
|
}
|
|
4398
|
-
|
|
4250
|
+
handleWidgetItemDelete(index) {
|
|
4399
4251
|
if (this.record.dataItems && index >= 0 && index < this.record.dataItems.length) {
|
|
4400
4252
|
this.record.dataItems = this.record.dataItems.filter((_, i) => i !== index);
|
|
4401
4253
|
this.dictionaryItemArray = this.dictionaryItemArray.filter((_, i) => i !== index);
|
|
@@ -4404,6 +4256,125 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4404
4256
|
console.error(ERROR.INVALID_INDEX, index);
|
|
4405
4257
|
}
|
|
4406
4258
|
}
|
|
4259
|
+
handleUpdateRecord() {
|
|
4260
|
+
if (!this.record._id || Object.keys(this.record).length === 0)
|
|
4261
|
+
return;
|
|
4262
|
+
const payload = this.buildWidgetRecordForApi();
|
|
4263
|
+
this.service.update(this.record._id, payload).subscribe({
|
|
4264
|
+
next: (response) => {
|
|
4265
|
+
this.record = {};
|
|
4266
|
+
this.baseStore?.setIsApiValidated(null);
|
|
4267
|
+
this.onFormNavigate.emit(response);
|
|
4268
|
+
},
|
|
4269
|
+
error: (error) => {
|
|
4270
|
+
console.error('Error updating record:', error);
|
|
4271
|
+
},
|
|
4272
|
+
});
|
|
4273
|
+
}
|
|
4274
|
+
handleAddRecord() {
|
|
4275
|
+
if (!this.record || Object.keys(this.record).length === 0)
|
|
4276
|
+
return;
|
|
4277
|
+
const payload = this.buildWidgetRecordForApi();
|
|
4278
|
+
this.service.create(payload).subscribe({
|
|
4279
|
+
next: (response) => {
|
|
4280
|
+
this.record = {};
|
|
4281
|
+
this.baseStore?.setIsApiValidated(null);
|
|
4282
|
+
this.onFormNavigate.emit(response);
|
|
4283
|
+
},
|
|
4284
|
+
error: (error) => {
|
|
4285
|
+
console.error('Error creating record:', error);
|
|
4286
|
+
},
|
|
4287
|
+
});
|
|
4288
|
+
}
|
|
4289
|
+
/**
|
|
4290
|
+
* Widget Items / Badges dropdowns bind to dictionaryID + dictionaryItemID (template).
|
|
4291
|
+
* API may send dataDictionaryId + dictionaryItemID (or any mix). Keep both in sync.
|
|
4292
|
+
*/
|
|
4293
|
+
syncRowDictionaryKeys(row) {
|
|
4294
|
+
const dictionaryId = row?.dataDictionaryId || row?.dictionaryID || '';
|
|
4295
|
+
const dictionaryItemId = row?.dictionaryItemId || row?.dictionaryItemID || '';
|
|
4296
|
+
return {
|
|
4297
|
+
...row,
|
|
4298
|
+
dataDictionaryId: dictionaryId,
|
|
4299
|
+
dictionaryID: dictionaryId,
|
|
4300
|
+
dictionaryItemId: dictionaryItemId,
|
|
4301
|
+
dictionaryItemID: dictionaryItemId,
|
|
4302
|
+
};
|
|
4303
|
+
}
|
|
4304
|
+
normalizeIncomingDictionaryAliases(record) {
|
|
4305
|
+
return {
|
|
4306
|
+
...record,
|
|
4307
|
+
dataItems: (record.dataItems || []).map((item) => this.syncRowDictionaryKeys(item)),
|
|
4308
|
+
badges: (record.badges || []).map((badge) => this.syncRowDictionaryKeys(badge)),
|
|
4309
|
+
};
|
|
4310
|
+
}
|
|
4311
|
+
refreshDictionaryItemListsForRecord() {
|
|
4312
|
+
this.query.getLists()
|
|
4313
|
+
.pipe(takeUntil(this.destroy$))
|
|
4314
|
+
.subscribe((allLists) => this.applyDictionaryItemListsFromLists(allLists));
|
|
4315
|
+
}
|
|
4316
|
+
applyDictionaryItemListsFromLists(allLists) {
|
|
4317
|
+
const allDictionaryItemRecords = this.getDictionaryItemRecordsFromLists(allLists);
|
|
4318
|
+
const itemsForDictionary = (dictionaryId) => this.getDictionaryItemsByDictionaryId(allDictionaryItemRecords, dictionaryId);
|
|
4319
|
+
this.hydrateMissingDictionaryIdsFromItemSelection(allDictionaryItemRecords);
|
|
4320
|
+
const record = this.record;
|
|
4321
|
+
this.headerDictionaryItems = itemsForDictionary(record.headerDictionaryID);
|
|
4322
|
+
this.subHeaderDictionaryItems = itemsForDictionary(record.subHeaderDictionaryID);
|
|
4323
|
+
this.dictionaryItemArray = (record.dataItems || []).map((item) => itemsForDictionary(item.dataDictionaryId || item.dictionaryID));
|
|
4324
|
+
this.badgeDictionaryItemArray = (record.badges || []).map((badge) => itemsForDictionary(badge.dataDictionaryId || badge.dictionaryID));
|
|
4325
|
+
}
|
|
4326
|
+
getDictionaryItemRecordsFromLists(allLists) {
|
|
4327
|
+
return (allLists.find((list) => list.forProperty === 'dictionaryItemId' || list.forProperty === 'dictionaryItemID')
|
|
4328
|
+
?.records || []);
|
|
4329
|
+
}
|
|
4330
|
+
setDictionaryItemsForDictionaryId(dictionaryId, assign) {
|
|
4331
|
+
this.query.getLists()
|
|
4332
|
+
.pipe(takeUntil(this.destroy$))
|
|
4333
|
+
.subscribe((allLists) => {
|
|
4334
|
+
const allDictionaryItemRecords = this.getDictionaryItemRecordsFromLists(allLists);
|
|
4335
|
+
assign(this.getDictionaryItemsByDictionaryId(allDictionaryItemRecords, dictionaryId));
|
|
4336
|
+
});
|
|
4337
|
+
}
|
|
4338
|
+
hydrateMissingDictionaryIdsFromItemSelection(allDictionaryItemRecords) {
|
|
4339
|
+
const inferDictionaryId = (dictionaryItemId) => {
|
|
4340
|
+
if (!dictionaryItemId) {
|
|
4341
|
+
return '';
|
|
4342
|
+
}
|
|
4343
|
+
const matched = allDictionaryItemRecords.find((item) => String(item?._id) === String(dictionaryItemId));
|
|
4344
|
+
return (matched?.dataDictionaryId || matched?.dictionaryID || '');
|
|
4345
|
+
};
|
|
4346
|
+
const hydrateRows = (rows) => (rows || []).map((row) => {
|
|
4347
|
+
const currentDictionaryId = row?.dataDictionaryId || row?.dictionaryID || '';
|
|
4348
|
+
const dictionaryItemId = row?.dictionaryItemId || row?.dictionaryItemID || '';
|
|
4349
|
+
const inferredDictionaryId = inferDictionaryId(dictionaryItemId);
|
|
4350
|
+
const resolvedDictId = currentDictionaryId || inferredDictionaryId || this.record.headerDictionaryID || '';
|
|
4351
|
+
return this.syncRowDictionaryKeys({
|
|
4352
|
+
...row,
|
|
4353
|
+
dataDictionaryId: resolvedDictId,
|
|
4354
|
+
dictionaryID: resolvedDictId,
|
|
4355
|
+
dictionaryItemId: dictionaryItemId,
|
|
4356
|
+
dictionaryItemID: dictionaryItemId,
|
|
4357
|
+
});
|
|
4358
|
+
});
|
|
4359
|
+
this.record.dataItems = hydrateRows(this.record.dataItems);
|
|
4360
|
+
this.record.badges = hydrateRows(this.record.badges);
|
|
4361
|
+
}
|
|
4362
|
+
getDictionaryItemsByDictionaryId(allDictionaryItemRecords, dictionaryId) {
|
|
4363
|
+
if (!dictionaryId) {
|
|
4364
|
+
return [];
|
|
4365
|
+
}
|
|
4366
|
+
const byLegacyDictionaryId = allDictionaryItemRecords.filter((item) => item.dataDictionaryId === dictionaryId || item.dictionaryID === dictionaryId);
|
|
4367
|
+
if (byLegacyDictionaryId.length > 0) {
|
|
4368
|
+
return byLegacyDictionaryId;
|
|
4369
|
+
}
|
|
4370
|
+
const selectedDictionary = this.dictionaries.find((d) => d._id === dictionaryId);
|
|
4371
|
+
const dictionaryItemsIds = selectedDictionary?.dictionaryItemsIds || [];
|
|
4372
|
+
if (!Array.isArray(dictionaryItemsIds) || dictionaryItemsIds.length === 0) {
|
|
4373
|
+
return [];
|
|
4374
|
+
}
|
|
4375
|
+
const dictionaryItemsIdSet = new Set(dictionaryItemsIds.map((id) => String(id)));
|
|
4376
|
+
return allDictionaryItemRecords.filter((item) => dictionaryItemsIdSet.has(String(item._id)));
|
|
4377
|
+
}
|
|
4407
4378
|
/**
|
|
4408
4379
|
* Text-box controls expect stringified JSON; API returns nested objects → "[object Object]" without this.
|
|
4409
4380
|
*/
|
|
@@ -4423,7 +4394,6 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4423
4394
|
}
|
|
4424
4395
|
/**
|
|
4425
4396
|
* Parsed styles + API dictionary fields for PUT/POST only.
|
|
4426
|
-
* Keeps `this.record` unchanged so style stays JSON text in inputs if the request fails (avoids "[object Object]").
|
|
4427
4397
|
*/
|
|
4428
4398
|
buildWidgetRecordForApi() {
|
|
4429
4399
|
const dataItems = (this.record.dataItems || []).map((item) => {
|
|
@@ -4459,56 +4429,16 @@ class WidgetAdminFormComponent extends BaseFormComponent {
|
|
|
4459
4429
|
badges,
|
|
4460
4430
|
};
|
|
4461
4431
|
}
|
|
4462
|
-
handleSubmit() {
|
|
4463
|
-
super.handleSubmit();
|
|
4464
|
-
}
|
|
4465
|
-
handleUpdateRecord() {
|
|
4466
|
-
if (!this.record._id || Object.keys(this.record).length === 0)
|
|
4467
|
-
return;
|
|
4468
|
-
const payload = this.buildWidgetRecordForApi();
|
|
4469
|
-
this.service.update(this.record._id, payload).subscribe({
|
|
4470
|
-
next: (response) => {
|
|
4471
|
-
console.log('Record updated:', response);
|
|
4472
|
-
this.record = {};
|
|
4473
|
-
this.baseStore?.setIsApiValidated(null);
|
|
4474
|
-
this.onFormNavigate.emit(response);
|
|
4475
|
-
},
|
|
4476
|
-
error: (error) => {
|
|
4477
|
-
console.error('Error updating record:', error);
|
|
4478
|
-
},
|
|
4479
|
-
});
|
|
4480
|
-
}
|
|
4481
|
-
handleCancel() {
|
|
4482
|
-
if (this.baseStore)
|
|
4483
|
-
this.baseStore.missingFields = [];
|
|
4484
|
-
this.onCancel.emit();
|
|
4485
|
-
}
|
|
4486
|
-
handleAddRecord() {
|
|
4487
|
-
if (!this.record || Object.keys(this.record).length === 0)
|
|
4488
|
-
return;
|
|
4489
|
-
const payload = this.buildWidgetRecordForApi();
|
|
4490
|
-
this.service.create(payload).subscribe({
|
|
4491
|
-
next: (response) => {
|
|
4492
|
-
console.log('Record created:', response);
|
|
4493
|
-
this.record = {};
|
|
4494
|
-
this.baseStore?.setIsApiValidated(null);
|
|
4495
|
-
this.onFormNavigate.emit(response);
|
|
4496
|
-
},
|
|
4497
|
-
error: (error) => {
|
|
4498
|
-
console.error('Error creating record:', error);
|
|
4499
|
-
},
|
|
4500
|
-
});
|
|
4501
|
-
}
|
|
4502
4432
|
ngOnDestroy() {
|
|
4503
4433
|
this.record = {};
|
|
4504
4434
|
super.ngOnDestroy();
|
|
4505
4435
|
}
|
|
4506
4436
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WidgetAdminFormComponent, deps: [{ token: WidgetAdminService }, { token: ValidatorService }, { token: WidgetAdminStore }, { token: WidgetAdminQuery }, { token: i3$4.Router }, { token: i3$4.ActivatedRoute }, { token: BaseStore }, { token: BaseQuery }], target: i0.ɵɵFactoryTarget.Component });
|
|
4507
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: WidgetAdminFormComponent, isStandalone: false, selector: "lib-widget-admin-form", usesInheritance: true, ngImport: i0, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Widget Form</h4>\r\n <div class=\"col-12 md:col-12 mt-2 mb-2 flex\">\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Widget Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <dropdown [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'apiConfigId',\r\n displayText : 'Select API',\r\n isRequired:true,\r\n }\" (onInput)=\"handleAPIChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-4 md:col-4 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'style',\r\n isRequired: false,\r\n displayText: 'Style',\r\n placeholder: 'Enter Widget Style'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-2 md:col-2 mt-5\">\r\n <check-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Active',\r\n }\">\r\n </check-box>\r\n </div>\r\n </div>\r\n <div class=\"grid align-items-center m-0\">\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Header Item',\r\n options: headerDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleSubHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select SubHeader Item',\r\n options: subHeaderDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2 mt-2 mb-2 flex\">\r\n <div class=\"field col-12 pl-2 pb-0 mb-2 md:mr-2 md:col-12\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'layoutType',\r\n listLabelProperty:'name',\r\n listValueProperty:'value',\r\n displayText : 'Select Layout Type',\r\n options: widgetLayoutTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 flex gap-2\">\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleBadgeAddBtnClick()\">\r\n <span class=\"ml-3\">Add Badge </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleWidgetItemAddBtnClick()\">\r\n <span class=\"ml-3\">Add Widget Item </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Badges Section -->\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 mb-3\">\r\n <h5 *ngIf=\"(record?.badges?.length ?? 0) > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Badges</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let badge of (record?.badges || []); let i = index;\">\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleBadgeDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: badgeDictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"badge\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 m-0 flex justify-content-start md:col-2 mt-5\">\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteBadge(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Widget Items -->\r\n <h5 *ngIf=\"(record?.dataItems?.length ?? 0) > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Widget Items</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let widgetItem of (record?.dataItems || []); let i = index;\">\r\n <div class=\"field col-2 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'name',\r\n readonly : false,\r\n displayText : 'Item Label',\r\n isRequired : true,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleWidgetItemDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: dictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Item Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-4 m-0 flex justify-content-center md:col-2 mt-5\">\r\n <div class=\"m-0\">\r\n <check-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Is Active ?',\r\n }\">\r\n </check-box>\r\n </div>\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteRecord(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".trash-icon-wrapper{font-size:20px;color:var(--red-500)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextBoxComponent, selector: "text-box" }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "component", type: FormContainerComponent, selector: "form-container", inputs: ["messages", "record", "headerText", "showSave", "disableSaveButton"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: CheckBoxComponent, selector: "check-box" }, { kind: "directive", type: i3$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }] });
|
|
4437
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: WidgetAdminFormComponent, isStandalone: false, selector: "lib-widget-admin-form", usesInheritance: true, ngImport: i0, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Widget Form</h4>\r\n <div class=\"col-12 md:col-12 mt-2 mb-2 flex\">\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Widget Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <dropdown [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'apiConfigId',\r\n displayText : 'Select API',\r\n isRequired:true,\r\n }\" (onInput)=\"handleApiConfigChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-4 md:col-4 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'style',\r\n isRequired: false,\r\n displayText: 'Style',\r\n placeholder: 'Enter Widget Style'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-2 md:col-2 mt-5\">\r\n <check-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Active',\r\n }\">\r\n </check-box>\r\n </div>\r\n </div>\r\n <div class=\"grid align-items-center m-0\">\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Header Item',\r\n options: headerDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleSubHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select SubHeader Item',\r\n options: subHeaderDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2 mt-2 mb-2 flex\">\r\n <div class=\"field col-12 pl-2 pb-0 mb-2 md:mr-2 md:col-12\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'layoutType',\r\n listLabelProperty:'name',\r\n listValueProperty:'value',\r\n displayText : 'Select Layout Type',\r\n options: widgetLayoutTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 flex gap-2\">\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleBadgeAddBtnClick()\">\r\n <span class=\"ml-3\">Add Badge </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleWidgetItemAddBtnClick()\">\r\n <span class=\"ml-3\">Add Widget Item </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Badges Section -->\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 mb-3\">\r\n <h5 *ngIf=\"(record?.badges?.length ?? 0) > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Badges</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let badge of (record?.badges || []); let i = index;\">\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleBadgeDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: badgeDictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"badge\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 m-0 flex justify-content-start md:col-2 mt-5\">\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteBadge(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Widget Items -->\r\n <h5 *ngIf=\"(record?.dataItems?.length ?? 0) > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Widget Items</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let widgetItem of (record?.dataItems || []); let i = index;\">\r\n <div class=\"field col-2 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'name',\r\n readonly : false,\r\n displayText : 'Item Label',\r\n isRequired : true,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleWidgetItemDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: dictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Item Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-4 m-0 flex justify-content-center md:col-2 mt-5\">\r\n <div class=\"m-0\">\r\n <check-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Is Active ?',\r\n }\">\r\n </check-box>\r\n </div>\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleWidgetItemDelete(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".trash-icon-wrapper{font-size:20px;color:var(--red-500)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: TextBoxComponent, selector: "text-box" }, { kind: "component", type: DropdownComponent, selector: "dropdown", inputs: ["isStaticDropdown"] }, { kind: "component", type: FormContainerComponent, selector: "form-container", inputs: ["messages", "record", "headerText", "showSave", "disableSaveButton"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: CheckBoxComponent, selector: "check-box" }, { kind: "directive", type: i3$3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }] });
|
|
4508
4438
|
}
|
|
4509
4439
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WidgetAdminFormComponent, decorators: [{
|
|
4510
4440
|
type: Component,
|
|
4511
|
-
args: [{ selector: 'lib-widget-admin-form', standalone: false, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Widget Form</h4>\r\n <div class=\"col-12 md:col-12 mt-2 mb-2 flex\">\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Widget Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <dropdown [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'apiConfigId',\r\n displayText : 'Select API',\r\n isRequired:true,\r\n }\" (onInput)=\"handleAPIChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-4 md:col-4 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'style',\r\n isRequired: false,\r\n displayText: 'Style',\r\n placeholder: 'Enter Widget Style'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-2 md:col-2 mt-5\">\r\n <check-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Active',\r\n }\">\r\n </check-box>\r\n </div>\r\n </div>\r\n <div class=\"grid align-items-center m-0\">\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Header Item',\r\n options: headerDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleSubHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select SubHeader Item',\r\n options: subHeaderDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2 mt-2 mb-2 flex\">\r\n <div class=\"field col-12 pl-2 pb-0 mb-2 md:mr-2 md:col-12\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'layoutType',\r\n listLabelProperty:'name',\r\n listValueProperty:'value',\r\n displayText : 'Select Layout Type',\r\n options: widgetLayoutTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 flex gap-2\">\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleBadgeAddBtnClick()\">\r\n <span class=\"ml-3\">Add Badge </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleWidgetItemAddBtnClick()\">\r\n <span class=\"ml-3\">Add Widget Item </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Badges Section -->\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 mb-3\">\r\n <h5 *ngIf=\"(record?.badges?.length ?? 0) > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Badges</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let badge of (record?.badges || []); let i = index;\">\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleBadgeDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: badgeDictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"badge\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 m-0 flex justify-content-start md:col-2 mt-5\">\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteBadge(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Widget Items -->\r\n <h5 *ngIf=\"(record?.dataItems?.length ?? 0) > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Widget Items</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let widgetItem of (record?.dataItems || []); let i = index;\">\r\n <div class=\"field col-2 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'name',\r\n readonly : false,\r\n displayText : 'Item Label',\r\n isRequired : true,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleWidgetItemDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: dictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Item Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-4 m-0 flex justify-content-center md:col-2 mt-5\">\r\n <div class=\"m-0\">\r\n <check-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Is Active ?',\r\n }\">\r\n </check-box>\r\n </div>\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteRecord(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".trash-icon-wrapper{font-size:20px;color:var(--red-500)}\n"] }]
|
|
4441
|
+
args: [{ selector: 'lib-widget-admin-form', standalone: false, template: "<form-container [record]=\"record\" [showSave]=\"true\" [messages]=\"message\" (onSave)=\"handleSubmit()\"\r\n (onCancel)=\"handleCancel()\">\r\n <div class=\"card p-fluid p-formgrid\">\r\n <h4 class=\"font-bold col-12 md:col-12\">Widget Form</h4>\r\n <div class=\"col-12 md:col-12 mt-2 mb-2 flex\">\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'name',\r\n isRequired: true,\r\n displayText: 'Name',\r\n placeholder: 'Enter Widget Name'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-3 md:col-3 mt-2 mb-2\">\r\n <dropdown [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'apiConfigId',\r\n displayText : 'Select API',\r\n isRequired:true,\r\n }\" (onInput)=\"handleApiConfigChange($event)\">\r\n </dropdown>\r\n </div>\r\n\r\n <div class=\"col-4 md:col-4 mt-2 mb-2\">\r\n <text-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n readonly: false,\r\n name: 'style',\r\n isRequired: false,\r\n displayText: 'Style',\r\n placeholder: 'Enter Widget Style'\r\n }\"></text-box>\r\n </div>\r\n\r\n <div class=\"col-2 md:col-2 mt-5\">\r\n <check-box [store]=\"widgetStore\" [record]=\"record\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Active',\r\n }\">\r\n </check-box>\r\n </div>\r\n </div>\r\n <div class=\"grid align-items-center m-0\">\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'headerDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Header Item',\r\n options: headerDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-5 mt-2 mb-2 flex\">\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n options: dictionaries\r\n }\" (onInput)=\"handleSubHeaderDictionarySelect($event)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-6 pl-2 pb-0 mb-2 md:mr-2 md:col-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'subHeaderDictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select SubHeader Item',\r\n options: subHeaderDictionaryItems\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2 mt-2 mb-2 flex\">\r\n <div class=\"field col-12 pl-2 pb-0 mb-2 md:mr-2 md:col-12\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"record\" [attributeModel]=\"{\r\n name:'layoutType',\r\n listLabelProperty:'name',\r\n listValueProperty:'value',\r\n displayText : 'Select Layout Type',\r\n options: widgetLayoutTypeList\r\n }\">\r\n </dropdown>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 flex gap-2\">\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleBadgeAddBtnClick()\">\r\n <span class=\"ml-3\">Add Badge </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-6 md:col-2\">\r\n <div class=\"card m-0 p-0 mb-2\">\r\n <div class=\"mt-3 w-full flex\">\r\n <button pButton pRipple routerLinkActive=\"router-link-active\"\r\n icon=\"pi pi-plus font-semibold\"\r\n class=\"py-3 justify-content-center font-semibold w-full border-round\"\r\n (click)=\"handleWidgetItemAddBtnClick()\">\r\n <span class=\"ml-3\">Add Widget Item </span>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Badges Section -->\r\n <div class=\"field p-0 pr-2 col-12 md:col-12 mb-3\">\r\n <h5 *ngIf=\"(record?.badges?.length ?? 0) > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Badges</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let badge of (record?.badges || []); let i = index;\">\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleBadgeDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-3 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"badge\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: badgeDictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"badge\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 m-0 flex justify-content-start md:col-2 mt-5\">\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleDeleteBadge(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Widget Items -->\r\n <h5 *ngIf=\"(record?.dataItems?.length ?? 0) > 0\" class=\"font-bold col-12 md:col-12 mb-2\">Widget Items</h5>\r\n <div class=\"feild-card col-12 md:col-12 flex\" *ngFor=\"let widgetItem of (record?.dataItems || []); let i = index;\">\r\n <div class=\"field col-2 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'name',\r\n readonly : false,\r\n displayText : 'Item Label',\r\n isRequired : true,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryID',\r\n listLabelProperty:'name',\r\n listValueProperty:'_id',\r\n displayText : 'Select Dictionary',\r\n isRequired:true,\r\n options: dictionaries\r\n }\" (onInput)=\"handleWidgetItemDictionarySelect($event, i)\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-2 col-sm-6\">\r\n <dropdown [store]=\"widgetStore\" [isStaticDropdown]=\"true\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'dictionaryItemID',\r\n listLabelProperty:'itemName',\r\n listValueProperty:'_id',\r\n displayText : 'Select Properties',\r\n isRequired:true,\r\n options: dictionaryItemArray[i]\r\n }\">\r\n </dropdown>\r\n </div>\r\n <div class=\"field col-4 col-sm-6\">\r\n <text-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name : 'style',\r\n readonly : false,\r\n displayText : 'Item Style',\r\n isRequired : false,\r\n }\"></text-box>\r\n </div>\r\n <div class=\"field col-4 m-0 flex justify-content-center md:col-2 mt-5\">\r\n <div class=\"m-0\">\r\n <check-box [store]=\"widgetStore\" [record]=\"widgetItem\" [attributeModel]=\"{\r\n name:'isActive',\r\n displayText : 'Is Active ?',\r\n }\">\r\n </check-box>\r\n </div>\r\n <div class=\"ml-4 delete-icon-container\">\r\n <i class=\"pi pi-trash trash-icon-wrapper cursor-pointer\" (click)=\"handleWidgetItemDelete(i)\"></i>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</form-container>", styles: [".trash-icon-wrapper{font-size:20px;color:var(--red-500)}\n"] }]
|
|
4512
4442
|
}], ctorParameters: () => [{ type: WidgetAdminService }, { type: ValidatorService }, { type: WidgetAdminStore }, { type: WidgetAdminQuery }, { type: i3$4.Router }, { type: i3$4.ActivatedRoute }, { type: BaseStore }, { type: BaseQuery }] });
|
|
4513
4443
|
|
|
4514
4444
|
/**
|