@tongfun/ui 0.0.1-alpha.3 → 0.0.1-alpha.5

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.
@@ -0,0 +1,12 @@
1
+ import type { TongfunAgentSchema, TongfunAgentSchemaComponent } from './types'
2
+
3
+ export declare const tongfunAgentSchema: TongfunAgentSchema
4
+
5
+ export declare const documentFormShellAgentSchema: TongfunAgentSchemaComponent | undefined
6
+
7
+ export default tongfunAgentSchema
8
+
9
+ export type {
10
+ TongfunAgentSchema,
11
+ TongfunAgentSchemaComponent
12
+ } from './types'
@@ -0,0 +1,33 @@
1
+ import e from "../lowcode-agent/index.js";
2
+ function s(o) {
3
+ const t = o.lowcode;
4
+ return {
5
+ name: o.name,
6
+ importName: o.source.exportName,
7
+ title: o.title,
8
+ category: o.category,
9
+ group: o.group,
10
+ importPath: o.source.importPath,
11
+ props: t.props,
12
+ composition: t.composition ?? {
13
+ childMode: t.slots.length > 0 ? "slots" : "none",
14
+ slots: t.slots,
15
+ dynamicSlots: t.dynamicSlots ?? []
16
+ },
17
+ triggers: t.triggers ?? [],
18
+ actions: t.actions ?? [],
19
+ metadata: o.agent
20
+ };
21
+ }
22
+ const r = {
23
+ schemaVersion: e.schemaVersion,
24
+ library: e.library,
25
+ components: e.components.map(s)
26
+ }, n = r.components.find(
27
+ (o) => o.name === "TfDocumentFormShell"
28
+ );
29
+ export {
30
+ r as default,
31
+ n as documentFormShellAgentSchema,
32
+ r as tongfunAgentSchema
33
+ };
@@ -0,0 +1,27 @@
1
+ export interface TongfunAgentSchemaComponent {
2
+ name: string
3
+ importName: string
4
+ title: string
5
+ category: string
6
+ group: string
7
+ importPath: string
8
+ props: unknown[]
9
+ composition: {
10
+ childMode: 'none' | 'slots' | 'children'
11
+ slots: unknown[]
12
+ dynamicSlots: unknown[]
13
+ }
14
+ triggers: unknown[]
15
+ actions: unknown[]
16
+ metadata?: Record<string, unknown>
17
+ }
18
+
19
+ export interface TongfunAgentSchema {
20
+ schemaVersion: string
21
+ library: {
22
+ name: string
23
+ importPath: string
24
+ framework: string
25
+ }
26
+ components: TongfunAgentSchemaComponent[]
27
+ }
@@ -0,0 +1,17 @@
1
+ export * from './types'
2
+
3
+ import type {
4
+ FormulaDependencyInput,
5
+ FormulaDependencyResult,
6
+ FormulaEvaluationInput,
7
+ FormulaEvaluationResult,
8
+ FormulaTokenNormalizeInput,
9
+ FormulaTokenNormalizeResult,
10
+ FormulaValidationInput,
11
+ FormulaValidationResult
12
+ } from './types'
13
+
14
+ export declare function evaluateFormula(input: FormulaEvaluationInput): FormulaEvaluationResult
15
+ export declare function extractFormulaDependencies(input: FormulaDependencyInput): FormulaDependencyResult
16
+ export declare function normalizeFormulaTokens(input: FormulaTokenNormalizeInput): FormulaTokenNormalizeResult
17
+ export declare function validateFormula(input: FormulaValidationInput): FormulaValidationResult
@@ -0,0 +1,136 @@
1
+ export type FormulaMode = 'header' | 'row' | 'body-aggregate'
2
+ export type FormulaEmptyValueMode = 'zero' | 'skip' | 'clear'
3
+ export type FormulaFailureStrategy = 'continue' | 'stop'
4
+ export type FormulaAggregateFunction = 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'COUNT'
5
+
6
+ export type FormulaToken =
7
+ | {
8
+ type: 'field'
9
+ field: string
10
+ label: string
11
+ fieldType?: string
12
+ scope?: 'header' | 'row'
13
+ }
14
+ | { type: 'operator'; value: string }
15
+ | { type: 'function'; name: string; args: FormulaToken[][] }
16
+ | { type: 'constant'; value: string | number }
17
+
18
+ export interface FormulaCondition {
19
+ field?: string
20
+ operator?: string
21
+ value?: unknown
22
+ expression?: string
23
+ expressionTokens?: FormulaToken[]
24
+ }
25
+
26
+ export interface FormulaActionConfig {
27
+ formulaMode?: FormulaMode
28
+ resultField?: string
29
+ targetField?: string
30
+ targetFieldType?: string
31
+ dependencies?: string[]
32
+ expressionTokens?: FormulaToken[]
33
+ expression?: string
34
+ sourceBodyId?: string
35
+ sourceField?: string
36
+ aggregateFunction?: FormulaAggregateFunction
37
+ aggregate?: FormulaAggregateFunction
38
+ function?: FormulaAggregateFunction
39
+ emptyValueMode?: FormulaEmptyValueMode
40
+ precision?: number | null
41
+ failureStrategy?: FormulaFailureStrategy
42
+ condition?: FormulaCondition | string | Record<string, unknown>
43
+ when?: FormulaCondition | string | Record<string, unknown>
44
+ [key: string]: unknown
45
+ }
46
+
47
+ export interface FormulaAction {
48
+ id?: string
49
+ type: 'formula'
50
+ name?: string
51
+ enabled?: boolean
52
+ config: FormulaActionConfig
53
+ }
54
+
55
+ export interface FormulaFieldMetadata {
56
+ field: string
57
+ label?: string
58
+ fieldType?: string
59
+ scope?: 'header' | 'row'
60
+ }
61
+
62
+ export interface FormulaError {
63
+ code: string
64
+ message: string
65
+ path?: string
66
+ field?: string
67
+ tokenIndex?: number
68
+ }
69
+
70
+ export interface FormulaValidationInput {
71
+ action?: FormulaAction | FormulaActionConfig
72
+ config?: FormulaActionConfig
73
+ targetField?: string
74
+ targetFieldType?: string
75
+ fields?: FormulaFieldMetadata[]
76
+ fieldTypes?: Record<string, string | undefined>
77
+ sourceFieldType?: string
78
+ }
79
+
80
+ export interface FormulaValidationResult {
81
+ valid: boolean
82
+ errors: FormulaError[]
83
+ dependencies: string[]
84
+ expression?: string
85
+ expressionTokens?: FormulaToken[]
86
+ }
87
+
88
+ export interface FormulaExecutionContext {
89
+ values?: Record<string, unknown>
90
+ row?: Record<string, unknown>
91
+ rows?: Record<string, unknown>[]
92
+ fieldTypes?: Record<string, string | undefined>
93
+ targetField?: string
94
+ targetFieldType?: string
95
+ sourceFieldType?: string
96
+ sourceBodyId?: string
97
+ }
98
+
99
+ export interface FormulaEvaluationInput extends FormulaValidationInput {
100
+ context: FormulaExecutionContext
101
+ }
102
+
103
+ export interface FormulaEvaluationResult {
104
+ valid: boolean
105
+ value?: unknown
106
+ skipped?: boolean
107
+ errors: FormulaError[]
108
+ dependencies: string[]
109
+ expression?: string
110
+ expressionTokens?: FormulaToken[]
111
+ }
112
+
113
+ export interface FormulaTokenNormalizeInput {
114
+ tokens?: FormulaToken[] | unknown[]
115
+ expression?: string
116
+ }
117
+
118
+ export interface FormulaTokenNormalizeResult {
119
+ valid: boolean
120
+ expressionTokens: FormulaToken[]
121
+ expression: string
122
+ errors: FormulaError[]
123
+ }
124
+
125
+ export interface FormulaDependencyInput {
126
+ action?: FormulaAction | FormulaActionConfig
127
+ config?: FormulaActionConfig
128
+ expressionTokens?: FormulaToken[] | unknown[]
129
+ expression?: string
130
+ }
131
+
132
+ export interface FormulaDependencyResult {
133
+ valid: boolean
134
+ dependencies: string[]
135
+ errors: FormulaError[]
136
+ }
package/dist/index.d.ts CHANGED
@@ -2,6 +2,11 @@ import type { Component, Plugin } from 'vue'
2
2
 
3
3
  export declare const TfAffix: Component
4
4
  export declare const TfAiActionMenu: Component
5
+ export declare const TfAiAssistant: Component
6
+ export declare const TfAiChat: Component
7
+ export declare const TfAiFab: Component
8
+ export declare const TfAiFabButton: Component
9
+ export declare const TfAiInsight: Component
5
10
  export declare const TfAiOverlay: Component
6
11
  export declare const TfAlert: Component
7
12
  export declare const TfAnchor: Component
@@ -9,47 +14,63 @@ export declare const TfAppBar: Component
9
14
  export declare const TfBackTop: Component
10
15
  export declare const TfBadge: Component
11
16
  export declare const TfBarChart: Component
17
+ export declare const TfBaseUpload: Component
18
+ export declare const TfBasicData: Component
19
+ export declare const TfBasicDataLayout: Component
20
+ export declare const TfBasicDataModal: Component
12
21
  export declare const TfBreadcrumb: Component
22
+ export declare const TfBusinessSelect: Component
13
23
  export declare const TfButton: Component
14
24
  export declare const TfCard: Component
15
25
  export declare const TfCascader: Component
26
+ export declare const TfChangeTracking: Component
16
27
  export declare const TfChart: Component
28
+ export declare const TfCoSignFlow: Component
29
+ export declare const TfCoSigningFlow: Component
17
30
  export declare const TfCodeBlock: Component
31
+ export declare const TfColumnFilterPopover: Component
18
32
  export declare const TfContainer: Component
33
+ export declare const TfDataGrid: Component
19
34
  export declare const TfDataPicker: Component
20
35
  export declare const TfDatePicker: Component
21
36
  export declare const TfDateTimePicker: Component
37
+ export declare const TfDecimalInput: Component
22
38
  export declare const TfDetailLayout: Component
23
39
  export declare const TfDivider: Component
24
- export declare const TfDocumentActionHeader: Component
25
- export declare const TfDocumentAiToolbar: Component
26
- export declare const TfDocumentFormPage: Component
40
+ export declare const TfDocumentBodyTable: Component
41
+ export declare const TfDocumentFieldTemplateSettings: Component
42
+ export declare const TfDocumentFormShell: Component
43
+ export declare const TfDocumentGeneralList: Component
27
44
  export declare const TfDocumentSectionCard: Component
28
45
  export declare const TfDonutChart: Component
29
46
  export declare const TfDrawer: Component
30
47
  export declare const TfDynamicForm: Component
31
48
  export declare const TfEmpty: Component
32
- export declare const TfEnumSelect: Component
33
49
  export declare const TfError: Component
34
50
  export declare const TfFieldArray: Component
35
51
  export declare const TfForm: Component
36
52
  export declare const TfFormAiStatus: Component
37
53
  export declare const TfFormAiToolbar: Component
38
54
  export declare const TfFormArray: Component
55
+ export declare const TfFormBasicData: Component
56
+ export declare const TfFormBusinessSelect: Component
39
57
  export declare const TfFormCascader: Component
40
58
  export declare const TfFormCheckbox: Component
41
59
  export declare const TfFormDataPicker: Component
42
60
  export declare const TfFormDatePicker: Component
43
61
  export declare const TfFormDateTimePicker: Component
62
+ export declare const TfFormDecimalInput: Component
44
63
  export declare const TfFormDynamic: Component
45
64
  export declare const TfFormField: Component
46
65
  export declare const TfFormFileUpload: Component
47
66
  export declare const TfFormGroup: Component
67
+ export declare const TfFormIconPicker: Component
48
68
  export declare const TfFormImageUpload: Component
49
69
  export declare const TfFormInput: Component
50
70
  export declare const TfFormItem: Component
51
71
  export declare const TfFormLayout: Component
52
72
  export declare const TfFormLocationPicker: Component
73
+ export declare const TfFormNumberInput: Component
53
74
  export declare const TfFormRadio: Component
54
75
  export declare const TfFormRegionPicker: Component
55
76
  export declare const TfFormSection: Component
@@ -62,12 +83,16 @@ export declare const TfFormTextarea: Component
62
83
  export declare const TfFormTimePicker: Component
63
84
  export declare const TfFormUpload: Component
64
85
  export declare const TfGrid: Component
86
+ export declare const TfGroupNav: Component
65
87
  export declare const TfHero: Component
66
88
  export declare const TfIcon: Component
89
+ export declare const TfIconPicker: Component
67
90
  export declare const TfImagePreview: Component
68
91
  export declare const TfInline: Component
69
92
  export declare const TfInput: Component
93
+ export declare const TfInputSelect: Component
70
94
  export declare const TfLineChart: Component
95
+ export declare const TfListFilter: Component
71
96
  export declare const TfLoading: Component
72
97
  export declare const TfLocationPicker: Component
73
98
  export declare const TfMasterDetail: Component
@@ -76,17 +101,32 @@ export declare const TfMetric: Component
76
101
  export declare const TfMetricGrid: Component
77
102
  export declare const TfModal: Component
78
103
  export declare const TfNotification: Component
104
+ export declare const TfNotifyProvider: Component
105
+ export declare const TfNumberInput: Component
79
106
  export declare const TfPage: Component
80
107
  export declare const TfPageHeader: Component
108
+ export declare const TfPageableGrid: Component
81
109
  export declare const TfPagination: Component
110
+ export declare const TfParticipantList: Component
111
+ export declare const TfRedHeader: Component
112
+ export declare const TfRedHeaderConfig: Component
113
+ export declare const TfRichTextEditor: Component
114
+ export declare const TfScoreMetric: Component
115
+ export declare const TfSealSelector: Component
82
116
  export declare const TfSection: Component
117
+ export declare const TfSectionHeading: Component
83
118
  export declare const TfSelect: Component
84
119
  export declare const TfSideNav: Component
85
120
  export declare const TfSidebarLayout: Component
86
121
  export declare const TfSignature: Component
122
+ export declare const TfSignaturePad: Component
123
+ export declare const TfSignaturePosition: Component
124
+ export declare const TfSignatureVerify: Component
87
125
  export declare const TfSkeleton: Component
88
126
  export declare const TfSlider: Component
89
127
  export declare const TfSplit: Component
128
+ export declare const TfSplitterColumn: Component
129
+ export declare const TfSplitterRow: Component
90
130
  export declare const TfStack: Component
91
131
  export declare const TfStateContainer: Component
92
132
  export declare const TfStatusDot: Component
@@ -101,16 +141,138 @@ export declare const TfTabsContent: Component
101
141
  export declare const TfTabsList: Component
102
142
  export declare const TfTabsTrigger: Component
103
143
  export declare const TfTag: Component
144
+ export declare const TfTemplateEditor: Component
145
+ export declare const TfTemplateManager: Component
146
+ export declare const TfTemplatePreview: Component
104
147
  export declare const TfTextArea: Component
105
148
  export declare const TfTimePicker: Component
106
149
  export declare const TfTimeline: Component
107
150
  export declare const TfTimelineItem: Component
151
+ export declare const TfTitleBar: Component
108
152
  export declare const TfToolbar: Component
109
153
  export declare const TfTypography: Component
154
+ export declare const TfVersionDiff: Component
155
+ export declare const TfVersionList: Component
110
156
  export declare const TfWatermark: Component
111
157
 
112
158
  export declare const TfUI: Plugin
113
159
 
160
+ export type DocumentFormShellStatusValue =
161
+ | string
162
+ | number
163
+ | { id: string; name: string }
164
+ | null
165
+ | undefined
166
+
167
+ export interface DocumentFormFieldAccess {
168
+ status?: {
169
+ readonly value: DocumentFormShellStatusValue | undefined
170
+ }
171
+ resolve: (statusDisabled?: Record<string, boolean>) => {
172
+ disabled: boolean
173
+ readonly: boolean
174
+ }
175
+ }
176
+
177
+ export type SidebarLayoutPosition = 'left' | 'right'
178
+
179
+ export type SidebarLayoutSurface = 'plain' | 'card'
180
+ export type SidebarLayoutSurfaceTone = 'white' | 'neutral'
181
+ export type SidebarLayoutBreakpoint = 'md' | 'lg' | 'xl'
182
+ export type SidebarLayoutGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
183
+
184
+ export type SidebarSectionNavigationScrollBehavior = 'auto' | 'smooth'
185
+
186
+ export type SidebarNavigationWarningCode =
187
+ | 'missing-navigation'
188
+ | 'multiple-navigation'
189
+ | 'missing-groups'
190
+ | 'missing-section-id'
191
+ | 'duplicate-section-id'
192
+ | 'unmatched-navigation-item'
193
+ | 'missing-navigation-item-id'
194
+
195
+ export interface SidebarSectionNavigationOptions {
196
+ enabled?: boolean
197
+ /** 额外滚动间距;组件会自动叠加当前滚动根顶部可见的吸顶区域高度 */
198
+ scrollOffset?: number
199
+ scrollBehavior?: SidebarSectionNavigationScrollBehavior
200
+ syncActiveOnScroll?: boolean
201
+ }
202
+
203
+ export interface SidebarNavigationWarning {
204
+ code: SidebarNavigationWarningCode
205
+ id?: string
206
+ message: string
207
+ }
208
+
209
+ export interface SidebarLayoutProps {
210
+ /** 侧边栏展开宽度,默认 240px */
211
+ sidebarWidth?: string
212
+ /** 侧边栏收起宽度,默认 64px */
213
+ collapsedWidth?: string
214
+ /** 是否收起,默认 false */
215
+ collapsed?: boolean
216
+ /** 是否可收起,默认 false */
217
+ collapsible?: boolean
218
+ /** 侧边栏位置,默认 left */
219
+ position?: SidebarLayoutPosition
220
+ /** 是否占满高度,默认 true */
221
+ fullHeight?: boolean
222
+ /** 右侧栏宽度,默认 undefined(不渲染) */
223
+ rightWidth?: string
224
+ /** 右侧栏 < breakpoint 时隐藏,默认 'xl' */
225
+ rightCollapseBreakpoint?: SidebarLayoutBreakpoint
226
+ /** 整体外观:plain 透明 / card 卡片化,默认 plain */
227
+ surface?: SidebarLayoutSurface
228
+ /** surface=card 时背景色,默认 white */
229
+ surfaceTone?: SidebarLayoutSurfaceTone
230
+ /** 侧栏粘性定位(仅 fullHeight=false 生效),默认 false。
231
+ * true 时:解除 sidebar/main 的独立滚动,sidebar 随页面滚动粘顶,
232
+ * 顶部偏移由 CSS 变量 --tf-sidebar-layout-sticky-top 控制(默认 16px)。 */
233
+ stickySidebar?: boolean
234
+ /** 侧栏、主内容、右侧栏之间的布局间距,默认 none */
235
+ gap?: SidebarLayoutGap
236
+ /** 是否显示侧栏分割线,默认 true */
237
+ showDivider?: boolean
238
+ /** surface=card 时是否显示外层边框,默认 true */
239
+ showSurfaceBorder?: boolean
240
+ sectionNavigation?: SidebarSectionNavigationOptions
241
+ activeSection?: string
242
+ }
243
+
244
+ export interface SidebarLayoutEmits {
245
+ /** 收起状态变更,用于 v-model:collapsed */
246
+ 'update:collapsed': [value: boolean]
247
+ /** 点击触发器切换收起状态时触发 */
248
+ collapse: [value: boolean]
249
+ 'section-change': [sectionId: string]
250
+ 'navigation-warning': [warning: SidebarNavigationWarning]
251
+ 'update:activeSection': [value: string]
252
+ }
253
+
254
+ export interface SidebarLayoutSlots {
255
+ sidebar?: (_: any) => any
256
+ main?: (_: any) => any
257
+ default?: (_: any) => any
258
+ trigger?: (_: any) => any
259
+ right?: (_: any) => any
260
+ }
261
+
262
+
263
+ export declare const DOCUMENT_FORM_FIELD_ACCESS_KEY: unique symbol
264
+ export declare const DOCUMENT_FORM_SHELL_CONTEXT_KEY: unique symbol
265
+
266
+ export {
267
+ evaluateFormula,
268
+ extractFormulaDependencies,
269
+ normalizeFormulaTokens,
270
+ validateFormula
271
+ } from './formula'
272
+
273
+ export type * from './formula'
274
+
114
275
  export * from './lowcode-agent'
276
+ export * from './agent-schema'
115
277
 
116
278
  export default TfUI