uni-flow-design 1.0.0

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,281 @@
1
+ export type FlowId = string | number;
2
+ export declare enum NodeType {
3
+ Launch = "LAUNCH",
4
+ Approval = "APPROVAL",
5
+ Copy = "COPY",
6
+ Transactor = "TRANSACTOR",
7
+ Condition = "CONDITION",
8
+ ConditionTerm = "CONDITION_TERM"
9
+ }
10
+ export type FlowNodeKind = NodeType.Launch | NodeType.Approval | NodeType.Copy | NodeType.Transactor | NodeType.Condition;
11
+ export type AddableNodeKind = NodeType.Approval | NodeType.Copy | NodeType.Transactor | NodeType.Condition;
12
+ export interface FlowDisplayOptions {
13
+ startLabel?: string;
14
+ }
15
+ export interface FlowOptions {
16
+ addableNodeTypes?: AddableNodeKind[];
17
+ minNodeCounts?: Partial<Record<AddableNodeKind, number>>;
18
+ display?: FlowDisplayOptions;
19
+ }
20
+ export interface FlowUiOptions {
21
+ primaryColor?: string;
22
+ theme?: 'light' | 'dark';
23
+ }
24
+ export type FlowUser = {
25
+ name: string;
26
+ id: string;
27
+ type: string;
28
+ typeDetail?: string;
29
+ };
30
+ export type User = FlowUser;
31
+ export interface FlowOperateConfig {
32
+ configType: string;
33
+ name: string;
34
+ open: boolean;
35
+ required: boolean;
36
+ }
37
+ export interface FlowTransition {
38
+ name?: string;
39
+ uiName?: string;
40
+ action: string;
41
+ toNode: string;
42
+ forward: string;
43
+ toState: string;
44
+ description?: string | null;
45
+ copyUserInfos?: string[];
46
+ toNodeAssigneeType?: string;
47
+ operateConfigs?: FlowOperateConfig[];
48
+ }
49
+ export interface NodeBase {
50
+ type: FlowNodeKind;
51
+ uid: FlowId;
52
+ key: string;
53
+ name: string;
54
+ nodeName: string;
55
+ nodeType: string;
56
+ error: boolean;
57
+ uiIsSetting?: boolean;
58
+ childNode?: FlowNode | null;
59
+ nodeUserList: User[];
60
+ transitions: FlowTransition[];
61
+ }
62
+ export interface LaunchNodeConfig extends NodeBase {
63
+ type: NodeType.Launch;
64
+ uiIsSetting: boolean;
65
+ assignees: User[];
66
+ conditionNodes: [];
67
+ forwardBehavior: string;
68
+ opinionFlag: boolean;
69
+ autographFlag: boolean;
70
+ uploadPhotoFlag: boolean;
71
+ }
72
+ export interface ApprovalNodeConfig extends NodeBase {
73
+ type: NodeType.Approval;
74
+ assignees: User[];
75
+ conditionNodes: [];
76
+ forwardBehavior: string;
77
+ opinionFlag: boolean;
78
+ autographFlag: boolean;
79
+ uploadPhotoFlag: boolean;
80
+ }
81
+ export interface TransactorNodeConfig extends NodeBase {
82
+ type: NodeType.Transactor;
83
+ assignees: User[];
84
+ conditionNodes: [];
85
+ forwardBehavior: string;
86
+ opinionFlag: boolean;
87
+ autographFlag: boolean;
88
+ uploadPhotoFlag: boolean;
89
+ }
90
+ export interface CopybyNodeConfig extends NodeBase {
91
+ type: NodeType.Copy;
92
+ assignees: User[];
93
+ conditionNodes: [];
94
+ forwardBehavior: string;
95
+ opinionFlag: boolean;
96
+ autographFlag: boolean;
97
+ uploadPhotoFlag: boolean;
98
+ }
99
+ export interface FlowConditionOption {
100
+ label: string;
101
+ value: string | number | boolean;
102
+ [key: string]: unknown;
103
+ }
104
+ export interface FlowConditionRule {
105
+ ques: FlowConditionOption;
106
+ condi: FlowConditionOption;
107
+ answ: FlowConditionOption;
108
+ }
109
+ export type ConditionDetailItem = FlowConditionRule;
110
+ export interface ConditionItem {
111
+ name: string;
112
+ type: NodeType.ConditionTerm;
113
+ error?: boolean;
114
+ flag?: string;
115
+ uiIsSetting: boolean;
116
+ priorityLevel: number;
117
+ conditionList: ConditionDetailItem[];
118
+ nodeUserList?: User[];
119
+ childNode?: FlowNode | null;
120
+ uid: FlowId;
121
+ transitions: FlowTransition[];
122
+ }
123
+ export interface ConditionItemType {
124
+ name: string;
125
+ type: NodeType.ConditionTerm;
126
+ error?: boolean;
127
+ priorityLevel: number;
128
+ conditionList: FlowConditionRule[];
129
+ nodeUserList?: User[];
130
+ childNode?: FlowNode | null;
131
+ }
132
+ export interface ConditionalNodeConfig extends NodeBase {
133
+ name: string;
134
+ type: NodeType.Condition;
135
+ nodeType: string;
136
+ uiIsSetting?: boolean;
137
+ conditionNodes: ConditionItem[];
138
+ }
139
+ export type MemberNodeConfig = LaunchNodeConfig | ApprovalNodeConfig | TransactorNodeConfig | CopybyNodeConfig;
140
+ export type FlowNode = MemberNodeConfig | ConditionalNodeConfig;
141
+ export type AllNormalNodeType = FlowNode;
142
+ export interface ConditionNodes2 {
143
+ conditionNodes: ConditionItem[];
144
+ }
145
+ export type FlagType = {
146
+ show: boolean;
147
+ required: boolean;
148
+ };
149
+ export type SelectOption = {
150
+ label: string;
151
+ value: string;
152
+ }[];
153
+ export interface UniFormItemBase {
154
+ key: string;
155
+ label: string;
156
+ model: string;
157
+ type: string;
158
+ options: {
159
+ rules: {
160
+ required: boolean;
161
+ };
162
+ };
163
+ }
164
+ export interface UniFormItemNumber extends UniFormItemBase {
165
+ type: 'number';
166
+ }
167
+ export interface UniFormItemRadio extends UniFormItemBase {
168
+ type: 'radio';
169
+ options: {
170
+ options: SelectOption;
171
+ rules: {
172
+ required: boolean;
173
+ };
174
+ };
175
+ }
176
+ export type UniFormItem = UniFormItemNumber | UniFormItemRadio;
177
+ export declare enum NumberRuleType {
178
+ 'greater' = "1",
179
+ 'greaterOrEqual' = "2",
180
+ 'less' = "3",
181
+ 'lessOrEqual' = "4",
182
+ 'equal' = "5",
183
+ 'between' = "6"
184
+ }
185
+ type RuleBase = {
186
+ type: string;
187
+ label: string;
188
+ model: string;
189
+ };
190
+ export interface NumberRule extends RuleBase {
191
+ type: 'number';
192
+ valueRuleType: NumberRuleType;
193
+ triggerNumber: number;
194
+ valueRuleType1?: Omit<NumberRuleType, NumberRuleType.between | NumberRuleType.equal>;
195
+ triggerNumber1?: number;
196
+ valueRuleType2?: Omit<NumberRuleType, NumberRuleType.between | NumberRuleType.equal>;
197
+ triggerNumber2?: number;
198
+ }
199
+ export interface RadioRuleSingle extends RuleBase {
200
+ type: 'radio';
201
+ triggerOptions: SelectOption;
202
+ options: {
203
+ label: string;
204
+ value: string;
205
+ }[];
206
+ }
207
+ export interface Option {
208
+ index: string | number;
209
+ value: string;
210
+ label: string;
211
+ type: string;
212
+ key: string;
213
+ keyFormat: string | undefined;
214
+ }
215
+ export interface OptionItem extends Option {
216
+ wrapIndex: number;
217
+ }
218
+ export interface OptionSecond {
219
+ value: string;
220
+ label: string;
221
+ }
222
+ export interface CurrOptionsType {
223
+ value: string;
224
+ label: string;
225
+ id: string;
226
+ children: {
227
+ value: string;
228
+ label: string;
229
+ }[];
230
+ }
231
+ export interface ItemType {
232
+ default?: string;
233
+ description: string;
234
+ hasDescription: boolean;
235
+ isHide: boolean;
236
+ key: string;
237
+ options?: {
238
+ id: string;
239
+ type?: string;
240
+ value: string;
241
+ label?: string;
242
+ children?: {
243
+ value: string;
244
+ label: string;
245
+ }[];
246
+ }[];
247
+ optionsShowOrder: boolean;
248
+ required: boolean;
249
+ seq: number;
250
+ title: string;
251
+ uuid: string;
252
+ sms?: boolean;
253
+ format?: string;
254
+ children?: ItemType[];
255
+ }
256
+ export interface Dropdown {
257
+ selectConditionType: string;
258
+ keyFormat: string | undefined;
259
+ flag: string;
260
+ cdSelectFirst: string | null | undefined;
261
+ cdSelectSecond: string | null | undefined;
262
+ cdSelectThird: string | null | undefined;
263
+ num: string | null | undefined;
264
+ firstConditionOptions: Option[];
265
+ secondConditionOptions: OptionSecond[];
266
+ thirdConditionOptions: OptionSecond[];
267
+ }
268
+ export interface TableDataType {
269
+ btnName: string;
270
+ showName: string;
271
+ status: boolean;
272
+ isEdit: boolean;
273
+ description?: string;
274
+ configType?: string;
275
+ }
276
+ export interface RoleTableState {
277
+ loading: boolean;
278
+ data: TableDataType[];
279
+ columns: unknown[];
280
+ }
281
+ export {};