@outbuild-company/schedule-core 1.35.3 → 1.37.0
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/dist/build-fingerprint.json +2 -2
- package/dist/cdn/schedule-core.global.js +1 -1
- package/dist/cdn/schedule-core.global.js.map +1 -1
- package/dist/index.cjs +73 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -64
- package/dist/index.d.ts +111 -64
- package/dist/index.js +72 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2304,24 +2304,37 @@ function toLevelWindow(input) {
|
|
|
2304
2304
|
return { startLevel, depth: input.depth };
|
|
2305
2305
|
}
|
|
2306
2306
|
var INVALID_CRITERION = /* @__PURE__ */ Symbol("invalid-group-criterion");
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
if (
|
|
2310
|
-
if (typeof
|
|
2311
|
-
if (typeof secondary.attributeKey !== "string" || secondary.attributeKey.length === 0) {
|
|
2307
|
+
var MAX_NESTED_GROUP_CRITERIA = 3;
|
|
2308
|
+
function toNestedCriterion(input, usedKeys) {
|
|
2309
|
+
if (typeof input !== "object" || input === null) return INVALID_CRITERION;
|
|
2310
|
+
if (typeof input.attributeKey !== "string" || input.attributeKey.length === 0) {
|
|
2312
2311
|
return INVALID_CRITERION;
|
|
2313
2312
|
}
|
|
2314
|
-
if (
|
|
2315
|
-
const window2 = toLevelWindow(
|
|
2313
|
+
if (usedKeys.has(input.attributeKey)) return INVALID_CRITERION;
|
|
2314
|
+
const window2 = toLevelWindow(input);
|
|
2316
2315
|
if (window2 === null) return INVALID_CRITERION;
|
|
2317
|
-
if (!isValidDirection(
|
|
2316
|
+
if (!isValidDirection(input.direction)) return INVALID_CRITERION;
|
|
2318
2317
|
return {
|
|
2319
|
-
attributeKey:
|
|
2318
|
+
attributeKey: input.attributeKey,
|
|
2320
2319
|
startLevel: window2.startLevel,
|
|
2321
2320
|
depth: window2.depth,
|
|
2322
|
-
direction:
|
|
2321
|
+
direction: input.direction
|
|
2323
2322
|
};
|
|
2324
2323
|
}
|
|
2324
|
+
function toNestedCriteria(input, primaryKey) {
|
|
2325
|
+
const rawNested = input.nested ?? (input.secondary == null ? [] : [input.secondary]);
|
|
2326
|
+
if (!Array.isArray(rawNested)) return INVALID_CRITERION;
|
|
2327
|
+
if (rawNested.length > MAX_NESTED_GROUP_CRITERIA) return INVALID_CRITERION;
|
|
2328
|
+
const usedKeys = /* @__PURE__ */ new Set([primaryKey]);
|
|
2329
|
+
const nested = [];
|
|
2330
|
+
for (const rawCriterion of rawNested) {
|
|
2331
|
+
const criterion = toNestedCriterion(rawCriterion, usedKeys);
|
|
2332
|
+
if (criterion === INVALID_CRITERION) return INVALID_CRITERION;
|
|
2333
|
+
usedKeys.add(criterion.attributeKey);
|
|
2334
|
+
nested.push(criterion);
|
|
2335
|
+
}
|
|
2336
|
+
return nested;
|
|
2337
|
+
}
|
|
2325
2338
|
function toGroupState(input) {
|
|
2326
2339
|
if (typeof input.attributeKey !== "string" || input.attributeKey.length === 0) {
|
|
2327
2340
|
return null;
|
|
@@ -2335,8 +2348,8 @@ function toGroupState(input) {
|
|
|
2335
2348
|
if (!Array.isArray(input.collapsedIds) || input.collapsedIds.some((id) => typeof id !== "string")) {
|
|
2336
2349
|
return null;
|
|
2337
2350
|
}
|
|
2338
|
-
const
|
|
2339
|
-
if (
|
|
2351
|
+
const nested = toNestedCriteria(input, input.attributeKey);
|
|
2352
|
+
if (nested === INVALID_CRITERION) return null;
|
|
2340
2353
|
return {
|
|
2341
2354
|
attributeKey: input.attributeKey,
|
|
2342
2355
|
startLevel: window2.startLevel,
|
|
@@ -2344,7 +2357,7 @@ function toGroupState(input) {
|
|
|
2344
2357
|
direction: input.direction,
|
|
2345
2358
|
includeWbs: input.includeWbs,
|
|
2346
2359
|
collapsedIds: new Set(input.collapsedIds),
|
|
2347
|
-
|
|
2360
|
+
nested
|
|
2348
2361
|
};
|
|
2349
2362
|
}
|
|
2350
2363
|
function emptyViewChanges(action) {
|
|
@@ -8210,25 +8223,39 @@ function getVisibleBaseline(activity) {
|
|
|
8210
8223
|
return points.find((point) => point.isVisibleVersion) ?? null;
|
|
8211
8224
|
}
|
|
8212
8225
|
|
|
8213
|
-
// src/columns/baseline-variance/
|
|
8226
|
+
// src/columns/baseline-variance/baseline-variance-days.ts
|
|
8214
8227
|
var VARIANCE_DECIMAL_SCALE = 100;
|
|
8215
8228
|
var roundToVariancePrecision = (days) => Math.round(days * VARIANCE_DECIMAL_SCALE) / VARIANCE_DECIMAL_SCALE;
|
|
8216
|
-
function
|
|
8217
|
-
|
|
8218
|
-
const
|
|
8219
|
-
if (!
|
|
8220
|
-
|
|
8221
|
-
const
|
|
8229
|
+
function baselineVarianceDays(input) {
|
|
8230
|
+
const { endDate, baselineEnd, calendar, hoursPerDay } = input;
|
|
8231
|
+
const hasUsableHoursPerDay = Number.isFinite(hoursPerDay) && hoursPerDay > 0;
|
|
8232
|
+
if (!hasUsableHoursPerDay) return null;
|
|
8233
|
+
if (!baselineEnd || !endDate) return null;
|
|
8234
|
+
const hasValidDates = Number.isFinite(endDate.getTime()) && Number.isFinite(baselineEnd.getTime());
|
|
8235
|
+
if (!hasValidDates) return null;
|
|
8236
|
+
const finishesLate = endDate.getTime() > baselineEnd.getTime();
|
|
8237
|
+
const finishesEarly = baselineEnd.getTime() > endDate.getTime();
|
|
8222
8238
|
if (!finishesLate && !finishesEarly) return 0;
|
|
8223
|
-
const durationHours =
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
});
|
|
8239
|
+
const durationHours = calendar.calculateDuration(
|
|
8240
|
+
finishesLate ? baselineEnd : endDate,
|
|
8241
|
+
finishesLate ? endDate : baselineEnd
|
|
8242
|
+
);
|
|
8228
8243
|
const magnitude = roundToVariancePrecision(durationHours / hoursPerDay);
|
|
8229
8244
|
if (magnitude === 0) return 0;
|
|
8230
8245
|
return finishesLate ? magnitude : -magnitude;
|
|
8231
8246
|
}
|
|
8247
|
+
|
|
8248
|
+
// src/columns/baseline-variance/compute.ts
|
|
8249
|
+
function varianceDaysForBaselineEnd(activity, baselineEnd, calendars, hoursPerDay) {
|
|
8250
|
+
return baselineVarianceDays({
|
|
8251
|
+
endDate: activity.endDate,
|
|
8252
|
+
baselineEnd,
|
|
8253
|
+
calendar: {
|
|
8254
|
+
calculateDuration: (startDate, endDate) => calendars.calculateDuration({ startDate, endDate, task: activity })
|
|
8255
|
+
},
|
|
8256
|
+
hoursPerDay
|
|
8257
|
+
});
|
|
8258
|
+
}
|
|
8232
8259
|
function computeBaselineVarianceDays(activity, calendars, hoursPerDay) {
|
|
8233
8260
|
return varianceDaysForBaselineEnd(
|
|
8234
8261
|
activity,
|
|
@@ -25886,7 +25913,7 @@ function emitActivities(node, context) {
|
|
|
25886
25913
|
});
|
|
25887
25914
|
}
|
|
25888
25915
|
}
|
|
25889
|
-
function emitNode(node, childDirection,
|
|
25916
|
+
function emitNode(node, childDirection, nextNestedIndex, context) {
|
|
25890
25917
|
const { group, rows } = context;
|
|
25891
25918
|
rows.push({
|
|
25892
25919
|
kind: VISUAL_ROW_KIND.GROUP,
|
|
@@ -25898,20 +25925,24 @@ function emitNode(node, childDirection, allowSecondary, context) {
|
|
|
25898
25925
|
});
|
|
25899
25926
|
if (group.collapsedIds.has(node.id)) return;
|
|
25900
25927
|
for (const child of sortedChildNodes(node, childDirection)) {
|
|
25901
|
-
emitNode(child, childDirection,
|
|
25928
|
+
emitNode(child, childDirection, nextNestedIndex, context);
|
|
25902
25929
|
}
|
|
25903
25930
|
if (node.activities.length === 0) return;
|
|
25904
|
-
const
|
|
25905
|
-
|
|
25906
|
-
|
|
25931
|
+
const nestedCriterion = group.nested[nextNestedIndex];
|
|
25932
|
+
const nestedCatalog = context.nestedCatalogs[nextNestedIndex] ?? null;
|
|
25933
|
+
if (nestedCriterion != null && nestedCatalog != null) {
|
|
25934
|
+
const nestedRoot = buildGroupTree(
|
|
25907
25935
|
node.activities,
|
|
25908
|
-
|
|
25909
|
-
|
|
25936
|
+
nestedCriterion,
|
|
25937
|
+
nestedCatalog,
|
|
25910
25938
|
createNode(node.id, "", "", null, node.level, 0),
|
|
25911
25939
|
true
|
|
25912
25940
|
);
|
|
25913
|
-
for (const child of sortedChildNodes(
|
|
25914
|
-
|
|
25941
|
+
for (const child of sortedChildNodes(
|
|
25942
|
+
nestedRoot,
|
|
25943
|
+
nestedCriterion.direction
|
|
25944
|
+
)) {
|
|
25945
|
+
emitNode(child, nestedCriterion.direction, nextNestedIndex + 1, context);
|
|
25915
25946
|
}
|
|
25916
25947
|
return;
|
|
25917
25948
|
}
|
|
@@ -25954,11 +25985,11 @@ function projectVisualRows(input) {
|
|
|
25954
25985
|
comparator: input.comparator,
|
|
25955
25986
|
orderMode: input.orderMode,
|
|
25956
25987
|
wbsDepth: input.wbsDepth,
|
|
25957
|
-
|
|
25988
|
+
nestedCatalogs: input.nestedCatalogs,
|
|
25958
25989
|
rows
|
|
25959
25990
|
};
|
|
25960
25991
|
for (const child of sortedChildNodes(root, group.direction)) {
|
|
25961
|
-
emitNode(child, group.direction,
|
|
25992
|
+
emitNode(child, group.direction, 0, context);
|
|
25962
25993
|
}
|
|
25963
25994
|
return rows;
|
|
25964
25995
|
}
|
|
@@ -26364,7 +26395,9 @@ var ScheduleState = class _ScheduleState {
|
|
|
26364
26395
|
if (this._cache.visualRows) return this._cache.visualRows;
|
|
26365
26396
|
const group = this._viewAttributes.getGroup();
|
|
26366
26397
|
const catalog = group === null ? null : this._viewAttributes.getCatalog(group.attributeKey);
|
|
26367
|
-
const
|
|
26398
|
+
const nestedCatalogs = group === null ? [] : group.nested.map(
|
|
26399
|
+
(criterion) => this._viewAttributes.getCatalog(criterion.attributeKey)
|
|
26400
|
+
);
|
|
26368
26401
|
const activitiesInVisualOrder = [];
|
|
26369
26402
|
for (const activityId of this.getVisualOrderIds()) {
|
|
26370
26403
|
const activity = this.getActivity(activityId);
|
|
@@ -26377,7 +26410,7 @@ var ScheduleState = class _ScheduleState {
|
|
|
26377
26410
|
hasChildren: (activityId) => this.hasChildren(activityId),
|
|
26378
26411
|
group,
|
|
26379
26412
|
catalog,
|
|
26380
|
-
|
|
26413
|
+
nestedCatalogs,
|
|
26381
26414
|
comparator: this.getOrderComparator(),
|
|
26382
26415
|
orderMode: this.getOrderMode(),
|
|
26383
26416
|
wbsDepth: this._viewAttributes.getWbsDepth()
|
|
@@ -38094,6 +38127,6 @@ var CREATION_KIND = {
|
|
|
38094
38127
|
ROOT: "root"
|
|
38095
38128
|
};
|
|
38096
38129
|
|
|
38097
|
-
export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, ACTIVITY_PROGRESS_ORIGIN, ACTIVITY_TYPE, BASELINE_ROLE, CALENDAR_UNIT, CHANGE_SET_SOURCE_KIND, COLUMN, COMPLETED_PROGRESS, CONFIRMATION_KIND, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, CONSTRAINT_WARNING_KIND, CREATION_KIND, P6_PROPERTY_CONTRACT as DATA_DATE_PROPERTY_CONTRACT, DATE_GESTURE_KIND, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_LINK_OPERATION_KIND, DISPATCH_TRACK_EVENT, P6CapabilityError as DataDateCapabilityError, EDIT_ALERT_KEY, EDIT_DENIAL_REASON, ENTITY_CHANGE_KIND, FILTER_FIELD, FILTER_LOGIC, FILTER_OPERATOR, FILTER_REJECTION_REASON, FILTER_VALUE_KIND, FLAT_WBS_DEPTH, GROUP_ID_PREFIX, GROUP_ID_SEPARATOR, LINK_BATCH_OPERATION_KIND, LINK_CODE, LINK_CODE_TO_TYPE, LINK_REJECTION_REASON, LINK_RELATIONSHIP, LINK_TYPE, LINK_TYPE_CODE, LOOKAHEAD_CONFIRMATION_KIND, LookaheadActualTransitionError, MINIMUM_GROUP_DEPTH, MINIMUM_GROUP_LEVEL, NEW_ACTIVITY_DEFAULTS, NOT_STARTED_PROGRESS, ORDER_DIRECTION, ORDER_MODE, PASTE_PLACEMENT, PERSISTENCE_REBASE_CONFLICT_KIND, PERSISTENCE_REBASE_ENTITY, REJECTION_REASON, RESTORABLE_ACTIVITY_FIELDS, ROOT_PARENT_ID, SCHEDULE_CORE_STATUS, SCHEDULE_EFFECT_KIND, SIR_AUTO_REJECT_REASON, STATUS, STATUS_CRITERIA, STRUCTURE_ACTIVITY_FIELDS, ScheduleCore, UNASSIGNED_GROUP_LABEL, UNASSIGNED_VALUE_ID, VIEW_ATTRIBUTE_KIND, VISUAL_ROW_KIND, WORK_TIME_DIRECTION, activityBackendRow, allowedSecondaryConstraintTypes, appendGroupRowId, buildGroupRowId, checkNoUpdatedLinks, computeExpectedProgress, createCalendarReader, createLookaheadDerivedFields, createOutbuildP6ScheduleSettings as createOutbuildDataDateScheduleSettings, createSchedule, p6InputFromDto as dataDateInputFromDto, decodeWireValue, encodeWireValue, expectedProgressFromBaseline, formatUtcAsP6WallDate, getActiveBaseline, getUnsavedActivities, hostScheduleInput, isRestorableActivityField, isRevertibleActivityField, isRootParent, isViewAttributeCriterion, isViewAttributeOrderRule, linkBackendRow, loadTimeWork, mapP6ScheduleOptions as mapDataDateScheduleOptions, movedToAnotherUtcDay, normalizeParentKey, parseFromBackend, parseP6DayAsCalendarStart, parseP6WallDateAsUtc, planLookaheadProgressActuals, prepareLookaheadProgressActuals, prepareLookaheadProgressActualsForPersistence, rescheduledOnLoad, resolveExpectedFinishDateSelection, resolveLookaheadActualDateSelection, serializeP6Activity as serializeDataDateActivity, serializeP6Settings as serializeDataDateSettings, serializeP6State as serializeDataDateState, willRunCriticalPath, yieldToBrowser };
|
|
38130
|
+
export { ACTIVITY_BATCH_ACTION_KIND, ACTIVITY_BATCH_MODE, ACTIVITY_DATE_EDGE, ACTIVITY_FIELD, ACTIVITY_PONDERATOR_CRITERION, ACTIVITY_PROGRESS_ORIGIN, ACTIVITY_TYPE, BASELINE_ROLE, CALENDAR_UNIT, CHANGE_SET_SOURCE_KIND, COLUMN, COMPLETED_PROGRESS, CONFIRMATION_KIND, CONSTRAINT_TYPE, CONSTRAINT_TYPE_TO_LABEL, CONSTRAINT_WARNING_KIND, CREATION_KIND, P6_PROPERTY_CONTRACT as DATA_DATE_PROPERTY_CONTRACT, DATE_GESTURE_KIND, DEFAULT_HOURS_PER_DAY, DISPATCH_ACTION_KIND, DISPATCH_ACTION_KINDS, DISPATCH_LINK_OPERATION_KIND, DISPATCH_TRACK_EVENT, P6CapabilityError as DataDateCapabilityError, EDIT_ALERT_KEY, EDIT_DENIAL_REASON, ENTITY_CHANGE_KIND, FILTER_FIELD, FILTER_LOGIC, FILTER_OPERATOR, FILTER_REJECTION_REASON, FILTER_VALUE_KIND, FLAT_WBS_DEPTH, GROUP_ID_PREFIX, GROUP_ID_SEPARATOR, LINK_BATCH_OPERATION_KIND, LINK_CODE, LINK_CODE_TO_TYPE, LINK_REJECTION_REASON, LINK_RELATIONSHIP, LINK_TYPE, LINK_TYPE_CODE, LOOKAHEAD_CONFIRMATION_KIND, LookaheadActualTransitionError, MINIMUM_GROUP_DEPTH, MINIMUM_GROUP_LEVEL, NEW_ACTIVITY_DEFAULTS, NOT_STARTED_PROGRESS, ORDER_DIRECTION, ORDER_MODE, PASTE_PLACEMENT, PERSISTENCE_REBASE_CONFLICT_KIND, PERSISTENCE_REBASE_ENTITY, REJECTION_REASON, RESTORABLE_ACTIVITY_FIELDS, ROOT_PARENT_ID, SCHEDULE_CORE_STATUS, SCHEDULE_EFFECT_KIND, SIR_AUTO_REJECT_REASON, STATUS, STATUS_CRITERIA, STRUCTURE_ACTIVITY_FIELDS, ScheduleCore, UNASSIGNED_GROUP_LABEL, UNASSIGNED_VALUE_ID, VIEW_ATTRIBUTE_KIND, VISUAL_ROW_KIND, WORK_TIME_DIRECTION, activityBackendRow, allowedSecondaryConstraintTypes, appendGroupRowId, baselineVarianceDays, buildGroupRowId, checkNoUpdatedLinks, computeExpectedProgress, createCalendarReader, createLookaheadDerivedFields, createOutbuildP6ScheduleSettings as createOutbuildDataDateScheduleSettings, createSchedule, p6InputFromDto as dataDateInputFromDto, decodeWireValue, encodeWireValue, expectedProgressFromBaseline, formatUtcAsP6WallDate, getActiveBaseline, getUnsavedActivities, getVisibleBaseline, hostScheduleInput, isRestorableActivityField, isRevertibleActivityField, isRootParent, isViewAttributeCriterion, isViewAttributeOrderRule, linkBackendRow, loadTimeWork, mapP6ScheduleOptions as mapDataDateScheduleOptions, movedToAnotherUtcDay, normalizeParentKey, parseFromBackend, parseP6DayAsCalendarStart, parseP6WallDateAsUtc, planLookaheadProgressActuals, prepareLookaheadProgressActuals, prepareLookaheadProgressActualsForPersistence, rescheduledOnLoad, resolveExpectedFinishDateSelection, resolveLookaheadActualDateSelection, serializeP6Activity as serializeDataDateActivity, serializeP6Settings as serializeDataDateSettings, serializeP6State as serializeDataDateState, willRunCriticalPath, yieldToBrowser };
|
|
38098
38131
|
//# sourceMappingURL=index.js.map
|
|
38099
38132
|
//# sourceMappingURL=index.js.map
|