@g9tm/lynxcontrols-projects 2.5.9 → 2.5.10
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/README.md +5 -0
- package/catalog/cards/G9ActivityFeed.md +17 -0
- package/catalog/cards/G9FileBrowser.md +17 -0
- package/catalog/cards/G9FormBuilder.md +15 -0
- package/catalog/cards/G9OrgChart.md +17 -0
- package/catalog/cards/G9QuestionField.md +17 -0
- package/catalog/cards/G9Timeline.md +3 -3
- package/catalog/catalog.json +2090 -18
- package/catalog/index.md +6 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/activity.css +105 -0
- package/dist/activity.css.map +1 -0
- package/dist/activity.d.ts +49 -0
- package/dist/activity.d.ts.map +1 -0
- package/dist/activity.jsx +129 -0
- package/dist/files.css +264 -0
- package/dist/files.css.map +1 -0
- package/dist/files.d.ts +86 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.jsx +318 -0
- package/dist/forms.css +144 -0
- package/dist/forms.css.map +1 -0
- package/dist/forms.d.ts +89 -0
- package/dist/forms.d.ts.map +1 -0
- package/dist/forms.jsx +359 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.jsx +4 -0
- package/dist/org-chart.css +127 -0
- package/dist/org-chart.css.map +1 -0
- package/dist/org-chart.d.ts +73 -0
- package/dist/org-chart.d.ts.map +1 -0
- package/dist/org-chart.jsx +388 -0
- package/dist/projects.css +49 -0
- package/dist/projects.css.map +1 -1
- package/dist/rule-builder.d.ts +6 -0
- package/dist/rule-builder.d.ts.map +1 -1
- package/dist/rule-builder.jsx +24 -3
- package/dist/timeline.d.ts +28 -0
- package/dist/timeline.d.ts.map +1 -1
- package/dist/timeline.jsx +150 -14
- package/package.json +3 -3
package/dist/timeline.d.ts
CHANGED
|
@@ -20,6 +20,18 @@ export interface G9TimelineRow {
|
|
|
20
20
|
readonly dependsOn?: readonly string[];
|
|
21
21
|
/** Its bar is not moved by a drag. */
|
|
22
22
|
readonly locked?: boolean;
|
|
23
|
+
/** The task's code before the title («HUB-142»), left to right. */
|
|
24
|
+
readonly code?: string;
|
|
25
|
+
/** Who it is assigned to: an avatar in the titles column. */
|
|
26
|
+
readonly assignee?: {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly avatar?: string | null;
|
|
29
|
+
readonly id?: string;
|
|
30
|
+
} | null;
|
|
31
|
+
/** A short text at the end of the title («3/5» on a milestone). */
|
|
32
|
+
readonly meta?: string;
|
|
33
|
+
/** Past its day and not done: a milestone turns red (done: green). */
|
|
34
|
+
readonly late?: boolean;
|
|
23
35
|
}
|
|
24
36
|
/** Props of {@link G9Timeline}. */
|
|
25
37
|
export interface G9TimelineProps {
|
|
@@ -54,6 +66,22 @@ export interface G9TimelineProps {
|
|
|
54
66
|
readonly todayLabel?: string;
|
|
55
67
|
/** How a bar is spoken (default its title). */
|
|
56
68
|
readonly barLabel?: (row: G9TimelineRow) => string;
|
|
69
|
+
/** Scrolls to this row's bar or milestone (open on a milestone); again whenever it changes. */
|
|
70
|
+
readonly scrollToKey?: string | null;
|
|
71
|
+
/** The organisation's days off (epoch days), shaded like the weekend. */
|
|
72
|
+
readonly daysOff?: readonly number[];
|
|
73
|
+
/**
|
|
74
|
+
* The keyboard edits the focused bar (default on with `onSpanChange`): ←/→ move it, Shift+←/→ the due date, Alt+←/→
|
|
75
|
+
* the start, ↑/↓ the row; saved after a pause.
|
|
76
|
+
*/
|
|
77
|
+
readonly keyboard?: boolean;
|
|
78
|
+
/** ↑/↓ moved the focus (without it the timeline keeps the focus itself). */
|
|
79
|
+
readonly onFocusChange?: (key: string) => void;
|
|
80
|
+
/** Said after a keyboard change (the app's announcer): `announceLabel` or the title and the days. */
|
|
81
|
+
readonly onAnnounce?: (text: string) => void;
|
|
82
|
+
readonly announceLabel?: (row: G9TimelineRow, span: G9DaySpan) => string;
|
|
83
|
+
/** How long the keyboard waits before saving (ms). Default 700. */
|
|
84
|
+
readonly keyboardSaveDelay?: number;
|
|
57
85
|
}
|
|
58
86
|
/** A Gantt chart: rows and bars an app keeps, moved and resized on the main thread, in the culture's calendar. */
|
|
59
87
|
export declare function G9Timeline(props: G9TimelineProps): ReactNode;
|
package/dist/timeline.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../src/timeline.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../src/timeline.tsx"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,SAAS,EAQf,MAAM,gBAAgB,CAAC;AAExB,OAAO,gBAAgB,CAAC;AACxB,OAAO,EAGL,KAAK,SAAS,EAEd,KAAK,cAAc,EAYpB,MAAM,SAAS,CAAC;AAEjB,+BAA+B;AAC/B,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACjC,yBAAyB;IACzB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,oDAAoD;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,uCAAuC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,sCAAsC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE1B,mEAAmE;I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CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { measureNode } from "@g9tm/lynxcontrols/anchor";
|
|
2
2
|
import { g9IdProps } from "@g9tm/lynxcontrols/base";
|
|
3
|
+
import { useG9Keys } from "@g9tm/lynxcontrols/commands";
|
|
4
|
+
import { G9Avatar, avatarTone } from "@g9tm/lynxcontrols/display";
|
|
3
5
|
import { useG9Culture, useG9Direction } from "@g9tm/lynxcontrols/provider";
|
|
4
6
|
import { G9Segmented } from "@g9tm/lynxcontrols/toggle";
|
|
5
7
|
import { fromEpochDays, g9Haptic, getMonthName, toCalendarDate, toNativeDigits } from "@g9tm/lynxcontrols-foundation";
|
|
6
|
-
import { memo, runOnBackground, runOnMainThread, useMainThreadRef, useMemo, useRef } from "@lynx-js/react";
|
|
8
|
+
import { memo, runOnBackground, runOnMainThread, useEffect, useMainThreadRef, useMemo, useRef, useState } from "@lynx-js/react";
|
|
7
9
|
import "./projects.css";
|
|
8
10
|
import { dayToX, dragSpanMT, linkSegments, monthStarts, nextMonthStart, physicalLeft, snapDaysMT, timelineRange, timelineScale, timelineWidth, weekStarts, weekdayOf, xToDay } from "./model.jsx";
|
|
9
11
|
const IDLE = {
|
|
@@ -129,7 +131,8 @@ const Bar = memo(function(props) {
|
|
|
129
131
|
</>;
|
|
130
132
|
});
|
|
131
133
|
function G9Timeline(props) {
|
|
132
|
-
var _props_zoom, _props_rowHeight, _props_labelWidth, _props_weekStartsOn, _props_weekend, _props_range, _props_todayLabel;
|
|
134
|
+
var _props_zoom, _props_rowHeight, _props_labelWidth, _props_weekStartsOn, _props_weekend, _props_range, _props_focusedKey, _props_keyboard, _props_daysOff, _ref, _props_todayLabel;
|
|
135
|
+
var _scrollTarget_span;
|
|
133
136
|
const culture = useG9Culture();
|
|
134
137
|
const rtl = 'rtl' === useG9Direction();
|
|
135
138
|
const uid = useMemo(()=>{
|
|
@@ -169,6 +172,82 @@ function G9Timeline(props) {
|
|
|
169
172
|
const latest = useRef(props);
|
|
170
173
|
latest.current = props;
|
|
171
174
|
const scrollLeft = useRef(0);
|
|
175
|
+
const chartNode = useRef(null);
|
|
176
|
+
const [ownFocus, setOwnFocus] = useState(null != (_props_focusedKey = props.focusedKey) ? _props_focusedKey : null);
|
|
177
|
+
useEffect(()=>{
|
|
178
|
+
var _props_focusedKey;
|
|
179
|
+
return setOwnFocus(null != (_props_focusedKey = props.focusedKey) ? _props_focusedKey : null);
|
|
180
|
+
}, [
|
|
181
|
+
props.focusedKey
|
|
182
|
+
]);
|
|
183
|
+
const focusKey = ownFocus;
|
|
184
|
+
const [pending, setPending] = useState(null);
|
|
185
|
+
const timer = useRef(null);
|
|
186
|
+
const pendingRef = useRef(pending);
|
|
187
|
+
pendingRef.current = pending;
|
|
188
|
+
const flush = ()=>{
|
|
189
|
+
var _latest_current_onSpanChange, _latest_current;
|
|
190
|
+
if (timer.current) clearTimeout(timer.current);
|
|
191
|
+
timer.current = null;
|
|
192
|
+
const p = pendingRef.current;
|
|
193
|
+
if (!p) return;
|
|
194
|
+
setPending(null);
|
|
195
|
+
pendingRef.current = null;
|
|
196
|
+
null == (_latest_current_onSpanChange = (_latest_current = latest.current).onSpanChange) || _latest_current_onSpanChange.call(_latest_current, p.key, p.span);
|
|
197
|
+
};
|
|
198
|
+
useEffect(()=>()=>{
|
|
199
|
+
if (timer.current) clearTimeout(timer.current);
|
|
200
|
+
}, []);
|
|
201
|
+
const editable = (r)=>!!r && 'group' !== r.kind && true !== r.locked && !!r.span;
|
|
202
|
+
useG9Keys((e)=>{
|
|
203
|
+
var _latest_current_keyboardSaveDelay;
|
|
204
|
+
var _pendingRef_current, _latest_current_onAnnounce, _latest_current;
|
|
205
|
+
const rows = latest.current.rows;
|
|
206
|
+
const i = rows.findIndex((r)=>r.key === focusKey);
|
|
207
|
+
const row = rows[i];
|
|
208
|
+
if (!row) return false;
|
|
209
|
+
if ('ArrowUp' === e.key || 'ArrowDown' === e.key) {
|
|
210
|
+
const step = 'ArrowDown' === e.key ? 1 : -1;
|
|
211
|
+
for(let j = i + step; j >= 0 && j < rows.length; j += step){
|
|
212
|
+
var _latest_current_onFocusChange, _latest_current1;
|
|
213
|
+
const next = rows[j];
|
|
214
|
+
if ('group' !== next.kind) {
|
|
215
|
+
flush();
|
|
216
|
+
setOwnFocus(next.key);
|
|
217
|
+
null == (_latest_current_onFocusChange = (_latest_current1 = latest.current).onFocusChange) || _latest_current_onFocusChange.call(_latest_current1, next.key);
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
if ('ArrowLeft' !== e.key && 'ArrowRight' !== e.key || !editable(row)) return false;
|
|
224
|
+
const base = (null == (_pendingRef_current = pendingRef.current) ? void 0 : _pendingRef_current.key) === row.key ? pendingRef.current.span : row.span;
|
|
225
|
+
const d = ('ArrowRight' === e.key ? 1 : -1) * (rtl ? -1 : 1);
|
|
226
|
+
const next = e.shift ? {
|
|
227
|
+
start: base.start,
|
|
228
|
+
end: Math.max(base.start, base.end + d)
|
|
229
|
+
} : e.alt ? {
|
|
230
|
+
start: Math.min(base.end, base.start + d),
|
|
231
|
+
end: base.end
|
|
232
|
+
} : {
|
|
233
|
+
start: base.start + d,
|
|
234
|
+
end: base.end + d
|
|
235
|
+
};
|
|
236
|
+
const now = {
|
|
237
|
+
key: row.key,
|
|
238
|
+
span: next
|
|
239
|
+
};
|
|
240
|
+
setPending(now);
|
|
241
|
+
pendingRef.current = now;
|
|
242
|
+
g9Haptic('select');
|
|
243
|
+
const said = latest.current.announceLabel ? latest.current.announceLabel(row, next) : `${row.title}: ${toNativeDigits(String(toCalendarDate(fromEpochDays(next.start), culture.calendar).day), culture.numberingSystem)}–${toNativeDigits(String(toCalendarDate(fromEpochDays(next.end), culture.calendar).day), culture.numberingSystem)}`;
|
|
244
|
+
null == (_latest_current_onAnnounce = (_latest_current = latest.current).onAnnounce) || _latest_current_onAnnounce.call(_latest_current, said);
|
|
245
|
+
if (timer.current) clearTimeout(timer.current);
|
|
246
|
+
timer.current = setTimeout(flush, null != (_latest_current_keyboardSaveDelay = latest.current.keyboardSaveDelay) ? _latest_current_keyboardSaveDelay : 700);
|
|
247
|
+
return true;
|
|
248
|
+
}, {
|
|
249
|
+
enabled: (null != (_props_keyboard = props.keyboard) ? _props_keyboard : void 0 !== props.onSpanChange) && null !== focusKey
|
|
250
|
+
});
|
|
172
251
|
const commit = (key, start, end)=>{
|
|
173
252
|
var _latest_current_onSpanChange, _latest_current;
|
|
174
253
|
g9Haptic('select');
|
|
@@ -219,8 +298,9 @@ function G9Timeline(props) {
|
|
|
219
298
|
label: digits(toCalendarDate(fromEpochDays(d), culture.calendar).day)
|
|
220
299
|
}));
|
|
221
300
|
const shaded = [];
|
|
301
|
+
const off = new Set(null != (_props_daysOff = props.daysOff) ? _props_daysOff : []);
|
|
222
302
|
if ('quarter' !== zoom) {
|
|
223
|
-
for(let d = range.from; d <= range.to; d++)if (weekend.includes(weekdayOf(d))) shaded.push(d);
|
|
303
|
+
for(let d = range.from; d <= range.to; d++)if (weekend.includes(weekdayOf(d)) || off.has(d)) shaded.push(d);
|
|
224
304
|
}
|
|
225
305
|
const index = new Map(props.rows.map((r, i)=>[
|
|
226
306
|
r.key,
|
|
@@ -237,6 +317,32 @@ function G9Timeline(props) {
|
|
|
237
317
|
}) : []);
|
|
238
318
|
const headH = 'quarter' === zoom ? 28 : 52;
|
|
239
319
|
const todayX = dayToX(props.today, scale);
|
|
320
|
+
const scrollTarget = props.scrollToKey ? props.rows.find((r)=>r.key === props.scrollToKey) : void 0;
|
|
321
|
+
const targetDay = null != (_ref = null == scrollTarget ? void 0 : null == (_scrollTarget_span = scrollTarget.span) ? void 0 : _scrollTarget_span.start) ? _ref : null == scrollTarget ? void 0 : scrollTarget.day;
|
|
322
|
+
useEffect(()=>{
|
|
323
|
+
if (void 0 === targetDay) return;
|
|
324
|
+
const logical = Math.max(0, dayToX(targetDay, scale) - 48);
|
|
325
|
+
const offset = rtl ? Math.max(0, width - logical - 320) : logical;
|
|
326
|
+
const go = ()=>{
|
|
327
|
+
try {
|
|
328
|
+
var _chartNode_current;
|
|
329
|
+
null == (_chartNode_current = chartNode.current) || _chartNode_current.invoke({
|
|
330
|
+
method: 'scrollTo',
|
|
331
|
+
params: {
|
|
332
|
+
offset,
|
|
333
|
+
smooth: true
|
|
334
|
+
}
|
|
335
|
+
}).exec();
|
|
336
|
+
} catch {}
|
|
337
|
+
};
|
|
338
|
+
go();
|
|
339
|
+
const again = setTimeout(go, 120);
|
|
340
|
+
return ()=>clearTimeout(again);
|
|
341
|
+
}, [
|
|
342
|
+
props.scrollToKey,
|
|
343
|
+
targetDay,
|
|
344
|
+
zoom
|
|
345
|
+
]);
|
|
240
346
|
const schedule = async (row, e)=>{
|
|
241
347
|
var _ref;
|
|
242
348
|
var _e_detail;
|
|
@@ -278,7 +384,9 @@ function G9Timeline(props) {
|
|
|
278
384
|
<view style={{
|
|
279
385
|
height: `${headH}px`
|
|
280
386
|
}}/>
|
|
281
|
-
{props.rows.map((r)
|
|
387
|
+
{props.rows.map((r)=>{
|
|
388
|
+
var _r_assignee_avatar, _r_assignee_id;
|
|
389
|
+
return <view key={r.key} className={`g9-tl__label${'group' === r.kind ? ' g9-tl__label--group' : ''}`} {...g9IdProps(props.id ? `${props.id}_${r.key}_Label` : void 0)} style={{
|
|
282
390
|
height: `${rowH}px`
|
|
283
391
|
}} {...props.onOpen && 'group' !== r.kind ? {
|
|
284
392
|
bindtap: ()=>{
|
|
@@ -286,14 +394,29 @@ function G9Timeline(props) {
|
|
|
286
394
|
return null == (_props_onOpen = props.onOpen) ? void 0 : _props_onOpen.call(props, r.key);
|
|
287
395
|
}
|
|
288
396
|
} : {}}>
|
|
289
|
-
<
|
|
397
|
+
<view className="g9-tl__label-row" style={{
|
|
398
|
+
flexDirection: rtl ? 'row-reverse' : 'row',
|
|
399
|
+
direction: 'ltr'
|
|
400
|
+
}}>
|
|
401
|
+
{r.assignee ? <G9Avatar name={r.assignee.name} image={null != (_r_assignee_avatar = r.assignee.avatar) ? _r_assignee_avatar : null} size={20} tone={avatarTone(null != (_r_assignee_id = r.assignee.id) ? _r_assignee_id : r.assignee.name)}/> : null}
|
|
402
|
+
{r.code ? <text className="g9-tl__code g9-tl__code-mono" style={{
|
|
403
|
+
direction: 'ltr'
|
|
404
|
+
}}>
|
|
405
|
+
{r.code}
|
|
406
|
+
</text> : null}
|
|
407
|
+
<text className={`g9-tl__label-text${r.done ? ' g9-tl__label-text--done' : ''}`} text-maxline="1" style={{
|
|
290
408
|
textAlign: rtl ? 'right' : 'left'
|
|
291
409
|
}}>
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
410
|
+
{r.title}
|
|
411
|
+
</text>
|
|
412
|
+
{r.meta ? <text className="g9-tl__meta">{r.meta}</text> : null}
|
|
413
|
+
</view>
|
|
414
|
+
</view>;
|
|
415
|
+
})}
|
|
295
416
|
</view>
|
|
296
|
-
<scroll-view className="g9-tl__chart" id={`${uid}__chart`}
|
|
417
|
+
<scroll-view className="g9-tl__chart" id={`${uid}__chart`} ref={(r)=>{
|
|
418
|
+
chartNode.current = r;
|
|
419
|
+
}} scroll-orientation="horizontal" scroll-event-throttle={100} bindscroll={(e)=>{
|
|
297
420
|
scrollLeft.current = e.detail.scrollLeft;
|
|
298
421
|
}}>
|
|
299
422
|
<view className="g9-tl__canvas" style={{
|
|
@@ -335,7 +458,16 @@ function G9Timeline(props) {
|
|
|
335
458
|
if ('group' === r.kind) return <view key={r.key} className="g9-tl__row g9-tl__row--group" style={{
|
|
336
459
|
top: `${top}px`,
|
|
337
460
|
height: `${rowH}px`
|
|
338
|
-
}}
|
|
461
|
+
}}>
|
|
462
|
+
<text className="g9-tl__group-text" text-maxline="1" style={rtl ? {
|
|
463
|
+
right: '8px',
|
|
464
|
+
textAlign: 'right'
|
|
465
|
+
} : {
|
|
466
|
+
left: '8px'
|
|
467
|
+
}}>
|
|
468
|
+
{r.meta ? `${r.title} · ${r.meta}` : r.title}
|
|
469
|
+
</text>
|
|
470
|
+
</view>;
|
|
339
471
|
if ('milestone' === r.kind && void 0 !== r.day) {
|
|
340
472
|
const x = dayToX(r.day, scale) + px / 2 - 8;
|
|
341
473
|
return <view key={r.key} className="g9-tl__row" style={{
|
|
@@ -345,7 +477,11 @@ function G9Timeline(props) {
|
|
|
345
477
|
<view className="g9-tl__milestone" {...g9IdProps(props.id ? `${props.id}_${r.key}` : void 0)} style={{
|
|
346
478
|
left: `${at(x, 16)}px`,
|
|
347
479
|
top: `${(rowH - 16) / 2}px`,
|
|
348
|
-
...r.
|
|
480
|
+
...r.done ? {
|
|
481
|
+
backgroundColor: 'var(--g9-success)'
|
|
482
|
+
} : r.late ? {
|
|
483
|
+
backgroundColor: 'var(--g9-error)'
|
|
484
|
+
} : r.color ? {
|
|
349
485
|
backgroundColor: r.color
|
|
350
486
|
} : {}
|
|
351
487
|
}} {...props.onOpen ? {
|
|
@@ -353,17 +489,17 @@ function G9Timeline(props) {
|
|
|
353
489
|
var _props_onOpen;
|
|
354
490
|
return null == (_props_onOpen = props.onOpen) ? void 0 : _props_onOpen.call(props, r.key);
|
|
355
491
|
}
|
|
356
|
-
} : {}} accessibility-element={true} accessibility-label={r.title}/>
|
|
492
|
+
} : {}} accessibility-element={true} accessibility-label={r.meta ? `${r.title}, ${r.meta}` : r.title}/>
|
|
357
493
|
</view>;
|
|
358
494
|
}
|
|
359
|
-
const span = r.span;
|
|
495
|
+
const span = (null == pending ? void 0 : pending.key) === r.key ? pending.span : r.span;
|
|
360
496
|
return <view key={r.key} className="g9-tl__row" {...g9IdProps(props.id ? `${props.id}_${r.key}_Row` : void 0)} style={{
|
|
361
497
|
top: `${top}px`,
|
|
362
498
|
height: `${rowH}px`
|
|
363
499
|
}} {...!span && props.onSpanChange ? {
|
|
364
500
|
bindtap: (e)=>void schedule(r, e)
|
|
365
501
|
} : {}}>
|
|
366
|
-
{span ? <Bar row={r} span={span} left={at(dayToX(span.start, scale), (span.end - span.start + 1) * px)} width={(span.end - span.start + 1) * px} origin={scale.origin} px={px} chartWidth={width} rtl={rtl} focused={
|
|
502
|
+
{span ? <Bar row={r} span={span} left={at(dayToX(span.start, scale), (span.end - span.start + 1) * px)} width={(span.end - span.start + 1) * px} origin={scale.origin} px={px} chartWidth={width} rtl={rtl} focused={focusKey === r.key} drag={drag} draggable={void 0 !== props.onSpanChange && true !== r.locked} label={props.barLabel ? props.barLabel(r) : r.title} {...props.onOpen ? {
|
|
367
503
|
onTap: props.onOpen
|
|
368
504
|
} : {}} {...props.id ? {
|
|
369
505
|
barId: `${props.id}_${r.key}`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g9tm/lynxcontrols-projects",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.10",
|
|
4
4
|
"description": "Project controls for G9LynxControls (G9Hub): G9Board (columns of cards dragged on the main thread), G9Timeline (a Gantt chart on the culture calendar with bars moved and resized, dependencies and milestones) and G9TaskCard.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"build": "rslib build"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@g9tm/lynxcontrols-foundation": "2.5.
|
|
32
|
+
"@g9tm/lynxcontrols-foundation": "2.5.10"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@g9tm/lynxcontrols": "2.5.
|
|
35
|
+
"@g9tm/lynxcontrols": "2.5.10",
|
|
36
36
|
"@lynx-js/react": ">=0.129.3 <0.130.0"
|
|
37
37
|
}
|
|
38
38
|
}
|