rowvia 0.3.1 → 0.3.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/LICENSE +201 -0
- package/dist/fields.css +1 -1
- package/dist/fields.es.js +1086 -974
- package/dist/fields.umd.cjs +1 -1
- package/dist/rowvia.css +1 -1
- package/dist/rowvia.es.js +3638 -3483
- package/dist/rowvia.umd.cjs +50 -50
- package/dist/types/contracts/work-item.d.ts +2 -0
- package/dist/types/fields/field-types.d.ts +2 -0
- package/dist/types/fields/radio-control.d.ts +3 -0
- package/dist/types/fields/types.d.ts +3 -0
- package/dist/types/personnel/component.d.ts +14 -0
- package/dist/types/work-items/workflow-detail-types.d.ts +15 -8
- package/package.json +2 -2
|
@@ -15,6 +15,7 @@ export interface FieldServices {
|
|
|
15
15
|
searchOptions?: (field: FieldConfig, query: string, signal: AbortSignal) => Promise<FieldOption[]>;
|
|
16
16
|
upload?: (field: FieldConfig, files: File[], signal: AbortSignal) => Promise<AttachmentValue[]>;
|
|
17
17
|
vote?: (field: FieldConfig, item: WorkItem, selected: string[], signal: AbortSignal) => Promise<VoteValue>;
|
|
18
|
+
loadVote?: (field: FieldConfig, item: WorkItem, signal: AbortSignal) => Promise<VoteValue>;
|
|
18
19
|
}
|
|
19
20
|
export interface FormFieldConfig {
|
|
20
21
|
field: string;
|
|
@@ -196,6 +197,7 @@ export interface FormPlacement {
|
|
|
196
197
|
requiredWhen?: FormCondition;
|
|
197
198
|
}
|
|
198
199
|
export interface FormGroupConfig {
|
|
200
|
+
layoutRole?: 'column';
|
|
199
201
|
id: string;
|
|
200
202
|
label: string;
|
|
201
203
|
items: FormLayoutItem[];
|
|
@@ -37,6 +37,8 @@ export declare class MultiChoiceField extends ChoiceField {
|
|
|
37
37
|
}
|
|
38
38
|
export declare class RadioField extends ChoiceField {
|
|
39
39
|
protected variant: "radio";
|
|
40
|
+
protected renderDisplay(context: ControlContext): FieldView;
|
|
41
|
+
protected renderEditing(context: ControlContext): ControlEditor;
|
|
40
42
|
}
|
|
41
43
|
export declare class PersonField extends ChoiceField {
|
|
42
44
|
protected variant: "person";
|
|
@@ -23,6 +23,7 @@ export interface FieldServices {
|
|
|
23
23
|
searchOptions?: (field: FieldConfig, query: string, signal: AbortSignal) => Promise<FieldOption[]>;
|
|
24
24
|
upload?: (field: FieldConfig, files: File[], signal: AbortSignal) => Promise<AttachmentValue[]>;
|
|
25
25
|
vote?: (field: FieldConfig, selected: string[], signal: AbortSignal) => Promise<VoteValue>;
|
|
26
|
+
loadVote?: (field: FieldConfig, signal: AbortSignal) => Promise<VoteValue>;
|
|
26
27
|
}
|
|
27
28
|
export type FieldKind = (string & {}) | "richText" | "number" | "dateTime" | "detail" | "title" | "text" | "longText" | "multiSelect" | "select" | "status" | "person" | "date" | "vote" | "relation";
|
|
28
29
|
export interface FieldConfig {
|
|
@@ -35,6 +36,8 @@ export interface FieldConfig {
|
|
|
35
36
|
required?: boolean;
|
|
36
37
|
options?: string[];
|
|
37
38
|
choices?: FieldOption[];
|
|
39
|
+
/** Boolean radio uses true/false option IDs but preserves boolean/null values. */
|
|
40
|
+
radioValueType?: 'boolean';
|
|
38
41
|
placeholder?: string;
|
|
39
42
|
maxLength?: number;
|
|
40
43
|
numberOptions?: {
|
|
@@ -4,6 +4,15 @@ export interface PersonnelScheduleOptions extends InteractionOptions {
|
|
|
4
4
|
people: SchedulePerson[];
|
|
5
5
|
items: ScheduleItem[];
|
|
6
6
|
today?: string;
|
|
7
|
+
/** Inclusive date range; initialization does not emit onRangeChange. */
|
|
8
|
+
initialRange?: {
|
|
9
|
+
from: string;
|
|
10
|
+
to: string;
|
|
11
|
+
};
|
|
12
|
+
onRangeChange?: (range: {
|
|
13
|
+
from: string;
|
|
14
|
+
to: string;
|
|
15
|
+
}) => void;
|
|
7
16
|
title?: string;
|
|
8
17
|
workItemLabel?: string;
|
|
9
18
|
/** Use distinct keys to isolate saved views by application or workspace. */
|
|
@@ -16,6 +25,11 @@ export interface PersonnelScheduleApi extends InteractionSource {
|
|
|
16
25
|
getItems(): ScheduleItem[];
|
|
17
26
|
updateItem(id: string, changes: Partial<Omit<ScheduleItem, 'id'>>): void;
|
|
18
27
|
setPeople(ids: string[]): void;
|
|
28
|
+
/** Synchronize external query dates without notifying onRangeChange. */
|
|
29
|
+
setRange(range: {
|
|
30
|
+
from: string;
|
|
31
|
+
to: string;
|
|
32
|
+
}): void;
|
|
19
33
|
destroy(): void;
|
|
20
34
|
}
|
|
21
35
|
export declare function createPersonnelSchedule(container: HTMLElement, options: PersonnelScheduleOptions): PersonnelScheduleApi;
|
|
@@ -43,6 +43,16 @@ export interface WorkflowDetailCallbackContext {
|
|
|
43
43
|
flow: FlowDefinition;
|
|
44
44
|
signal: AbortSignal;
|
|
45
45
|
}
|
|
46
|
+
export interface WorkflowTaskColumn {
|
|
47
|
+
key: string;
|
|
48
|
+
label: string;
|
|
49
|
+
/** Optional summary heading in expanded mode; label remains the list/detail label. */
|
|
50
|
+
expandedLabel?: string;
|
|
51
|
+
/** In expanded mode render below the summary, using the same field renderer. */
|
|
52
|
+
expanded?: boolean;
|
|
53
|
+
hideWhenExpanded?: boolean;
|
|
54
|
+
width?: number;
|
|
55
|
+
}
|
|
46
56
|
export interface WorkflowDetailOptions {
|
|
47
57
|
flow: FlowDefinition;
|
|
48
58
|
selectedNodeId?: string;
|
|
@@ -59,15 +69,12 @@ export interface WorkflowDetailOptions {
|
|
|
59
69
|
onAction?: (nodeId: string, actionId: string, context: WorkflowDetailCallbackContext) => WorkflowDetailResult;
|
|
60
70
|
onDelete?: (nodeId: string, context: WorkflowDetailCallbackContext) => WorkflowDetailResult;
|
|
61
71
|
onFlowChange?: (detail: NonNullable<FlowDefinition['detail']>, context: WorkflowDetailCallbackContext) => WorkflowDetailResult;
|
|
72
|
+
renderTaskActions?: (host: HTMLElement, task: SubTask, context: WorkflowDetailRenderContext) => void | (() => void);
|
|
62
73
|
onCreateTask?: (nodeId: string, context: WorkflowDetailCallbackContext) => WorkflowDetailResult;
|
|
63
|
-
taskColumns?: (node: FlowNode) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
renderTaskField?: (host: HTMLElement, task: SubTask, column: {
|
|
68
|
-
key: string;
|
|
69
|
-
label: string;
|
|
70
|
-
}, context: WorkflowDetailRenderContext) => void | (() => void);
|
|
74
|
+
taskColumns?: (node: FlowNode) => WorkflowTaskColumn[];
|
|
75
|
+
taskColumnsMode?: 'append' | 'replace';
|
|
76
|
+
taskCanExpand?: (node: FlowNode) => boolean;
|
|
77
|
+
renderTaskField?: (host: HTMLElement, task: SubTask, column: WorkflowTaskColumn, context: WorkflowDetailRenderContext) => void | (() => void);
|
|
71
78
|
onCommand?: (command: WorkflowDetailCommand, context: {
|
|
72
79
|
flow: FlowDefinition;
|
|
73
80
|
signal: AbortSignal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rowvia",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "零运行时依赖的 TypeScript 数据表格、甘特图与人员排期组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"build:lib": "vite build --config vite.lib.config.ts && vite build --config vite.fields.config.ts && npm run build:types",
|
|
11
11
|
"preview": "vite preview",
|
|
12
12
|
"typecheck": "tsc --noEmit",
|
|
13
|
-
"test": "esbuild src/index.ts --bundle --format=esm --outfile=dist-test/rowvia.mjs --loader:.ts=ts --log-level=error && node test/smoke.mjs && node test/gantt.mjs && node test/personnel.mjs && node test/work-items.mjs && node test/fields.mjs && node test/field-controls.mjs && node test/form-surface.mjs && node test/node-flow.mjs && node test/workflow-detail.mjs && node test/detail-comments.mjs && node test/detail-history.mjs && node test/refactor.mjs",
|
|
13
|
+
"test": "esbuild src/index.ts --bundle --format=esm --outfile=dist-test/rowvia.mjs --loader:.ts=ts --log-level=error && node test/smoke.mjs && node test/gantt.mjs && node test/personnel.mjs && node test/work-items.mjs && node test/fields.mjs && node test/field-controls.mjs && node test/form-surface.mjs && node test/field-interactions.mjs && node test/node-flow.mjs && node test/workflow-detail.mjs && node test/detail-comments.mjs && node test/detail-history.mjs && node test/refactor.mjs",
|
|
14
14
|
"test:work-items": "node test/work-items.mjs",
|
|
15
15
|
"test:node-flow": "node test/node-flow.mjs",
|
|
16
16
|
"test:workflow-detail": "node test/workflow-detail.mjs",
|