@masterteam/components 0.0.311 → 0.0.313
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/assets/common.css +1 -1
- package/assets/i18n/ar.json +3 -0
- package/assets/i18n/en.json +3 -0
- package/fesm2022/masterteam-components-business-fields.mjs +72 -18
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -1
- package/fesm2022/masterteam-components-entities.mjs +64 -1
- package/fesm2022/masterteam-components-entities.mjs.map +1 -1
- package/fesm2022/masterteam-components-formula.mjs +4 -4
- package/fesm2022/masterteam-components-formula.mjs.map +1 -1
- package/fesm2022/masterteam-components-icon-field.mjs +2 -2
- package/fesm2022/masterteam-components-icon-field.mjs.map +1 -1
- package/fesm2022/masterteam-components-table.mjs +150 -13
- package/fesm2022/masterteam-components-table.mjs.map +1 -1
- package/package.json +1 -1
- package/types/masterteam-components-business-fields.d.ts +10 -0
- package/types/masterteam-components-entities.d.ts +12 -1
- package/types/masterteam-components-table.d.ts +63 -1
|
@@ -239,6 +239,69 @@ function normalizeNumerals(input) {
|
|
|
239
239
|
.replace(/[٬ ]/g, '');
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
+
const INTERNAL_NAME_KEY = 'internal_username';
|
|
243
|
+
const EXTERNAL_NAME_KEY = 'external_username';
|
|
244
|
+
function matchesKey(field, key) {
|
|
245
|
+
return field.normalizedKey === key || field.key === key;
|
|
246
|
+
}
|
|
247
|
+
/** Keep the name slot's identity/layout, and use the populated name's renderer. */
|
|
248
|
+
function projectName(internal, external) {
|
|
249
|
+
const isEmptyUser = internal.viewType === 'User' &&
|
|
250
|
+
internal.value != null &&
|
|
251
|
+
typeof internal.value === 'object' &&
|
|
252
|
+
!internal.value.userName?.trim();
|
|
253
|
+
if (internal.value != null && internal.value !== '' && !isEmptyUser) {
|
|
254
|
+
return internal;
|
|
255
|
+
}
|
|
256
|
+
if (external.value == null || external.value === '')
|
|
257
|
+
return internal;
|
|
258
|
+
return {
|
|
259
|
+
...internal,
|
|
260
|
+
rawValue: external.rawValue,
|
|
261
|
+
value: external.value,
|
|
262
|
+
viewType: external.viewType,
|
|
263
|
+
type: external.type,
|
|
264
|
+
propertyConfiguration: external.propertyConfiguration,
|
|
265
|
+
nestedProperties: external.nestedProperties,
|
|
266
|
+
comparison: external.comparison,
|
|
267
|
+
color: external.color,
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/** Stakeholder cards show the two mutually exclusive names in one name slot. */
|
|
271
|
+
function mergeStakeholderNameEntities(entities) {
|
|
272
|
+
const internal = entities.find((entity) => matchesKey(entity, INTERNAL_NAME_KEY));
|
|
273
|
+
const external = entities.find((entity) => matchesKey(entity, EXTERNAL_NAME_KEY));
|
|
274
|
+
if (!internal || !external)
|
|
275
|
+
return entities;
|
|
276
|
+
const name = projectName(internal, external);
|
|
277
|
+
return entities.flatMap((entity) => entity === external ? [] : [entity === internal ? name : entity]);
|
|
278
|
+
}
|
|
279
|
+
/** Hide the duplicate only when both stakeholder name fields are displayed. */
|
|
280
|
+
function mergeStakeholderNameColumns(columns) {
|
|
281
|
+
if (!columns.some((column) => matchesKey(column, INTERNAL_NAME_KEY))) {
|
|
282
|
+
return columns;
|
|
283
|
+
}
|
|
284
|
+
if (!columns.some((column) => matchesKey(column, EXTERNAL_NAME_KEY))) {
|
|
285
|
+
return columns;
|
|
286
|
+
}
|
|
287
|
+
return columns.filter((column) => !matchesKey(column, EXTERNAL_NAME_KEY));
|
|
288
|
+
}
|
|
289
|
+
/** Presentation only: retain the original cells and row edit/submission maps. */
|
|
290
|
+
function mergeStakeholderNameRows(columns, rows) {
|
|
291
|
+
const internal = columns.find((column) => matchesKey(column, INTERNAL_NAME_KEY));
|
|
292
|
+
const external = columns.find((column) => matchesKey(column, EXTERNAL_NAME_KEY));
|
|
293
|
+
if (!internal || !external)
|
|
294
|
+
return rows;
|
|
295
|
+
return rows.map((row) => {
|
|
296
|
+
const internalCell = row[internal.key];
|
|
297
|
+
const externalCell = row[external.key];
|
|
298
|
+
if (!internalCell || !externalCell)
|
|
299
|
+
return row;
|
|
300
|
+
const name = projectName(internalCell, externalCell);
|
|
301
|
+
return name === internalCell ? row : { ...row, [internal.key]: name };
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
|
|
242
305
|
/**
|
|
243
306
|
* Publishes an `EntityRuntimeContext` to a subtree of entity renderers.
|
|
244
307
|
*
|
|
@@ -3577,5 +3640,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
3577
3640
|
* Generated bundle index. Do not edit.
|
|
3578
3641
|
*/
|
|
3579
3642
|
|
|
3580
|
-
export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, ENTITY_LIST_TABLE_COMPONENT, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityIcon, EntityLeafDetails, EntityListDrawer, EntityListPreview, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityRuntimeContextStore, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildEntityListRows, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, groupEntitiesIntoSections, humanizeEntityListKey, isConnectionSyntheticKey, isEntityAlignEnd, isEntityLabelHidden, isEntityListLocalDocument, isEntityListSelectionDocument, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, localCellsByFieldId, matchesPercentageColorRule, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, readEntityValueColor, resolveConnectionLevelName, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalFieldConfiguration, resolveLocalFieldLabel, resolveLocalFieldViewType, resolveLocalizedLabel, resolvePercentageColor, serializeEntityRawValue, sharedActiveLang, sortLocalRows, splitConnectionKey, splitLeafKey, summarizeEntityListRows, visibleLocalSchemaFields };
|
|
3643
|
+
export { CONNECTION_KEY_SEPARATOR, CURRENCY_COMPACT_THRESHOLD, ComparisonEntityList, ComparisonValue, DEFAULT_PHASE_GATE_COLOR, ENTITY_EMPTY_VALUE_PLACEHOLDER, ENTITY_LIST_TABLE_COMPONENT, EntitiesManage, EntitiesPreview, EntitiesResizeBase, EntityAttachment, EntityCheckbox, EntityConnection, EntityCurrency, EntityDate, EntityField, EntityIcon, EntityLeafDetails, EntityListDrawer, EntityListPreview, EntityLocation, EntityLongText, EntityLookup, EntityLookupModuleCheckList, EntityPercentage, EntityPhaseGate, EntityPreview, EntityPreviewBody, EntityRuntimeContextStore, EntityScheduleItem, EntityStatus, EntityText, EntityUser, FitText, LEAF_DETAILS_KEY_SEPARATOR, LEAF_PHASES_KEY_SEPARATOR, SECTION_KEY_PREFIX, buildConnectionKey, buildDisplayEntities, buildEntityListRows, buildSectionKey, compactCurrencyDisplay, currencyUnitOf, displayOrPlaceholder, expandConnectionEntity, expandLeafDetailsEntity, extractDisplayText, getEntitySectionTitle, groupEntitiesIntoSections, humanizeEntityListKey, isConnectionSyntheticKey, isEntityAlignEnd, isEntityLabelHidden, isEntityListLocalDocument, isEntityListSelectionDocument, isEntitySection, isLeafDetailsCatalogConfiguration, isLeafDetailsCollectionValue, isLeafDetailsRuntimeValue, isLeafDetailsSyntheticKey, isLeafDetailsValue, isLeafPhasesSyntheticKey, isLeafSyntheticKey, isSectionKey, isValueMissing, localCellsByFieldId, matchesPercentageColorRule, mergeStakeholderNameColumns, mergeStakeholderNameEntities, mergeStakeholderNameRows, normalizeConnectionSourceLevels, normalizeNumerals, parseCurrencyAmount, readEntityValueColor, resolveConnectionLevelName, resolveEntityInfo, resolveEntityLabelPosition, resolveLocalFieldConfiguration, resolveLocalFieldLabel, resolveLocalFieldViewType, resolveLocalizedLabel, resolvePercentageColor, serializeEntityRawValue, sharedActiveLang, sortLocalRows, splitConnectionKey, splitLeafKey, summarizeEntityListRows, visibleLocalSchemaFields };
|
|
3581
3644
|
//# sourceMappingURL=masterteam-components-entities.mjs.map
|