@outbuild-company/schedule-core 1.13.0 → 1.13.3
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/cdn/schedule-core.global.js +1 -1
- package/dist/cdn/schedule-core.global.js.map +1 -1
- package/dist/index.cjs +72 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +71 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3587,33 +3587,65 @@ function parseLinkTypeCode(raw) {
|
|
|
3587
3587
|
return void 0;
|
|
3588
3588
|
}
|
|
3589
3589
|
var LINK_ENTRY_SEPARATOR = ";";
|
|
3590
|
-
var
|
|
3590
|
+
var LAG_UNIT = {
|
|
3591
|
+
DAY: "d",
|
|
3592
|
+
WEEK: "w",
|
|
3593
|
+
WEEK_DHTMLX: "wk",
|
|
3594
|
+
MONTH: "m",
|
|
3595
|
+
MONTH_DHTMLX: "mon",
|
|
3596
|
+
YEAR: "y"
|
|
3597
|
+
};
|
|
3598
|
+
var ENTRY_RE = /^(\d+)(fs|ss|ff|sf)?(?:([+-]?)(\d+(?:\.\d+)?)(weeks?|wk|w|months?|mon|m|days?|d|years?|y)?)?$/i;
|
|
3591
3599
|
|
|
3592
3600
|
// src/autoscheduler/links/parse-predecessor-string.ts
|
|
3593
|
-
|
|
3601
|
+
var DEFAULT_WORKING_DAYS_PER_WEEK = 5;
|
|
3602
|
+
var DAYS_PER_MONTH = 30;
|
|
3603
|
+
var DAYS_PER_YEAR = 365;
|
|
3604
|
+
var FIXED_UNIT_DAYS = {
|
|
3605
|
+
[LAG_UNIT.DAY]: 1,
|
|
3606
|
+
day: 1,
|
|
3607
|
+
days: 1,
|
|
3608
|
+
[LAG_UNIT.MONTH]: DAYS_PER_MONTH,
|
|
3609
|
+
[LAG_UNIT.MONTH_DHTMLX]: DAYS_PER_MONTH,
|
|
3610
|
+
month: DAYS_PER_MONTH,
|
|
3611
|
+
months: DAYS_PER_MONTH,
|
|
3612
|
+
[LAG_UNIT.YEAR]: DAYS_PER_YEAR,
|
|
3613
|
+
year: DAYS_PER_YEAR,
|
|
3614
|
+
years: DAYS_PER_YEAR
|
|
3615
|
+
};
|
|
3616
|
+
var WEEK_UNITS = /* @__PURE__ */ new Set([
|
|
3617
|
+
LAG_UNIT.WEEK,
|
|
3618
|
+
LAG_UNIT.WEEK_DHTMLX,
|
|
3619
|
+
"week",
|
|
3620
|
+
"weeks"
|
|
3621
|
+
]);
|
|
3622
|
+
function parsePredecessorString(input, options = {}) {
|
|
3594
3623
|
const specs = [];
|
|
3595
3624
|
const errors = [];
|
|
3625
|
+
const daysPerWeek = options.daysPerWeek !== void 0 && Number.isFinite(options.daysPerWeek) && options.daysPerWeek > 0 ? options.daysPerWeek : DEFAULT_WORKING_DAYS_PER_WEEK;
|
|
3596
3626
|
const trimmed = input.replace(/\s+/g, "");
|
|
3597
3627
|
if (trimmed.length === 0) return { specs, errors };
|
|
3598
3628
|
for (const raw of trimmed.split(LINK_ENTRY_SEPARATOR)) {
|
|
3599
3629
|
if (raw.length === 0) continue;
|
|
3600
|
-
const spec = parseEntry(raw);
|
|
3630
|
+
const spec = parseEntry(raw, daysPerWeek);
|
|
3601
3631
|
if (spec) specs.push(spec);
|
|
3602
3632
|
else errors.push(raw);
|
|
3603
3633
|
}
|
|
3604
3634
|
return { specs, errors };
|
|
3605
3635
|
}
|
|
3606
|
-
function parseEntry(entry) {
|
|
3636
|
+
function parseEntry(entry, daysPerWeek) {
|
|
3607
3637
|
const lower = entry.toLowerCase();
|
|
3608
3638
|
const match = ENTRY_RE.exec(lower);
|
|
3609
3639
|
if (!match) return null;
|
|
3610
|
-
const [, correlativeId, typeStr, sign, magnitude] = match;
|
|
3640
|
+
const [, correlativeId, typeStr, sign, magnitude, unit] = match;
|
|
3611
3641
|
const type = typeStr ? LINK_CODE_TO_TYPE[typeStr] : LINK_CODE_TO_TYPE[DEFAULT_LINK_CODE];
|
|
3612
3642
|
let lag = 0;
|
|
3613
3643
|
if (magnitude !== void 0) {
|
|
3614
3644
|
const value = Number(magnitude);
|
|
3615
3645
|
if (Number.isNaN(value)) return null;
|
|
3616
|
-
|
|
3646
|
+
const unitDays = unit !== void 0 && WEEK_UNITS.has(unit) ? daysPerWeek : FIXED_UNIT_DAYS[unit ?? LAG_UNIT.DAY];
|
|
3647
|
+
const days = value * unitDays;
|
|
3648
|
+
lag = sign === "-" ? -days : days;
|
|
3617
3649
|
}
|
|
3618
3650
|
return {
|
|
3619
3651
|
correlativeId,
|
|
@@ -4513,8 +4545,19 @@ var POST_PROCESSOR = {
|
|
|
4513
4545
|
var VALIDATION_REASON = {
|
|
4514
4546
|
NEGATIVE_DURATION: "negative_duration"};
|
|
4515
4547
|
var EDIT_DENIAL_REASON = {
|
|
4548
|
+
COMPLETED: "completed",
|
|
4516
4549
|
SUMMARY: "summary",
|
|
4517
|
-
|
|
4550
|
+
HAS_PROGRESS: "has_progress",
|
|
4551
|
+
HAS_LOOKAHEAD_TASKS: "has_lookahead_tasks",
|
|
4552
|
+
SIR_START_AFTER_PROGRESS: "sir_start_after_progress"
|
|
4553
|
+
};
|
|
4554
|
+
var EDIT_ALERT_KEY = {
|
|
4555
|
+
CANT_EDIT_COMPLETED: "cant_edit_completed_activity",
|
|
4556
|
+
SUMMARY_COLUMN_VALUE: "summary_column_value",
|
|
4557
|
+
CANT_EDIT_WITH_PROGRESS: "cant_edit_activity_with_progress",
|
|
4558
|
+
SIR_CANT_MOVE_START_AFTER_PROGRESS: "sir_cant_move_start_after_progress",
|
|
4559
|
+
CANT_EDIT_WITH_TASK: "cant_edit_actvity_with_task"
|
|
4560
|
+
};
|
|
4518
4561
|
|
|
4519
4562
|
// src/columns/shared/constraint-validation.ts
|
|
4520
4563
|
function checkConstraintViolation2(constraintType, constraintDate, projectedDate) {
|
|
@@ -4637,10 +4680,10 @@ var MAX_PROGRESS = PROGRESS_COMPLETE;
|
|
|
4637
4680
|
var progressPipeline = {
|
|
4638
4681
|
targetField: "progress",
|
|
4639
4682
|
canEdit(activity, hierarchy) {
|
|
4640
|
-
if (hasLookaheadTasks(activity))
|
|
4641
|
-
return cannotEdit("has_lookahead_tasks", "cant_edit_actvity_with_task");
|
|
4642
4683
|
if (isSummaryActivity2(activity, hierarchy))
|
|
4643
4684
|
return cannotEdit("summary", "summary_column_value");
|
|
4685
|
+
if (hasLookaheadTasks(activity))
|
|
4686
|
+
return cannotEdit("has_lookahead_tasks", "cant_edit_actvity_with_task");
|
|
4644
4687
|
return canEdit();
|
|
4645
4688
|
},
|
|
4646
4689
|
parseInput(rawValue) {
|
|
@@ -11873,7 +11916,13 @@ async function dispatchInlineEditLinks(action, options, deps) {
|
|
|
11873
11916
|
return { ok: false, reason: REJECTION_REASON.ACTIVITY_NOT_FOUND };
|
|
11874
11917
|
}
|
|
11875
11918
|
const isPredecessors = action.column === COLUMN.CUSTOM_PREDECESSORS;
|
|
11876
|
-
const { specs: specsInDays } = parsePredecessorString(
|
|
11919
|
+
const { specs: specsInDays, errors } = parsePredecessorString(
|
|
11920
|
+
action.newValue,
|
|
11921
|
+
{ daysPerWeek: sector.hoursPerWeek / sector.hoursPerDay }
|
|
11922
|
+
);
|
|
11923
|
+
if (errors.length > 0) {
|
|
11924
|
+
return { ok: false, reason: REJECTION_REASON.INVALID_VALUE };
|
|
11925
|
+
}
|
|
11877
11926
|
const specs = specsInDays.map((spec) => ({
|
|
11878
11927
|
...spec,
|
|
11879
11928
|
lag: lagDaysToHours(roundLagDays(spec.lag), sector.hoursPerDay)
|
|
@@ -22765,6 +22814,17 @@ var ScheduleCore = class _ScheduleCore {
|
|
|
22765
22814
|
this.assertReady();
|
|
22766
22815
|
return readActivity(this.coreRuntime.state, id);
|
|
22767
22816
|
}
|
|
22817
|
+
/** Returns the canonical progress editability decision without mutation. */
|
|
22818
|
+
getProgressEditability(id) {
|
|
22819
|
+
this.assertReady();
|
|
22820
|
+
const activity = readActivity(this.coreRuntime.state, id);
|
|
22821
|
+
if (!activity) return null;
|
|
22822
|
+
const context = buildPipelineContext(this.coreRuntime.state, {
|
|
22823
|
+
hoursPerDay: this.coreRuntime.sector.hoursPerDay,
|
|
22824
|
+
dateFormat: this.coreRuntime.sector.dateFormat
|
|
22825
|
+
});
|
|
22826
|
+
return progressPipeline.canEdit(activity, context.hierarchy);
|
|
22827
|
+
}
|
|
22768
22828
|
/**
|
|
22769
22829
|
* Creates a read-only date prediction bound to the current revision.
|
|
22770
22830
|
*
|
|
@@ -23759,6 +23819,8 @@ exports.DISPATCH_ACTION_KIND = DISPATCH_ACTION_KIND;
|
|
|
23759
23819
|
exports.DISPATCH_ACTION_KINDS = DISPATCH_ACTION_KINDS;
|
|
23760
23820
|
exports.DISPATCH_LINK_OPERATION_KIND = DISPATCH_LINK_OPERATION_KIND;
|
|
23761
23821
|
exports.DISPATCH_TRACK_EVENT = DISPATCH_TRACK_EVENT;
|
|
23822
|
+
exports.EDIT_ALERT_KEY = EDIT_ALERT_KEY;
|
|
23823
|
+
exports.EDIT_DENIAL_REASON = EDIT_DENIAL_REASON;
|
|
23762
23824
|
exports.ENTITY_CHANGE_KIND = ENTITY_CHANGE_KIND;
|
|
23763
23825
|
exports.FILTER_FIELD = FILTER_FIELD;
|
|
23764
23826
|
exports.FILTER_LOGIC = FILTER_LOGIC;
|