rowvia 0.2.4 → 0.3.1
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 +24 -8
- package/dist/fields.css +1 -0
- package/dist/fields.es.js +1913 -0
- package/dist/fields.umd.cjs +1 -0
- package/dist/rowvia.css +1 -1
- package/dist/rowvia.es.js +12167 -11319
- package/dist/rowvia.umd.cjs +93 -104
- package/dist/types/api.d.ts +1 -1
- package/dist/types/components/cells.d.ts +25 -0
- package/dist/types/components/detailDialog.d.ts +7 -1
- package/dist/types/components/scrollbars.d.ts +10 -0
- package/dist/types/contracts/work-item.d.ts +339 -0
- package/dist/types/core/clientSideRowModel.d.ts +1 -2
- package/dist/types/core/columnModel.d.ts +2 -2
- package/dist/types/core/gridHost.d.ts +365 -0
- package/dist/types/core/remoteRowModels.d.ts +2 -10
- package/dist/types/core/rowNode.d.ts +1 -2
- package/dist/types/core/valueService.d.ts +1 -1
- package/dist/types/createGrid.d.ts +10 -0
- package/dist/types/features/chartService.d.ts +2 -11
- package/dist/types/features/columnMenu.d.ts +1 -1
- package/dist/types/features/contextMenu.d.ts +2 -13
- package/dist/types/features/editService.d.ts +3 -8
- package/dist/types/features/exportService.d.ts +3 -2
- package/dist/types/features/filterGui.d.ts +1 -1
- package/dist/types/features/filterService.d.ts +2 -14
- package/dist/types/features/findService.d.ts +1 -1
- package/dist/types/features/formulaEditor.d.ts +1 -1
- package/dist/types/features/notesService.d.ts +1 -5
- package/dist/types/features/overlays.d.ts +1 -1
- package/dist/types/features/paginationService.d.ts +1 -2
- package/dist/types/features/popupService.d.ts +1 -1
- package/dist/types/features/rangeSelection.d.ts +1 -8
- package/dist/types/features/rowDragService.d.ts +1 -1
- package/dist/types/features/rowGroupPanel.d.ts +1 -1
- package/dist/types/features/selectionService.d.ts +1 -1
- package/dist/types/features/sideBar.d.ts +2 -5
- package/dist/types/features/sortService.d.ts +1 -1
- package/dist/types/features/statusBar.d.ts +2 -3
- package/dist/types/features/undoRedoService.d.ts +2 -9
- package/dist/types/fields/attachment-control.d.ts +2 -0
- package/dist/types/fields/base-field.d.ts +62 -0
- package/dist/types/{pages/work-items → fields}/cascade-control.d.ts +1 -1
- package/dist/types/{pages/work-items → fields}/choice-control.d.ts +2 -3
- package/dist/types/fields/composite-control.d.ts +3 -0
- package/dist/types/fields/controls.d.ts +19 -0
- package/dist/types/{pages/work-items → fields}/date-control.d.ts +1 -1
- package/dist/types/fields/field-types.d.ts +114 -0
- package/dist/types/fields/index.d.ts +8 -0
- package/dist/types/fields/internal/dom.d.ts +1 -0
- package/dist/types/fields/internal/focus-boundary.d.ts +7 -0
- package/dist/types/fields/internal/interaction.d.ts +23 -0
- package/dist/types/fields/internal/lifecycle.d.ts +12 -0
- package/dist/types/fields/internal/textarea.d.ts +1 -0
- package/dist/types/fields/location-control.d.ts +3 -0
- package/dist/types/fields/popup.d.ts +38 -0
- package/dist/types/{pages/work-items → fields}/rich-control.d.ts +1 -1
- package/dist/types/fields/text-control.d.ts +3 -0
- package/dist/types/fields/types.d.ts +185 -0
- package/dist/types/fields/value-control.d.ts +12 -0
- package/dist/types/fields/vote-control.d.ts +2 -0
- package/dist/types/forms/form-conditions.d.ts +29 -0
- package/dist/types/forms/form-surface.d.ts +13 -0
- package/dist/types/gantt/component.d.ts +5 -4
- package/dist/types/gantt/ganttChart.d.ts +7 -7
- package/dist/types/gantt/index.d.ts +3 -3
- package/dist/types/gantt/scale.d.ts +18 -0
- package/dist/types/grid.d.ts +21 -17
- package/dist/types/index.d.ts +21 -20
- package/dist/types/node-flow/canvas.d.ts +26 -0
- package/dist/types/node-flow/card.d.ts +23 -0
- package/dist/types/node-flow/cardSections.d.ts +14 -0
- package/dist/types/node-flow/component.d.ts +9 -0
- package/dist/types/node-flow/contextBar.d.ts +20 -0
- package/dist/types/node-flow/demo.d.ts +6 -0
- package/dist/types/node-flow/index.d.ts +13 -0
- package/dist/types/node-flow/model.d.ts +48 -0
- package/dist/types/node-flow/timeline.d.ts +16 -0
- package/dist/types/node-flow/types.d.ts +220 -0
- package/dist/types/personnel/component.d.ts +3 -2
- package/dist/types/personnel/index.d.ts +1 -1
- package/dist/types/personnel/render.d.ts +22 -0
- package/dist/types/render/headerView.d.ts +1 -1
- package/dist/types/render/rowComponent.d.ts +29 -0
- package/dist/types/render/rowContext.d.ts +39 -0
- package/dist/types/render/rowRenderer.d.ts +6 -73
- package/dist/types/shared/dom.d.ts +1 -0
- package/dist/types/shared/interaction.d.ts +1 -0
- package/dist/types/shared/lifecycle.d.ts +1 -0
- package/dist/types/shared/markup.d.ts +5 -0
- package/dist/types/shared/state.d.ts +5 -0
- package/dist/types/types.d.ts +3 -2
- package/dist/types/work-items/action-surface.d.ts +17 -0
- package/dist/types/work-items/detail/detail-comments.d.ts +44 -0
- package/dist/types/work-items/detail/detail-header.d.ts +23 -0
- package/dist/types/work-items/detail/detail-history.d.ts +38 -0
- package/dist/types/work-items/detail/history-model.d.ts +48 -0
- package/dist/types/work-items/fields/control-base.d.ts +17 -0
- package/dist/types/{pages/work-items → work-items/fields}/focus-editor.d.ts +1 -1
- package/dist/types/work-items/fields/registry.d.ts +5 -0
- package/dist/types/work-items/index.d.ts +27 -0
- package/dist/types/work-items/layers.d.ts +19 -0
- package/dist/types/work-items/model.d.ts +10 -0
- package/dist/types/work-items/selection-bar.d.ts +7 -0
- package/dist/types/work-items/style-scope.d.ts +1 -0
- package/dist/types/work-items/table/column-panels.d.ts +39 -0
- package/dist/types/work-items/table/columns.d.ts +28 -0
- package/dist/types/work-items/table/headers.d.ts +10 -0
- package/dist/types/work-items/table/table.d.ts +10 -0
- package/dist/types/work-items/tabs.d.ts +14 -0
- package/dist/types/work-items/toolbar.d.ts +11 -0
- package/dist/types/work-items/views/rule-panels.d.ts +28 -0
- package/dist/types/work-items/workflow-detail-model.d.ts +51 -0
- package/dist/types/work-items/workflow-detail-types.d.ts +95 -0
- package/dist/types/work-items/workflow-detail.d.ts +3 -0
- package/package.json +24 -6
- package/dist/types/pages/finance/component.d.ts +0 -2
- package/dist/types/pages/finance/data.d.ts +0 -14
- package/dist/types/pages/hr/component.d.ts +0 -2
- package/dist/types/pages/hr/data.d.ts +0 -21
- package/dist/types/pages/index.d.ts +0 -13
- package/dist/types/pages/inventory/component.d.ts +0 -2
- package/dist/types/pages/inventory/data.d.ts +0 -26
- package/dist/types/pages/lifecycle.d.ts +0 -24
- package/dist/types/pages/performance/component.d.ts +0 -2
- package/dist/types/pages/performance/data.d.ts +0 -33
- package/dist/types/pages/server-side/component.d.ts +0 -2
- package/dist/types/pages/work-items/config.d.ts +0 -118
- package/dist/types/pages/work-items/controls.d.ts +0 -50
- package/dist/types/pages/work-items/field-controls.d.ts +0 -4
- package/dist/types/pages/work-items/model.d.ts +0 -72
- package/dist/types/pages/work-items/page.d.ts +0 -24
package/dist/types/api.d.ts
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface TagCellOptions {
|
|
2
|
+
label: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
markerClassName?: string;
|
|
5
|
+
marker?: Node;
|
|
6
|
+
}
|
|
7
|
+
/** Plain text labels are always escaped by the DOM, including remote values. */
|
|
8
|
+
export declare function createTagCell(options: TagCellOptions): HTMLElement;
|
|
9
|
+
export interface MediaCellOptions {
|
|
10
|
+
title: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
image?: {
|
|
13
|
+
src: string;
|
|
14
|
+
alt: string;
|
|
15
|
+
};
|
|
16
|
+
leading?: HTMLElement;
|
|
17
|
+
className?: string;
|
|
18
|
+
contentClassName?: string;
|
|
19
|
+
titleClassName?: string;
|
|
20
|
+
descriptionClassName?: string;
|
|
21
|
+
titleTag?: 'span' | 'div' | 'b';
|
|
22
|
+
descriptionTag?: 'span' | 'div';
|
|
23
|
+
inline?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function createMediaCell(options: MediaCellOptions): HTMLElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type InteractionOptions } from '../shared/interaction';
|
|
1
2
|
export interface DetailDialogContent {
|
|
2
3
|
title: string;
|
|
3
4
|
fields: Array<{
|
|
@@ -5,8 +6,13 @@ export interface DetailDialogContent {
|
|
|
5
6
|
value: string;
|
|
6
7
|
}>;
|
|
7
8
|
}
|
|
9
|
+
export interface DetailDialogOptions extends InteractionOptions {
|
|
10
|
+
onOpen?: (content: DetailDialogContent) => void;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
}
|
|
8
13
|
/** Text-only detail dialog owned by its mount, with no global IDs or selectors. */
|
|
9
|
-
export declare function createDetailDialog(container: HTMLElement): {
|
|
14
|
+
export declare function createDetailDialog(container: HTMLElement, options?: DetailDialogOptions): {
|
|
15
|
+
onInteraction: (listener: (event: import("..").ComponentInteraction) => void) => import("../shared/lifecycle").Dispose;
|
|
10
16
|
open(content: DetailDialogContent): void;
|
|
11
17
|
close: () => void;
|
|
12
18
|
destroy(): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ScrollbarOptions {
|
|
2
|
+
viewport: HTMLElement;
|
|
3
|
+
wrapper: HTMLElement;
|
|
4
|
+
onHorizontalScroll: (left: number) => void;
|
|
5
|
+
}
|
|
6
|
+
/** External scrollbars mirror a viewport without owning its data or rendering. */
|
|
7
|
+
export declare function createScrollbars(options: ScrollbarOptions): {
|
|
8
|
+
sync: () => void;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import type { InteractionOptions, InteractionSource } from '../shared/interaction';
|
|
2
|
+
import type { ColDef } from '../types';
|
|
3
|
+
import type { FormCondition, FormScope, FormSurfaceContext } from '../forms/form-conditions';
|
|
4
|
+
import type { FieldConfig as CoreFieldConfig } from '../fields/types';
|
|
5
|
+
export type { FieldOption, AttachmentValue, VoteValue, FieldKind } from '../fields/types';
|
|
6
|
+
import type { FieldOption, AttachmentValue, VoteValue } from '../fields/types';
|
|
7
|
+
export interface FieldConfig extends CoreFieldConfig {
|
|
8
|
+
width?: number;
|
|
9
|
+
minWidth?: number;
|
|
10
|
+
pinned?: 'left' | 'right' | null;
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
column?: Partial<ColDef>;
|
|
13
|
+
}
|
|
14
|
+
export interface FieldServices {
|
|
15
|
+
searchOptions?: (field: FieldConfig, query: string, signal: AbortSignal) => Promise<FieldOption[]>;
|
|
16
|
+
upload?: (field: FieldConfig, files: File[], signal: AbortSignal) => Promise<AttachmentValue[]>;
|
|
17
|
+
vote?: (field: FieldConfig, item: WorkItem, selected: string[], signal: AbortSignal) => Promise<VoteValue>;
|
|
18
|
+
}
|
|
19
|
+
export interface FormFieldConfig {
|
|
20
|
+
field: string;
|
|
21
|
+
label?: string;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
editable?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface FormConfig {
|
|
26
|
+
fields: FormFieldConfig[];
|
|
27
|
+
showRoles?: boolean;
|
|
28
|
+
showMeetings?: boolean;
|
|
29
|
+
showApproval?: boolean;
|
|
30
|
+
showVotes?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Detail-page tab configuration (full replacement of the four system tabs).
|
|
33
|
+
* Entries follow FormTabConfig: kind 'form' tabs carry their own items/blocks,
|
|
34
|
+
* system tabs are marked `system`, visibility uses visibleWhen + visibleScope.
|
|
35
|
+
* See docs/form-surface.md §4.
|
|
36
|
+
*/
|
|
37
|
+
tabs?: FormTabConfig[];
|
|
38
|
+
}
|
|
39
|
+
export type ControlSurface = 'cell' | 'detail' | 'create';
|
|
40
|
+
export type ControlPage = 'table' | 'basic';
|
|
41
|
+
export type ControlMode = 'default' | 'expanded' | 'editing';
|
|
42
|
+
export interface ControlContext extends InteractionOptions {
|
|
43
|
+
field: FieldConfig;
|
|
44
|
+
value: unknown;
|
|
45
|
+
item: WorkItem;
|
|
46
|
+
surface: ControlSurface;
|
|
47
|
+
readonly: boolean;
|
|
48
|
+
/** Explicit page layout. When omitted it is inferred from surface. */
|
|
49
|
+
page?: ControlPage;
|
|
50
|
+
/** Explicit visual state used by hosts and custom controls. */
|
|
51
|
+
mode?: ControlMode;
|
|
52
|
+
/** Permission gate for the expanded and editing states. */
|
|
53
|
+
canEdit?: boolean;
|
|
54
|
+
openDetail: (id: string) => void;
|
|
55
|
+
services?: FieldServices;
|
|
56
|
+
/** Host retains labels for remote selections; values still contain stable IDs only. */
|
|
57
|
+
onSelectedOptions?: (options: FieldOption[]) => void;
|
|
58
|
+
/** Transient hosts can dismiss their popup when the editor withdraws. */
|
|
59
|
+
onDeactivate?: () => void;
|
|
60
|
+
/** Optional host boundary, e.g. a popup containing its Save/Cancel buttons. */
|
|
61
|
+
focusBoundary?: HTMLElement;
|
|
62
|
+
}
|
|
63
|
+
export interface ControlEditor extends Partial<InteractionSource> {
|
|
64
|
+
element: HTMLElement;
|
|
65
|
+
/** Interactive surface hosted outside element, e.g. a top-layer popup.
|
|
66
|
+
* Hosts looking for the editor's inputs must search here too. */
|
|
67
|
+
content?: HTMLElement;
|
|
68
|
+
read: () => unknown;
|
|
69
|
+
validate?: () => string | undefined;
|
|
70
|
+
focus?: () => void;
|
|
71
|
+
destroy?: () => void;
|
|
72
|
+
/** Close internal menus/fullscreen without discarding the draft. */
|
|
73
|
+
deactivate?: () => void;
|
|
74
|
+
}
|
|
75
|
+
export interface FieldControl {
|
|
76
|
+
id: string;
|
|
77
|
+
label: string;
|
|
78
|
+
description: string;
|
|
79
|
+
glyph: string;
|
|
80
|
+
action?: 'edit' | 'select' | 'view';
|
|
81
|
+
group?: '文本' | '选择' | '人员' | '日期' | '投票' | '其他' | '关联工作项' | '系统';
|
|
82
|
+
readonly?: boolean;
|
|
83
|
+
example?: {
|
|
84
|
+
value: unknown;
|
|
85
|
+
field?: Partial<FieldConfig>;
|
|
86
|
+
};
|
|
87
|
+
render: (context: ControlContext) => HTMLElement;
|
|
88
|
+
createEditor: (context: ControlContext) => ControlEditor;
|
|
89
|
+
}
|
|
90
|
+
export interface WorkItem {
|
|
91
|
+
[field: string]: any;
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
description: string;
|
|
95
|
+
vote: string;
|
|
96
|
+
showVotes: string;
|
|
97
|
+
status: string;
|
|
98
|
+
selectedTopic: string;
|
|
99
|
+
format: string | string[];
|
|
100
|
+
approved: string;
|
|
101
|
+
category: string;
|
|
102
|
+
owner: string;
|
|
103
|
+
space: string;
|
|
104
|
+
created: string;
|
|
105
|
+
creator: string;
|
|
106
|
+
source: string;
|
|
107
|
+
followed: boolean;
|
|
108
|
+
starred: boolean;
|
|
109
|
+
viewed: boolean;
|
|
110
|
+
comments: Array<string | {
|
|
111
|
+
id: string;
|
|
112
|
+
author: string;
|
|
113
|
+
content: string;
|
|
114
|
+
html?: string;
|
|
115
|
+
createdAt: string;
|
|
116
|
+
}>;
|
|
117
|
+
history: Array<string | {
|
|
118
|
+
id?: string;
|
|
119
|
+
actor: string;
|
|
120
|
+
actorId?: string;
|
|
121
|
+
actorKind?: 'user' | 'computed' | 'automation' | 'system';
|
|
122
|
+
module: string;
|
|
123
|
+
moduleKey?: string;
|
|
124
|
+
detail: string;
|
|
125
|
+
createdAt: string;
|
|
126
|
+
}>;
|
|
127
|
+
nodeFlow?: import('../node-flow/types').FlowDefinition;
|
|
128
|
+
}
|
|
129
|
+
export type Field = string;
|
|
130
|
+
export interface Rule {
|
|
131
|
+
field: Field;
|
|
132
|
+
operator: "contains" | "equals" | "notEqual" | "blank" | "notBlank";
|
|
133
|
+
value: string;
|
|
134
|
+
}
|
|
135
|
+
export interface ColorRule extends Rule {
|
|
136
|
+
color: string;
|
|
137
|
+
scope?: string;
|
|
138
|
+
}
|
|
139
|
+
export interface ViewState {
|
|
140
|
+
filters: Rule[];
|
|
141
|
+
sorts: {
|
|
142
|
+
colId: string;
|
|
143
|
+
sort: "asc" | "desc";
|
|
144
|
+
}[];
|
|
145
|
+
groups: string[];
|
|
146
|
+
colors: ColorRule[];
|
|
147
|
+
showTerminated: boolean;
|
|
148
|
+
}
|
|
149
|
+
export interface SavedView {
|
|
150
|
+
name: string;
|
|
151
|
+
state: ViewState;
|
|
152
|
+
columns?: unknown;
|
|
153
|
+
gridState?: unknown;
|
|
154
|
+
tab?: string;
|
|
155
|
+
search?: string;
|
|
156
|
+
filterSearch?: boolean;
|
|
157
|
+
collaborators?: string;
|
|
158
|
+
visibility?: string;
|
|
159
|
+
inNavigation?: boolean;
|
|
160
|
+
}
|
|
161
|
+
export interface FormFieldPermission {
|
|
162
|
+
/** 范围外不渲染。 */
|
|
163
|
+
view?: FormScope;
|
|
164
|
+
/** 范围外只读展示态。 */
|
|
165
|
+
edit?: FormScope;
|
|
166
|
+
/** 必填作用范围(按成员/团队/角色)。 */
|
|
167
|
+
required?: FormScope;
|
|
168
|
+
}
|
|
169
|
+
export interface FormFieldDef extends FieldConfig {
|
|
170
|
+
/** 「新建页可见」开关:create 面不渲染未开启的字段。 */
|
|
171
|
+
createVisible?: boolean;
|
|
172
|
+
/** 字段默认状态覆盖(open 编辑态 / 展示态)。 */
|
|
173
|
+
defaultState?: 'display' | 'edit';
|
|
174
|
+
/** 「在某条件下必填」。 */
|
|
175
|
+
requiredWhen?: FormCondition;
|
|
176
|
+
/** 「默认全部可见 / 某条件下可见」。 */
|
|
177
|
+
visibleWhen?: FormCondition;
|
|
178
|
+
/** 是否展示默认值:不展示 / 统一展示 / 某条件下展示。 */
|
|
179
|
+
defaultMode?: 'none' | 'always' | 'conditional';
|
|
180
|
+
defaultWhen?: {
|
|
181
|
+
when: FormCondition;
|
|
182
|
+
value: unknown;
|
|
183
|
+
}[];
|
|
184
|
+
/** 附加说明。 */
|
|
185
|
+
description?: string;
|
|
186
|
+
permission?: FormFieldPermission;
|
|
187
|
+
}
|
|
188
|
+
export interface FormPlacement {
|
|
189
|
+
/** 指向 fields[].key;同一字段可放置多次。 */
|
|
190
|
+
field: string;
|
|
191
|
+
/** 两栏占比:1 = 单栏宽,2 = 通栏。 */
|
|
192
|
+
span?: 1 | 2;
|
|
193
|
+
/** 字段展示方式:侧面标签 / 顶部标签。 */
|
|
194
|
+
labelPosition?: 'side' | 'top';
|
|
195
|
+
visibleWhen?: FormCondition;
|
|
196
|
+
requiredWhen?: FormCondition;
|
|
197
|
+
}
|
|
198
|
+
export interface FormGroupConfig {
|
|
199
|
+
id: string;
|
|
200
|
+
label: string;
|
|
201
|
+
items: FormLayoutItem[];
|
|
202
|
+
columns?: 1 | 2;
|
|
203
|
+
columnRatio?: [number, number];
|
|
204
|
+
span?: 1 | 2;
|
|
205
|
+
visibleWhen?: FormCondition;
|
|
206
|
+
}
|
|
207
|
+
export type FormLayoutItem = FormPlacement | FormGroupConfig | FormBlockConfig;
|
|
208
|
+
export interface FormBlockConfig {
|
|
209
|
+
id: string;
|
|
210
|
+
span?: 1 | 2;
|
|
211
|
+
kind: 'roles' | 'meetings' | 'approval' | 'votes' | 'custom';
|
|
212
|
+
label?: string;
|
|
213
|
+
visibleWhen?: FormCondition;
|
|
214
|
+
/** 「角色是否必填」:这些角色必须选择人员才能创建。 */
|
|
215
|
+
requiredRoles?: string[];
|
|
216
|
+
/** 角色下拉候选;缺省只有「提报人」。 */
|
|
217
|
+
roleOptions?: string[];
|
|
218
|
+
/** 人员候选目录,人员框与人员控件共用同一选择器。 */
|
|
219
|
+
people?: FieldOption[];
|
|
220
|
+
render?: (ctx: FormRenderContext) => HTMLElement | string;
|
|
221
|
+
}
|
|
222
|
+
export interface FormActionConfig {
|
|
223
|
+
/** 按钮 data-action(宿主事件委托用)。 */
|
|
224
|
+
id: string;
|
|
225
|
+
label?: string;
|
|
226
|
+
kind?: 'button' | 'submit' | 'checkbox';
|
|
227
|
+
glyph?: string;
|
|
228
|
+
variant?: 'primary' | 'outline' | '';
|
|
229
|
+
checked?: boolean;
|
|
230
|
+
visibleWhen?: FormCondition;
|
|
231
|
+
}
|
|
232
|
+
export interface FormRenderContext {
|
|
233
|
+
data: Record<string, unknown>;
|
|
234
|
+
context: FormSurfaceContext;
|
|
235
|
+
variant: 'create' | 'detail';
|
|
236
|
+
tab?: FormTabConfig;
|
|
237
|
+
}
|
|
238
|
+
export type FormTabKind = 'form' | 'comments' | 'history' | 'nodes' | 'materials' | 'plugin' | 'custom';
|
|
239
|
+
export interface FormTabConfig {
|
|
240
|
+
id: string;
|
|
241
|
+
label: string;
|
|
242
|
+
kind: FormTabKind;
|
|
243
|
+
/** 系统预置标签页(基本信息 / 节点详情 / 评论·备注 / 操作记录)。 */
|
|
244
|
+
system?: boolean;
|
|
245
|
+
order?: number;
|
|
246
|
+
/** 可删除:只移除布局,不影响字段值。 */
|
|
247
|
+
removable?: boolean;
|
|
248
|
+
/** 「满足条件可见」,与字段级条件 AND。 */
|
|
249
|
+
visibleWhen?: FormCondition;
|
|
250
|
+
/** 可见成员范围:人员 / 团队 / 角色。 */
|
|
251
|
+
visibleScope?: FormScope;
|
|
252
|
+
/** kind='form' 的字段放置与分组。 */
|
|
253
|
+
items?: FormLayoutItem[];
|
|
254
|
+
blocks?: FormBlockConfig[];
|
|
255
|
+
/** kind='plugin' | 'custom' 的宿主渲染。 */
|
|
256
|
+
render?: (ctx: FormRenderContext) => HTMLElement | string;
|
|
257
|
+
}
|
|
258
|
+
export interface FormSurfaceEvents {
|
|
259
|
+
onDestroy?(): void;
|
|
260
|
+
onChange?(key: string, value: unknown, data: Record<string, unknown>): void;
|
|
261
|
+
/** 退回展示态时回调(详情页由此持久化)。 */
|
|
262
|
+
onCommit?(key: string, value: unknown, data: Record<string, unknown>): void;
|
|
263
|
+
onSubmit?(data: Record<string, unknown>): void;
|
|
264
|
+
onSaveDraft?(data: Record<string, unknown>): void;
|
|
265
|
+
/** 提交校验失败时回调(第一条错误文案;首个错误字段已回到编辑态)。 */
|
|
266
|
+
onInvalid?(message: string): void;
|
|
267
|
+
onTabChange?(id: string, tab: FormTabConfig): void;
|
|
268
|
+
onFieldStateChange?(key: string, state: 'display' | 'edit'): void;
|
|
269
|
+
onCancel?(): void;
|
|
270
|
+
onAction?(id: string, data: Record<string, unknown>): void;
|
|
271
|
+
onOpenDetail?(id: string): void;
|
|
272
|
+
}
|
|
273
|
+
export interface FormSurfaceConfig extends InteractionOptions {
|
|
274
|
+
variant: 'create' | 'detail';
|
|
275
|
+
presentation?: 'modal' | 'drawer' | 'fullscreen';
|
|
276
|
+
/** 组件默认是否处于 open 态(页面已展开)。 */
|
|
277
|
+
open?: boolean;
|
|
278
|
+
/** 字段默认状态:展示态,或直接进入 open(编辑)态。 */
|
|
279
|
+
fieldState?: 'display' | 'edit';
|
|
280
|
+
simpleMode?: boolean;
|
|
281
|
+
/** 简洁模式保留的字段 key,默认第一个字段。 */
|
|
282
|
+
simpleKeep?: string[];
|
|
283
|
+
title?: string;
|
|
284
|
+
layout?: {
|
|
285
|
+
labelPosition?: 'side' | 'top';
|
|
286
|
+
labelWidth?: number;
|
|
287
|
+
columns?: 1 | 2;
|
|
288
|
+
/** 新建页布局模式:灵活布局 / 与详情页同步(items 缺省时生效)。 */
|
|
289
|
+
mode?: 'flexible' | 'sync-detail';
|
|
290
|
+
};
|
|
291
|
+
fields: FormFieldDef[];
|
|
292
|
+
/** create 表单(或未启用 tabs 时)的字段放置;缺省按 fields 顺序。 */
|
|
293
|
+
items?: FormLayoutItem[];
|
|
294
|
+
blocks?: FormBlockConfig[];
|
|
295
|
+
/** 详情页标签页配置;缺省单个「基本信息」表单页。 */
|
|
296
|
+
tabs?: FormTabConfig[];
|
|
297
|
+
defaultTab?: string;
|
|
298
|
+
data?: Record<string, unknown>;
|
|
299
|
+
context?: FormSurfaceContext;
|
|
300
|
+
/** 操作区;缺省按 variant 给出飞书默认按钮组。 */
|
|
301
|
+
actions?: FormActionConfig[];
|
|
302
|
+
events?: FormSurfaceEvents;
|
|
303
|
+
labels?: Record<string, string>;
|
|
304
|
+
/** 宿主装饰(标题栏附加内容、导航、页签右侧、底部评论框等)。 */
|
|
305
|
+
slots?: {
|
|
306
|
+
header?: HTMLElement | string;
|
|
307
|
+
/** 标题栏左侧(返回按钮等)。 */
|
|
308
|
+
leading?: HTMLElement | string;
|
|
309
|
+
/** 标题栏下方的子标题条(阶段、标签、信号等)。 */
|
|
310
|
+
subHeader?: HTMLElement | string;
|
|
311
|
+
navigation?: HTMLElement | string;
|
|
312
|
+
tabSuffix?: HTMLElement | string;
|
|
313
|
+
footer?: HTMLElement | string;
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
export interface FormSurfaceDeps {
|
|
317
|
+
controls?: ControlRegistry;
|
|
318
|
+
services?: FieldServices;
|
|
319
|
+
renderers?: Partial<Record<'comments' | 'history' | 'nodes' | 'materials' | 'plugin' | 'block', (ctx: FormRenderContext & {
|
|
320
|
+
block?: FormBlockConfig;
|
|
321
|
+
}) => HTMLElement | string>>;
|
|
322
|
+
}
|
|
323
|
+
export interface FormSurfaceInstance extends InteractionSource {
|
|
324
|
+
element: HTMLElement;
|
|
325
|
+
read(): Record<string, unknown>;
|
|
326
|
+
validate(): string | undefined;
|
|
327
|
+
setOpen(open: boolean): void;
|
|
328
|
+
setFieldState(state: 'display' | 'edit'): void;
|
|
329
|
+
setTab(id: string): void;
|
|
330
|
+
setSimpleMode(on: boolean): void;
|
|
331
|
+
activeTab(): string | undefined;
|
|
332
|
+
update(patch: Partial<Pick<FormSurfaceConfig, 'data' | 'fields' | 'tabs' | 'items' | 'blocks' | 'actions' | 'context'>>): void;
|
|
333
|
+
destroy(): void;
|
|
334
|
+
}
|
|
335
|
+
export interface ControlRegistry {
|
|
336
|
+
register(control: FieldControl): void;
|
|
337
|
+
list(): FieldControl[];
|
|
338
|
+
resolve(field: FieldConfig): FieldControl;
|
|
339
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Column, GridOptions, RowDataTransaction, RowNode, RowNodeTransactionResult } from '../types';
|
|
2
|
-
import { type RowNodeServices } from './rowNode';
|
|
3
2
|
import { EventService } from './eventService';
|
|
3
|
+
import { type RowNodeServices } from './rowNode';
|
|
4
4
|
export interface RowModel {
|
|
5
5
|
getType(): string;
|
|
6
6
|
/** optional: notify the model that the visible row window changed */
|
|
@@ -62,7 +62,6 @@ export declare class ClientSideRowModel implements RowModel {
|
|
|
62
62
|
private groupDefaultExpandedApplied;
|
|
63
63
|
private pinnedTopRows;
|
|
64
64
|
private pinnedBottomRows;
|
|
65
|
-
private displayStartIndex;
|
|
66
65
|
private totalRowCount;
|
|
67
66
|
constructor(params: {
|
|
68
67
|
options: GridOptions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColDef, Column, ColumnState,
|
|
1
|
+
import type { ColDef, Column, ColumnState, GridOptions, PinPosition } from '../types';
|
|
2
2
|
import { EventService } from './eventService';
|
|
3
3
|
export interface ColumnGroupInfo {
|
|
4
4
|
id: string;
|
|
@@ -75,7 +75,7 @@ export declare class ColumnModel {
|
|
|
75
75
|
removeRowGroupColumn(colKey: string | Column, source?: string): void;
|
|
76
76
|
setValueColumns(colIds: Array<string | Column>, source?: string): void;
|
|
77
77
|
addValueColumn(colKey: string | Column, aggFunc?: string, source?: string): void;
|
|
78
|
-
setPivotColumns(colIds: Array<string | Column>,
|
|
78
|
+
setPivotColumns(colIds: Array<string | Column>, _source?: string): void;
|
|
79
79
|
setColumnVisible(colKey: string | Column, visible: boolean, source?: string): void;
|
|
80
80
|
setColumnsVisible(keys: Array<string | Column>, visible: boolean, source?: string): void;
|
|
81
81
|
setColumnPinned(colKey: string | Column, pinned: PinPosition, source?: string): void;
|