@ehfuse/taskbox 0.10.29 → 0.10.31

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.
@@ -3,6 +3,7 @@
3
3
  * 등록 드로어와 상세 드로어가 함께 쓴다(공통 속성 그리드 아래에 붙는다).
4
4
  * 재현빈도·디바이스는 자유서술이 아니라 택일이다 — 빈 칸이 보여야 무엇을 적어야 하는지 인지된다.
5
5
  */
6
+ import { type TaskDetailForm } from "../state/useTaskDetailForm";
6
7
  /** 오류 속성 값 묶음이다. */
7
8
  export interface BugPropertyValues {
8
9
  repro: string;
@@ -14,6 +15,7 @@ export interface BugPropertyValues {
14
15
  /** 오류 속성 그리드 props 다. */
15
16
  export interface BugPropertiesGridProps {
16
17
  values: BugPropertyValues;
18
+ form?: TaskDetailForm;
17
19
  readOnly?: boolean;
18
20
  showResolution?: boolean;
19
21
  onChangeRepro: (value: string) => void;
@@ -23,4 +25,4 @@ export interface BugPropertiesGridProps {
23
25
  onChangeResolution?: (value: string) => void;
24
26
  }
25
27
  /** 오류 속성 그리드 컴포넌트다(2열 — 좁은 화면은 1열로 접힌다). */
26
- export declare function BugPropertiesGrid({ values, readOnly, showResolution, onChangeRepro, onChangeDevice, onChangeWhere, onChangeVersion, onChangeResolution, }: BugPropertiesGridProps): import("react").JSX.Element;
28
+ export declare function BugPropertiesGrid({ values, form, readOnly, showResolution, onChangeRepro, onChangeDevice, onChangeWhere, onChangeVersion, onChangeResolution, }: BugPropertiesGridProps): import("react").JSX.Element;
@@ -3,13 +3,18 @@
3
3
  * blur/Enter 로 커밋하고, 외부(다른 사용자 realtime 등)에서 값이 바뀌면 입력값도 따라간다.
4
4
  * 일정 장소/오류 발생화면·버전처럼 검색이 필요 없는 자유 입력 값이 함께 쓴다.
5
5
  * 본체는 mfc 의 PropertyInput 이다(2026-10-22) — 예전 동작(조합 중 Enter 도 벗어남 · Esc 는 드로어로 넘김)을 그대로 켠다.
6
+ * `form` + `name` 을 주면 폼의 그 칸만 구독한다(0.10.30 — 상세 폼, 고치면 폼에 먼저 적고 onCommit 으로 저장한다).
6
7
  */
8
+ import type { ComponentProps } from "react";
9
+ import { PropertyInput } from "@ehfuse/mui-form-controls";
7
10
  /** 속성 값 인라인 입력 props 다. */
8
11
  export interface InlineTextValueProps {
9
- value: string;
12
+ value?: string;
10
13
  placeholder: string;
11
14
  readOnly?: boolean;
12
15
  onCommit: (next: string) => void;
16
+ form?: ComponentProps<typeof PropertyInput>["form"];
17
+ name?: string;
13
18
  }
14
19
  /** 속성 값 인라인 입력 컴포넌트다. */
15
- export declare function InlineTextValue({ value, placeholder, readOnly, onCommit }: InlineTextValueProps): import("react").JSX.Element;
20
+ export declare function InlineTextValue({ value, placeholder, readOnly, onCommit, form, name }: InlineTextValueProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * 상세 드로어의 "기여도" 섹션(0.10.31) — 관여자(책임자 · 참조자)마다 몫(%)을 적는다. 합은 100% 여야 저장된다.
3
+ * 소비처가 조직 설정으로 켠 업무에만 선다(TaskDetailBody 의 contributionEnabled — 일정 · 공지 · 글에는 없다).
4
+ *
5
+ * 값은 상세 폼(useTaskDetailForm)의 "contributions.<계정 seq>" 칸이다 — 한 사람의 몫을 고치면 그 줄과 합계만 다시 그린다.
6
+ * 칸을 벗어날 때(Enter · blur) 합이 100 이면 바로 저장하고, 아니면 저장하지 않고 합계를 빨갛게 둔다
7
+ * (99% 인 채로 저장되면 월별 집계가 어긋난다 — 서버도 받지 않는다).
8
+ */
9
+ import type { TaskBoxContribution } from "../types";
10
+ import { type TaskDetailForm } from "../state/useTaskDetailForm";
11
+ import { type TaskContributionParticipant } from "../utils/taskContribution";
12
+ /** 기여도 섹션 props. */
13
+ export interface TaskContributionSectionProps {
14
+ form: TaskDetailForm;
15
+ participants: TaskContributionParticipant[];
16
+ readOnly: boolean;
17
+ avatarSrcByName?: Map<string, string>;
18
+ onSave: (contributions: TaskBoxContribution[]) => void;
19
+ }
20
+ /** 기여도 섹션. */
21
+ export declare function TaskContributionSection({ form, participants, readOnly, avatarSrcByName, onSave }: TaskContributionSectionProps): import("react").JSX.Element;
@@ -11,6 +11,7 @@ import { type ReactNode } from "react";
11
11
  import { type SxProps, type Theme } from "@mui/material";
12
12
  import type { SystemStyleObject } from "@mui/system";
13
13
  import type { TaskBoxCustomTab, TaskBoxMemberField, TaskBoxPriority, TaskBoxReminder } from "../types";
14
+ import { type TaskDetailForm } from "../state/useTaskDetailForm";
14
15
  /** 그리드에 표시할 속성 값 묶음이다. */
15
16
  export interface TaskCoreValues {
16
17
  tabKey: string;
@@ -35,6 +36,7 @@ export interface TaskSupportOriginInfo {
35
36
  /** 업무 공통 속성 그리드 props 다. */
36
37
  export interface TaskCorePropertiesGridProps {
37
38
  values: TaskCoreValues;
39
+ form?: TaskDetailForm;
38
40
  customTabs: TaskBoxCustomTab[];
39
41
  avatarSrcByName?: Map<string, string>;
40
42
  managerLocked?: boolean;
@@ -82,4 +84,4 @@ export declare const TASKBOX_GRID_FOUR_CQ = "@container (min-width: 1180px)";
82
84
  * sx 배열 원소로도 섞어 쓸 수 있게 SxProps 가 아니라 단일 스타일 객체 타입으로 돌려준다. */
83
85
  export declare const wideColumnSx: (column: 1 | 2) => SystemStyleObject<Theme>;
84
86
  /** 업무 공통 속성 그리드 컴포넌트다. */
85
- export declare function TaskCorePropertiesGrid({ values, customTabs, avatarSrcByName, managerLocked, notice, event, hideDueDate, hideReminder, beforeStart, pinColumns, projectColumn, afterProject, readOnly, coreLocked, targetSummary, narrowCollapsedSx, reminderLocked, managerAction, hideProject, hideManager, hideReceivers, hideStartDate, hidePriority, leading, supportOrigin, trailing, onChangeProject, onChangeStartDate, onClearStartDate, onChangeDueDate, onChangeReminder, onChangePriority, onChangeEventTime, onChangeEventPlace, onChangeEventAddress, onMemberEdit, onAddProject, }: TaskCorePropertiesGridProps): import("react").JSX.Element;
87
+ export declare function TaskCorePropertiesGrid({ values, form, customTabs, avatarSrcByName, managerLocked, notice, event, hideDueDate, hideReminder, beforeStart, pinColumns, projectColumn, afterProject, readOnly, coreLocked, targetSummary, narrowCollapsedSx, reminderLocked, managerAction, hideProject, hideManager, hideReceivers, hideStartDate, hidePriority, leading, supportOrigin, trailing, onChangeProject, onChangeStartDate, onClearStartDate, onChangeDueDate, onChangeReminder, onChangePriority, onChangeEventTime, onChangeEventPlace, onChangeEventAddress, onMemberEdit, onAddProject, }: TaskCorePropertiesGridProps): import("react").JSX.Element;
@@ -0,0 +1,92 @@
1
+ /**
2
+ * 업무 상세 폼이다(0.10.30) — 상세에서 바로 고치는 칸(제목 · 상태 · 일시 · 중요도 · 라벨 · 비고 · 일정 · 오류 칸 등)의 값을
3
+ * 업무 객체 대신 forma 폼에 담아 칸마다 그 경로만 구독하게 한다.
4
+ * 왜: 예전에는 본문이 업무 객체 통째를 받아, 한 칸을 고치거나 다른 사람이 고친 값이 실시간으로 들어올 때마다 1600줄 본문이 전부 다시 그려졌다.
5
+ * 이제 그런 값은 폼의 그 경로만 바뀌어 그 칸만 다시 그린다(본문은 memo 비교에서 폼 칸을 뺀다 — TaskDetailBody).
6
+ *
7
+ * 바깥(업무 객체)에서 값이 바뀌면 폼을 따라 맞춘다. 다만 지금 고치는 칸은 건드리지 않는다:
8
+ * · 칸에 포커스가 있는 동안(입력 중)은 그 칸을 맞추지 않고 기준값도 옮기지 않는다 — 치던 글자가 남의 값으로 덮이지 않게.
9
+ * 포커스가 빠지면 그 칸만 다시 맞춘다(그 사이 들어온 남의 값이 그때 들어온다).
10
+ * · 내가 고쳐 폼 값이 기준값(마지막으로 맞춘 업무 값)과 달라진 칸은 업무 값이 그 값을 따라올 때까지 내 값을 둔다
11
+ * (www utils/entityRealtime 의 mergeRemoteFormValues 와 같은 규칙).
12
+ */
13
+ import { type ReactNode } from "react";
14
+ import { type UseGlobalFormReturn } from "@ehfuse/forma";
15
+ import type { TaskBoxItem, TaskBoxPriority, TaskBoxReminder } from "../types";
16
+ /** 상세 폼 값이다 — 키는 업무 칸 이름 그대로다(저장 콜백 · 실시간 비교가 같은 이름을 쓴다). */
17
+ export interface TaskDetailFormValues {
18
+ title: string;
19
+ status: string;
20
+ priority: TaskBoxPriority;
21
+ start_date: string;
22
+ due_date: string;
23
+ reminders: TaskBoxReminder[];
24
+ tab_key: string;
25
+ label_keys: string[];
26
+ note: string;
27
+ event_time: string;
28
+ event_place: string;
29
+ event_address: string;
30
+ story_points: number;
31
+ sprint_seq: number;
32
+ bug_repro: string;
33
+ bug_device: string;
34
+ bug_where: string;
35
+ bug_version: string;
36
+ resolution: string;
37
+ /** 기여도(0.10.31) — 계정 seq → % 글. 줄마다 "contributions.<seq>" 경로만 구독해 한 사람의 몫을 고치면 그 줄만 다시 그린다. */
38
+ contributions: Record<string, string>;
39
+ }
40
+ /** 상세 폼이 맡는 업무 칸 — 본문 memo 비교는 이 칸들을 보지 않는다(옛 사전알림 칸 reminder 는 reminders 로 읽힌다). */
41
+ export declare const TASK_DETAIL_FORM_FIELDS: readonly ["title", "status", "priority", "start_date", "due_date", "reminders", "tab_key", "label_keys", "note", "event_time", "event_place", "event_address", "story_points", "sprint_seq", "bug_repro", "bug_device", "bug_where", "bug_version", "resolution", "contributions"];
42
+ /** 상세 폼 인스턴스 타입이다. */
43
+ export type TaskDetailForm = UseGlobalFormReturn<TaskDetailFormValues>;
44
+ /** 업무에서 상세 폼 값을 뽑는다(빈 값은 칸마다 같은 꼴로 — 비교가 undefined/"" 차이로 흔들리지 않게). */
45
+ export declare function taskToDetailFormValues(task: TaskBoxItem): TaskDetailFormValues;
46
+ /** 값 비교 — 배열(라벨 · 사전알림)은 내용으로, 평평한 객체(기여도 seq → %)는 키 · 값으로 본다. */
47
+ export declare function sameDetailValue(a: unknown, b: unknown): boolean;
48
+ /** 상세 폼 묶음 — 본문의 칸들이 컨텍스트로 받는다(모두 인스턴스 동안 같은 참조다). */
49
+ export interface TaskDetailFormHandle {
50
+ form: TaskDetailForm;
51
+ /** 지금 업무(마지막으로 받은 것) — 본문이 memo 로 건너뛰어도 이벤트 처리는 최신 업무를 본다. */
52
+ getTask: () => TaskBoxItem;
53
+ /** 칸에 포커스가 들어왔다 — 그 칸은 바깥 값으로 맞추지 않는다. */
54
+ focusField: (name: string) => void;
55
+ /** 칸에서 포커스가 빠졌다 — 그 칸만 다시 맞춘다. */
56
+ blurField: (name: string) => void;
57
+ }
58
+ /**
59
+ * 상세 폼을 만들고 업무가 바뀔 때마다 맞춘다.
60
+ * 상세는 겹쳐 열리므로(연결 업무를 위에 띄움) 인스턴스마다 formId 를 따로 둔다 — 고정 id 면 위아래 상세가 한 폼을 나눠 쓴다.
61
+ */
62
+ export declare function useTaskDetailForm(task: TaskBoxItem): TaskDetailFormHandle;
63
+ /** 상세 폼 컨텍스트 — 상세 본문 안에서만 있다(등록 드로어 · 단독 그리드에는 없다). */
64
+ export declare const TaskDetailFormContext: import("react").Context<TaskDetailFormHandle | null>;
65
+ /** 상세 폼 묶음을 읽는다(상세 밖이면 null). */
66
+ export declare function useTaskDetailFormHandle(): TaskDetailFormHandle | null;
67
+ /** 폼의 한 칸만 구독해 그린다 — 다른 칸이 바뀌어도 이 조각은 다시 그리지 않는다. */
68
+ export declare function DetailFieldValue<K extends keyof TaskDetailFormValues>({ form, name, children, }: {
69
+ form: TaskDetailForm;
70
+ name: K;
71
+ children: (value: TaskDetailFormValues[K]) => ReactNode;
72
+ }): import("react").JSX.Element;
73
+ /**
74
+ * 입력 칸을 감싸 포커스를 상세 폼에 알린다 — 입력 중인 칸은 실시간 값으로 덮지 않는다.
75
+ * 상자를 만들지 않는다(display: contents) — 줄 배치 · 칸 폭은 예전 그대로다. 상세 밖이면 그냥 그린다.
76
+ */
77
+ export declare function DetailFieldScope({ name, children }: {
78
+ name: string;
79
+ children: ReactNode;
80
+ }): import("react").JSX.Element;
81
+ /**
82
+ * 렌더마다 새로 만들어지는 값(소비처가 끼우는 ReactNode · 업무 풀)을 본문 memo 밖으로 빼는 작은 저장소다.
83
+ * 본문은 그 자리에 구독 조각만 두고, 값이 바뀌면 그 조각만 다시 그린다.
84
+ */
85
+ export interface DetailSlotStore<T> {
86
+ get: () => T;
87
+ subscribe: (listener: () => void) => () => void;
88
+ }
89
+ /** 값을 저장소에 담는다 — 그리는 동안 값을 바꿔 두고(같은 렌더의 자식이 새 값을 읽게), 바뀌었으면 그린 뒤 구독자에게 알린다. */
90
+ export declare function useDetailSlotStore<T>(value: T): DetailSlotStore<T>;
91
+ /** 저장소 값을 구독한다. */
92
+ export declare function useDetailSlot<T>(store: DetailSlotStore<T>): T;
@@ -81,6 +81,11 @@ export type TaskBoxReminder = "none" | "min30_before" | "hour1_before" | "hour2_
81
81
  /** 업무함 목록 한 건이다. */
82
82
  /** 공개 범위다 — involved=비공개(관여자만)/group=부서공개/all=전체공개. */
83
83
  export type TaskBoxVisibility = "involved" | "group" | "all";
84
+ /** 업무 기여도 한 줄(0.10.31) — 관여자 계정과 그 몫(0~100 정수 %). */
85
+ export interface TaskBoxContribution {
86
+ account_seq: number;
87
+ percent: number;
88
+ }
84
89
  /** 반복 주기다(업무·일정 — 빈 값=반복 없음). */
85
90
  export type TaskBoxRepeatRule = "daily" | "weekly" | "monthly" | "yearly";
86
91
  export interface TaskBoxItem {
@@ -145,6 +150,7 @@ export interface TaskBoxItem {
145
150
  icon_color?: string;
146
151
  estimated_time?: string;
147
152
  checklist?: TaskBoxChecklistItem[];
153
+ contributions?: TaskBoxContribution[];
148
154
  attachments?: TaskBoxAttachment[];
149
155
  comments?: TaskBoxComment[];
150
156
  comment_count?: number;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 업무 기여도(0.10.31) — 관여자(책임자 + 참조자)마다 몫(%)을 적고 합은 100 이다.
3
+ * 소비처가 조직 설정으로 켠 업무에만 상세 드로어의 "기여도" 섹션이 선다(TaskDetailBody 의 contributionEnabled).
4
+ *
5
+ * 아직 나누지 않은 업무(빈 목록)는 기본값으로 보인다 — 책임자 100%, 책임자가 없으면 참조자끼리 똑같이.
6
+ * 저장한 뒤 관여자가 바뀌면 남은 사람의 값은 두고 새 사람은 0 이다(합이 어긋나면 섹션이 빨갛게 알린다).
7
+ * 서버 집계(월별 기여도)도 같은 기본값 규칙을 쓴다(taskham as/app/routes/taskbox/services/contribution.ts).
8
+ */
9
+ import type { TaskBoxContribution, TaskBoxItem } from "../types";
10
+ /** 기여도를 나누는 사람 한 명. */
11
+ export interface TaskContributionParticipant {
12
+ account_seq: number;
13
+ name: string;
14
+ role: "manager" | "receiver";
15
+ }
16
+ /** 기여도 대상 — 책임자가 앞, 그다음 참조자(계정이 이어진 사람만 — 샘플 · 외부 이름만 있는 칸은 뺀다). */
17
+ export declare function getContributionParticipants(task: TaskBoxItem): TaskContributionParticipant[];
18
+ /** 100 을 n 명에게 똑같이 — 나머지는 앞사람부터 1 씩(3명이면 34 · 33 · 33). */
19
+ export declare function splitContributionEvenly(count: number): number[];
20
+ /**
21
+ * 지금 보일 몫 — 저장한 값이 있으면 그것(목록에 없는 새 관여자는 0), 없으면 기본값.
22
+ * 키는 계정 seq 문자열이고 값은 % 글이다(상세 폼이 칸마다 점 경로로 구독한다 — "contributions.12").
23
+ */
24
+ export declare function resolveContributionValues(task: TaskBoxItem): Record<string, string>;
25
+ /** 몫 글 하나를 0~100 정수로 읽는다(틀리면 null). */
26
+ export declare function parseContributionPercent(raw: string): number | null;
27
+ /** 합계(틀린 글은 0 으로 센다). */
28
+ export declare function sumContributionValues(values: Record<string, string>, participants: TaskContributionParticipant[]): number;
29
+ /** 저장할 꼴로 바꾼다(관여자 차례). */
30
+ export declare function toContributionList(values: Record<string, string>, participants: TaskContributionParticipant[]): TaskBoxContribution[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/taskbox",
3
- "version": "0.10.29",
3
+ "version": "0.10.31",
4
4
  "description": "A React/MUI task inbox component with notices, per-user assignments, read tracking, and mobile card UI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",