@tongfun/ui 0.0.1-alpha.3 → 0.0.1-alpha.4
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/dist/agent-schema/index.d.ts +12 -0
- package/dist/agent-schema/index.js +33 -0
- package/dist/agent-schema/types.d.ts +27 -0
- package/dist/formula/index.d.ts +17 -0
- package/dist/formula/types.d.ts +136 -0
- package/dist/index.d.ts +55 -4
- package/dist/index.js +142216 -125508
- package/dist/lowcode-agent/index.js +9409 -3792
- package/dist/lowcode-agent/types.d.ts +312 -312
- package/dist/skill/golden-examples/dashboard-workbench.md +224 -0
- package/dist/skill/golden-examples/form-create.md +227 -0
- package/dist/skill/golden-examples/management-list.md +264 -0
- package/dist/skill/golden-examples/new-document.md +748 -0
- package/dist/skill/tongfun-ui-skill.json +470 -0
- package/dist/skill/tongfun-ui-skill.md +297 -0
- package/dist/style.css +1 -1
- package/package.json +99 -91
|
@@ -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,8 @@ 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
|
|
5
7
|
export declare const TfAiOverlay: Component
|
|
6
8
|
export declare const TfAlert: Component
|
|
7
9
|
export declare const TfAnchor: Component
|
|
@@ -9,47 +11,59 @@ export declare const TfAppBar: Component
|
|
|
9
11
|
export declare const TfBackTop: Component
|
|
10
12
|
export declare const TfBadge: Component
|
|
11
13
|
export declare const TfBarChart: Component
|
|
14
|
+
export declare const TfBaseUpload: Component
|
|
15
|
+
export declare const TfBasicData: Component
|
|
16
|
+
export declare const TfBasicDataLayout: Component
|
|
17
|
+
export declare const TfBasicDataModal: Component
|
|
12
18
|
export declare const TfBreadcrumb: Component
|
|
19
|
+
export declare const TfBusinessSelect: Component
|
|
13
20
|
export declare const TfButton: Component
|
|
14
21
|
export declare const TfCard: Component
|
|
15
22
|
export declare const TfCascader: Component
|
|
16
23
|
export declare const TfChart: Component
|
|
17
24
|
export declare const TfCodeBlock: Component
|
|
25
|
+
export declare const TfColumnFilterPopover: Component
|
|
18
26
|
export declare const TfContainer: Component
|
|
19
27
|
export declare const TfDataPicker: Component
|
|
20
28
|
export declare const TfDatePicker: Component
|
|
21
29
|
export declare const TfDateTimePicker: Component
|
|
30
|
+
export declare const TfDecimalInput: Component
|
|
22
31
|
export declare const TfDetailLayout: Component
|
|
23
32
|
export declare const TfDivider: Component
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const
|
|
33
|
+
export declare const TfDocumentBodyTable: Component
|
|
34
|
+
export declare const TfDocumentFieldTemplateSettings: Component
|
|
35
|
+
export declare const TfDocumentFormShell: Component
|
|
36
|
+
export declare const TfDocumentGeneralList: Component
|
|
27
37
|
export declare const TfDocumentSectionCard: Component
|
|
28
38
|
export declare const TfDonutChart: Component
|
|
29
39
|
export declare const TfDrawer: Component
|
|
30
40
|
export declare const TfDynamicForm: Component
|
|
31
41
|
export declare const TfEmpty: Component
|
|
32
|
-
export declare const TfEnumSelect: Component
|
|
33
42
|
export declare const TfError: Component
|
|
34
43
|
export declare const TfFieldArray: Component
|
|
35
44
|
export declare const TfForm: Component
|
|
36
45
|
export declare const TfFormAiStatus: Component
|
|
37
46
|
export declare const TfFormAiToolbar: Component
|
|
38
47
|
export declare const TfFormArray: Component
|
|
48
|
+
export declare const TfFormBasicData: Component
|
|
49
|
+
export declare const TfFormBusinessSelect: Component
|
|
39
50
|
export declare const TfFormCascader: Component
|
|
40
51
|
export declare const TfFormCheckbox: Component
|
|
41
52
|
export declare const TfFormDataPicker: Component
|
|
42
53
|
export declare const TfFormDatePicker: Component
|
|
43
54
|
export declare const TfFormDateTimePicker: Component
|
|
55
|
+
export declare const TfFormDecimalInput: Component
|
|
44
56
|
export declare const TfFormDynamic: Component
|
|
45
57
|
export declare const TfFormField: Component
|
|
46
58
|
export declare const TfFormFileUpload: Component
|
|
47
59
|
export declare const TfFormGroup: Component
|
|
60
|
+
export declare const TfFormIconPicker: Component
|
|
48
61
|
export declare const TfFormImageUpload: Component
|
|
49
62
|
export declare const TfFormInput: Component
|
|
50
63
|
export declare const TfFormItem: Component
|
|
51
64
|
export declare const TfFormLayout: Component
|
|
52
65
|
export declare const TfFormLocationPicker: Component
|
|
66
|
+
export declare const TfFormNumberInput: Component
|
|
53
67
|
export declare const TfFormRadio: Component
|
|
54
68
|
export declare const TfFormRegionPicker: Component
|
|
55
69
|
export declare const TfFormSection: Component
|
|
@@ -62,11 +76,14 @@ export declare const TfFormTextarea: Component
|
|
|
62
76
|
export declare const TfFormTimePicker: Component
|
|
63
77
|
export declare const TfFormUpload: Component
|
|
64
78
|
export declare const TfGrid: Component
|
|
79
|
+
export declare const TfGroupNav: Component
|
|
65
80
|
export declare const TfHero: Component
|
|
66
81
|
export declare const TfIcon: Component
|
|
82
|
+
export declare const TfIconPicker: Component
|
|
67
83
|
export declare const TfImagePreview: Component
|
|
68
84
|
export declare const TfInline: Component
|
|
69
85
|
export declare const TfInput: Component
|
|
86
|
+
export declare const TfInputSelect: Component
|
|
70
87
|
export declare const TfLineChart: Component
|
|
71
88
|
export declare const TfLoading: Component
|
|
72
89
|
export declare const TfLocationPicker: Component
|
|
@@ -76,8 +93,10 @@ export declare const TfMetric: Component
|
|
|
76
93
|
export declare const TfMetricGrid: Component
|
|
77
94
|
export declare const TfModal: Component
|
|
78
95
|
export declare const TfNotification: Component
|
|
96
|
+
export declare const TfNumberInput: Component
|
|
79
97
|
export declare const TfPage: Component
|
|
80
98
|
export declare const TfPageHeader: Component
|
|
99
|
+
export declare const TfPageableGrid: Component
|
|
81
100
|
export declare const TfPagination: Component
|
|
82
101
|
export declare const TfSection: Component
|
|
83
102
|
export declare const TfSelect: Component
|
|
@@ -87,6 +106,8 @@ export declare const TfSignature: Component
|
|
|
87
106
|
export declare const TfSkeleton: Component
|
|
88
107
|
export declare const TfSlider: Component
|
|
89
108
|
export declare const TfSplit: Component
|
|
109
|
+
export declare const TfSplitterColumn: Component
|
|
110
|
+
export declare const TfSplitterRow: Component
|
|
90
111
|
export declare const TfStack: Component
|
|
91
112
|
export declare const TfStateContainer: Component
|
|
92
113
|
export declare const TfStatusDot: Component
|
|
@@ -111,6 +132,36 @@ export declare const TfWatermark: Component
|
|
|
111
132
|
|
|
112
133
|
export declare const TfUI: Plugin
|
|
113
134
|
|
|
135
|
+
export type DocumentFormShellStatusValue =
|
|
136
|
+
| string
|
|
137
|
+
| number
|
|
138
|
+
| { id: string; name: string }
|
|
139
|
+
| null
|
|
140
|
+
| undefined
|
|
141
|
+
|
|
142
|
+
export interface DocumentFormFieldAccess {
|
|
143
|
+
status?: {
|
|
144
|
+
readonly value: DocumentFormShellStatusValue | undefined
|
|
145
|
+
}
|
|
146
|
+
resolve: (statusDisabled?: Record<string, boolean>) => {
|
|
147
|
+
disabled: boolean
|
|
148
|
+
readonly: boolean
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export declare const DOCUMENT_FORM_FIELD_ACCESS_KEY: unique symbol
|
|
153
|
+
export declare const DOCUMENT_FORM_SHELL_CONTEXT_KEY: unique symbol
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
evaluateFormula,
|
|
157
|
+
extractFormulaDependencies,
|
|
158
|
+
normalizeFormulaTokens,
|
|
159
|
+
validateFormula
|
|
160
|
+
} from './formula'
|
|
161
|
+
|
|
162
|
+
export type * from './formula'
|
|
163
|
+
|
|
114
164
|
export * from './lowcode-agent'
|
|
165
|
+
export * from './agent-schema'
|
|
115
166
|
|
|
116
167
|
export default TfUI
|