@signalplus/params-about 1.0.1 → 1.0.2
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/index.d.ts +308 -227
- package/lib/es/index.js +14 -10
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,309 +2,390 @@ import React, { PureComponent, ComponentProps } from 'react';
|
|
|
2
2
|
import ReactGlobalComp from 'react-global-comp';
|
|
3
3
|
|
|
4
4
|
declare enum ParamType {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
ParamGroup = -1,
|
|
6
|
+
Number = 1,
|
|
7
|
+
Percentage = 2,
|
|
8
|
+
Bool = 3,
|
|
9
|
+
NumberRange = 4,
|
|
10
|
+
PercentageRange = 5,
|
|
11
|
+
ExpiryLimit = 6,
|
|
12
|
+
Expiry = 7,
|
|
13
|
+
Phone = 8,
|
|
14
|
+
Text = 9,
|
|
15
15
|
}
|
|
16
16
|
interface BaseInputProps {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
value?: any;
|
|
18
|
+
onChange?(val: any): void;
|
|
19
|
+
onBlur?(): void;
|
|
20
|
+
readonly?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: any;
|
|
23
|
+
[key: string]: any | undefined | null;
|
|
24
24
|
}
|
|
25
25
|
interface ValidateInfo {
|
|
26
|
-
|
|
26
|
+
[key: string]: undefined | string | ValidateInfo;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
declare type ParamValueStruct = Record<string, any>;
|
|
30
30
|
interface ParamRendererProps extends BaseInputProps {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
valueType?: ParamType;
|
|
32
|
+
value?: ParamValueStruct;
|
|
33
|
+
expiriesOptions?: string[];
|
|
34
|
+
onChange?(val: ParamValueStruct): void;
|
|
35
35
|
}
|
|
36
36
|
declare class ParamRenderer extends PureComponent<ParamRendererProps> {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
37
|
+
get typeConfig(): {
|
|
38
|
+
name: string;
|
|
39
|
+
key?: string | undefined;
|
|
40
|
+
defaultValue?: any;
|
|
41
|
+
Comp: React.ComponentType<BaseInputProps>;
|
|
42
|
+
validator?(value: any): string;
|
|
43
|
+
required?: boolean | undefined;
|
|
44
|
+
};
|
|
45
|
+
get value(): any;
|
|
46
|
+
onChange: (val: any) => void;
|
|
47
|
+
render(): JSX.Element;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
interface ParentSelectorOption {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
parentId?: string | number;
|
|
52
|
+
$paramId: string | number;
|
|
53
|
+
name?: string;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
valueType: ParamType;
|
|
56
|
+
children?: ParentSelectorOption[];
|
|
57
|
+
[key: string]: any;
|
|
58
58
|
}
|
|
59
59
|
interface ParentSelectorProps extends BaseInputProps {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
parentOptions?: ParentSelectorOption[];
|
|
61
|
+
value?: string;
|
|
62
|
+
onChange?(val: string): void;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
interface ParamFormData {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
parentId?: string;
|
|
67
|
+
$paramId?: string;
|
|
68
|
+
key: string;
|
|
69
|
+
name?: string;
|
|
70
|
+
valueType: ParamType;
|
|
71
|
+
defaultValue?: Record<string, any>;
|
|
72
|
+
description?: string;
|
|
73
73
|
}
|
|
74
74
|
interface ParamFormProps {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
parentOptions: ParentSelectorProps['parentOptions'];
|
|
76
|
+
allKeys: string[];
|
|
77
|
+
expiriesOptions: string[];
|
|
78
|
+
initialValues?: Partial<ParamFormData>;
|
|
79
|
+
groupEditable?: boolean;
|
|
80
|
+
onChange?(data: ParamFormData): void;
|
|
81
|
+
onSubmit?(data: ParamFormData): any;
|
|
82
82
|
}
|
|
83
83
|
declare class ParamForm extends PureComponent<ParamFormProps> {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
84
|
+
ref: React.RefObject<any>;
|
|
85
|
+
get formItems(): {
|
|
86
|
+
label: string;
|
|
87
|
+
name: string;
|
|
88
|
+
Comp: React.ComponentType<BaseInputProps>;
|
|
89
|
+
required?: boolean;
|
|
90
|
+
validator?(_: any, val: any): Promise<any>;
|
|
91
|
+
}[];
|
|
92
|
+
onChange: (changed: any, data: any) => void;
|
|
93
|
+
render(): JSX.Element;
|
|
94
94
|
}
|
|
95
|
-
declare class ParamFormModalEl extends PureComponent<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
95
|
+
declare class ParamFormModalEl extends PureComponent<
|
|
96
|
+
ParamFormProps & Required<Pick<ParamFormProps, 'onSubmit'>>
|
|
97
|
+
> {
|
|
98
|
+
ref: React.RefObject<ParamForm>;
|
|
99
|
+
state: {
|
|
100
|
+
visible: boolean;
|
|
101
|
+
pending: boolean;
|
|
102
|
+
};
|
|
103
|
+
get isEdit(): boolean;
|
|
104
|
+
onShow: () => void;
|
|
105
|
+
onHide: () => void;
|
|
106
|
+
onSubmit: () => any;
|
|
107
|
+
render(): JSX.Element;
|
|
106
108
|
}
|
|
107
109
|
declare class ParamFormModal {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
static el: ReactGlobalComp<ParamFormProps & Required<Pick<ParamFormProps, 'onSubmit'>>>;
|
|
111
|
+
static show(props: Omit<ComponentProps<typeof ParamFormModalEl>, 'visible'>): Promise<void>;
|
|
112
|
+
static hide(): Promise<void>;
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
interface ParamValueEditorData {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
paramId: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
valueBefore: Record<string, any>;
|
|
119
|
+
value?: Record<string, any>;
|
|
120
|
+
defaultValue?: Record<string, any>;
|
|
119
121
|
}
|
|
120
122
|
interface ParamValueEditorProps {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
allParams: ParentSelectorProps['parentOptions'];
|
|
124
|
+
expiriesOptions: string[];
|
|
125
|
+
valueType: ParamType;
|
|
126
|
+
initialValues: ParamValueEditorData;
|
|
127
|
+
onChange?(data: ParamValueEditorData): void;
|
|
128
|
+
onSubmit?(data: ParamValueEditorData): any;
|
|
127
129
|
}
|
|
128
130
|
declare class ParamValueEditor extends PureComponent<ParamValueEditorProps> {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
ref: React.RefObject<any>;
|
|
132
|
+
get formItems(): {
|
|
133
|
+
label: string;
|
|
134
|
+
name: string;
|
|
135
|
+
className?: string;
|
|
136
|
+
Comp: React.ComponentType<BaseInputProps>;
|
|
137
|
+
required?: boolean;
|
|
138
|
+
validator?(_: any, val: any): Promise<any>;
|
|
139
|
+
}[];
|
|
140
|
+
onChange: (changed: any, data: any) => void;
|
|
141
|
+
render(): JSX.Element;
|
|
140
142
|
}
|
|
141
|
-
declare class ParamValueEditorModalEl extends PureComponent<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
declare class ParamValueEditorModalEl extends PureComponent<
|
|
144
|
+
ParamValueEditorProps & Required<Pick<ParamValueEditorProps, 'onSubmit'>>
|
|
145
|
+
> {
|
|
146
|
+
ref: React.RefObject<ParamValueEditor>;
|
|
147
|
+
state: {
|
|
148
|
+
visible: boolean;
|
|
149
|
+
pending: boolean;
|
|
150
|
+
};
|
|
151
|
+
onShow: () => void;
|
|
152
|
+
onHide: () => void;
|
|
153
|
+
onSubmit: () => any;
|
|
154
|
+
render(): JSX.Element;
|
|
151
155
|
}
|
|
152
156
|
declare class ParamValueEditorModal {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
157
|
+
static el: ReactGlobalComp<
|
|
158
|
+
ParamValueEditorProps & Required<Pick<ParamValueEditorProps, 'onSubmit'>>
|
|
159
|
+
>;
|
|
160
|
+
static show(
|
|
161
|
+
props: Omit<ComponentProps<typeof ParamValueEditorModalEl>, 'visible'>,
|
|
162
|
+
): Promise<void>;
|
|
163
|
+
static hide(): Promise<void>;
|
|
156
164
|
}
|
|
157
165
|
|
|
158
166
|
interface ImageUploadProps extends BaseInputProps {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
value?: string;
|
|
168
|
+
onChange?(val?: string): void;
|
|
169
|
+
getSignedUrl(key: string): Promise<string>;
|
|
170
|
+
/**
|
|
171
|
+
* 返回图片的 key
|
|
172
|
+
* */
|
|
173
|
+
handleUpload(file: Blob): Promise<string>;
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
interface ParamGroupEditorData {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
177
|
+
parentId: string;
|
|
178
|
+
$paramId?: string;
|
|
179
|
+
name: string;
|
|
180
|
+
valueType?: ParamType;
|
|
181
|
+
descriptionUrl?: string;
|
|
174
182
|
}
|
|
175
|
-
interface ParamGroupEditorProps
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
+
interface ParamGroupEditorProps
|
|
184
|
+
extends Required<Pick<ImageUploadProps, 'getSignedUrl' | 'handleUpload'>> {
|
|
185
|
+
/**
|
|
186
|
+
* 传了表示为有父级
|
|
187
|
+
* */
|
|
188
|
+
parentOptions?: ParentSelectorProps['parentOptions'];
|
|
189
|
+
initialValues?: Partial<ParamGroupEditorData>;
|
|
190
|
+
onChange?(data: ParamGroupEditorData): void;
|
|
191
|
+
onSubmit?(data: ParamGroupEditorData): any;
|
|
183
192
|
}
|
|
184
193
|
declare class ParamGroupEditor extends PureComponent<ParamGroupEditorProps> {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
ref: React.RefObject<any>;
|
|
195
|
+
get formItems(): {
|
|
196
|
+
label: string;
|
|
197
|
+
name: string;
|
|
198
|
+
Comp: React.ComponentType<BaseInputProps>;
|
|
199
|
+
required?: boolean | undefined;
|
|
200
|
+
validator?(_: any, val: any): Promise<any>;
|
|
201
|
+
}[];
|
|
202
|
+
onChange: (changed: any, data: any) => void;
|
|
203
|
+
render(): JSX.Element;
|
|
195
204
|
}
|
|
196
|
-
declare class ParamGroupEditorModalEl extends PureComponent<
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
declare class ParamGroupEditorModalEl extends PureComponent<
|
|
206
|
+
ParamGroupEditorProps & Required<Pick<ParamGroupEditorProps, 'onSubmit'>>
|
|
207
|
+
> {
|
|
208
|
+
ref: React.RefObject<ParamGroupEditor>;
|
|
209
|
+
state: {
|
|
210
|
+
visible: boolean;
|
|
211
|
+
pending: boolean;
|
|
212
|
+
};
|
|
213
|
+
get isEdit(): boolean;
|
|
214
|
+
onShow: () => void;
|
|
215
|
+
onHide: () => void;
|
|
216
|
+
onSubmit: () => any;
|
|
217
|
+
render(): JSX.Element;
|
|
207
218
|
}
|
|
208
219
|
declare class ParamGroupEditorModal {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
220
|
+
static el: ReactGlobalComp<
|
|
221
|
+
ParamGroupEditorProps & Required<Pick<ParamGroupEditorProps, 'onSubmit'>>
|
|
222
|
+
>;
|
|
223
|
+
static show(
|
|
224
|
+
props: Omit<ComponentProps<typeof ParamGroupEditorModalEl>, 'visible'>,
|
|
225
|
+
): Promise<void>;
|
|
226
|
+
static hide(): Promise<void>;
|
|
212
227
|
}
|
|
213
228
|
|
|
214
229
|
interface ParamMoverData {
|
|
215
|
-
|
|
230
|
+
parentId: string | number;
|
|
216
231
|
}
|
|
217
232
|
interface ParamMoverProps {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
233
|
+
/**
|
|
234
|
+
* 需要确保 targetParams 的元素之间无父子或者祖先子孙关系
|
|
235
|
+
* */
|
|
236
|
+
targetParams: (string | number)[];
|
|
237
|
+
allParams: NonNullable<ParentSelectorProps['parentOptions']>;
|
|
238
|
+
/**
|
|
239
|
+
* 最大层级(包括参数)
|
|
240
|
+
* @default 3
|
|
241
|
+
* */
|
|
242
|
+
maxLevel?: number;
|
|
243
|
+
onSubmit?(params: NonNullable<ParentSelectorProps['parentOptions']>): any;
|
|
229
244
|
}
|
|
230
245
|
declare function initState(props: ParamMoverProps): {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
246
|
+
preProps: ParamMoverProps;
|
|
247
|
+
options: any[];
|
|
248
|
+
paramsMap: Record<string, ParentSelectorOption>;
|
|
234
249
|
};
|
|
235
250
|
declare type ParamMoverState = ReturnType<typeof initState>;
|
|
236
251
|
declare class ParamMover extends PureComponent<ParamMoverProps, ParamMoverState> {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
static getDerivedStateFromProps(
|
|
253
|
+
props: ParamMoverProps,
|
|
254
|
+
state: ParamMoverState,
|
|
255
|
+
): {
|
|
256
|
+
preProps: ParamMoverProps;
|
|
257
|
+
options: any[];
|
|
258
|
+
paramsMap: Record<string, ParentSelectorOption>;
|
|
259
|
+
};
|
|
260
|
+
get newParams(): ParentSelectorOption[];
|
|
261
|
+
state: {
|
|
262
|
+
preProps: ParamMoverProps;
|
|
263
|
+
options: any[];
|
|
264
|
+
paramsMap: Record<string, ParentSelectorOption>;
|
|
265
|
+
};
|
|
266
|
+
ref: React.RefObject<any>;
|
|
267
|
+
get formItems(): {
|
|
268
|
+
label: string;
|
|
269
|
+
name: string;
|
|
270
|
+
Comp: React.ComponentType<BaseInputProps>;
|
|
271
|
+
required?: boolean | undefined;
|
|
272
|
+
validator?(_: any, val: any): Promise<any>;
|
|
273
|
+
}[];
|
|
274
|
+
render(): JSX.Element;
|
|
257
275
|
}
|
|
258
|
-
declare class ParamMoverModalEl extends PureComponent<
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
276
|
+
declare class ParamMoverModalEl extends PureComponent<
|
|
277
|
+
ParamMoverProps & Required<Pick<ParamMoverProps, 'onSubmit'>>
|
|
278
|
+
> {
|
|
279
|
+
ref: React.RefObject<ParamMover>;
|
|
280
|
+
state: {
|
|
281
|
+
visible: boolean;
|
|
282
|
+
pending: boolean;
|
|
283
|
+
};
|
|
284
|
+
onShow: () => void;
|
|
285
|
+
onHide: () => void;
|
|
286
|
+
onSubmit: () => any;
|
|
287
|
+
render(): JSX.Element;
|
|
268
288
|
}
|
|
269
289
|
declare class ParamMoverModal {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
290
|
+
static el: ReactGlobalComp<ParamMoverProps & Required<Pick<ParamMoverProps, 'onSubmit'>>>;
|
|
291
|
+
static show(props: Omit<ComponentProps<typeof ParamMoverModalEl>, 'visible'>): Promise<void>;
|
|
292
|
+
static hide(): Promise<void>;
|
|
273
293
|
}
|
|
274
294
|
|
|
275
|
-
declare const ParamTypeConfig: Record<
|
|
295
|
+
declare const ParamTypeConfig: Record<
|
|
296
|
+
ParamType,
|
|
297
|
+
{
|
|
276
298
|
name: string;
|
|
277
299
|
key?: string;
|
|
278
300
|
defaultValue?: any;
|
|
279
301
|
Comp: React.ComponentType<BaseInputProps>;
|
|
280
302
|
validator?(value: any): string;
|
|
281
303
|
required?: boolean;
|
|
282
|
-
}
|
|
283
|
-
|
|
304
|
+
}
|
|
305
|
+
>;
|
|
306
|
+
declare function paramValidator(
|
|
307
|
+
val: any,
|
|
308
|
+
values: {
|
|
284
309
|
valueType: ParamType;
|
|
285
|
-
}
|
|
310
|
+
},
|
|
311
|
+
): string;
|
|
286
312
|
declare const ParamTypeOptions: {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
313
|
+
value: number;
|
|
314
|
+
label: string;
|
|
315
|
+
name: string;
|
|
316
|
+
key?: string | undefined;
|
|
317
|
+
defaultValue?: any;
|
|
318
|
+
Comp: React.ComponentType<BaseInputProps>;
|
|
319
|
+
validator?(value: any): string;
|
|
320
|
+
required?: boolean | undefined;
|
|
295
321
|
}[];
|
|
296
322
|
|
|
297
323
|
declare function formatNum(val: string): number | undefined;
|
|
298
324
|
declare function isNullLike(val: any): val is undefined | null;
|
|
299
|
-
declare function emptyValidator(val: any, enableEmpty?: boolean):
|
|
300
|
-
declare function numRangeValidator(
|
|
325
|
+
declare function emptyValidator(val: any, enableEmpty?: boolean): 'Should not be empty' | '';
|
|
326
|
+
declare function numRangeValidator(
|
|
327
|
+
val: {
|
|
301
328
|
min?: string;
|
|
302
329
|
max?: string;
|
|
303
|
-
},
|
|
304
|
-
|
|
330
|
+
},
|
|
331
|
+
enableEmpty?: boolean,
|
|
332
|
+
): string;
|
|
333
|
+
declare function expiryValidator(
|
|
334
|
+
val: string,
|
|
335
|
+
enableEmpty?: boolean,
|
|
336
|
+
): 'Should not be empty' | '' | 'Out of format';
|
|
305
337
|
declare function expiriesValidator(val: string[]): string;
|
|
306
|
-
declare function keyValidator(
|
|
338
|
+
declare function keyValidator(
|
|
339
|
+
val: string,
|
|
340
|
+
allKeys: string[],
|
|
341
|
+
):
|
|
342
|
+
| 'Should not be empty'
|
|
343
|
+
| ''
|
|
344
|
+
| 'Out of format: should be a combination of the following chars `_.0-9a-zA-Z`'
|
|
345
|
+
| 'This key has been used';
|
|
307
346
|
declare function isExpired(val?: string): boolean;
|
|
308
|
-
declare function validatorCvt(
|
|
347
|
+
declare function validatorCvt(
|
|
348
|
+
validator: (val: any, values: any) => ValidateInfo['string'],
|
|
349
|
+
form?: () => any,
|
|
350
|
+
): (_: any, val: any) => Promise<any>;
|
|
309
351
|
|
|
310
|
-
export {
|
|
352
|
+
export {
|
|
353
|
+
BaseInputProps,
|
|
354
|
+
ParamForm,
|
|
355
|
+
ParamFormData,
|
|
356
|
+
ParamFormModal,
|
|
357
|
+
ParamFormProps,
|
|
358
|
+
ParamGroupEditor,
|
|
359
|
+
ParamGroupEditorData,
|
|
360
|
+
ParamGroupEditorModal,
|
|
361
|
+
ParamGroupEditorModalEl,
|
|
362
|
+
ParamGroupEditorProps,
|
|
363
|
+
ParamMover,
|
|
364
|
+
ParamMoverData,
|
|
365
|
+
ParamMoverModal,
|
|
366
|
+
ParamMoverModalEl,
|
|
367
|
+
ParamMoverProps,
|
|
368
|
+
ParamMoverState,
|
|
369
|
+
ParamRenderer,
|
|
370
|
+
ParamRendererProps,
|
|
371
|
+
ParamType,
|
|
372
|
+
ParamTypeConfig,
|
|
373
|
+
ParamTypeOptions,
|
|
374
|
+
ParamValueEditor,
|
|
375
|
+
ParamValueEditorData,
|
|
376
|
+
ParamValueEditorModal,
|
|
377
|
+
ParamValueEditorModalEl,
|
|
378
|
+
ParamValueEditorProps,
|
|
379
|
+
ParamValueStruct,
|
|
380
|
+
ValidateInfo,
|
|
381
|
+
emptyValidator,
|
|
382
|
+
expiriesValidator,
|
|
383
|
+
expiryValidator,
|
|
384
|
+
formatNum,
|
|
385
|
+
isExpired,
|
|
386
|
+
isNullLike,
|
|
387
|
+
keyValidator,
|
|
388
|
+
numRangeValidator,
|
|
389
|
+
paramValidator,
|
|
390
|
+
validatorCvt,
|
|
391
|
+
};
|
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bundle of @signalplus/params-about
|
|
3
|
-
* Generated: 2022-
|
|
4
|
-
* Version: 1.0.
|
|
3
|
+
* Generated: 2022-06-16
|
|
4
|
+
* Version: 1.0.2
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -769,9 +769,13 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
|
|
|
769
769
|
});
|
|
770
770
|
|
|
771
771
|
_defineProperty(_assertThisInitialized(_this), "onChange", function (val) {
|
|
772
|
-
var _this$props$onChange, _this$props, _this$props$onBlur, _this$props2;
|
|
772
|
+
var _this$props$value, _this$props$onChange, _this$props, _this$props$onBlur, _this$props2;
|
|
773
|
+
|
|
774
|
+
var value = _toConsumableArray(((_this$props$value = _this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (item) {
|
|
775
|
+
var _this$props$options;
|
|
773
776
|
|
|
774
|
-
|
|
777
|
+
return (_this$props$options = _this.props.options) === null || _this$props$options === void 0 ? void 0 : _this$props$options.includes(item);
|
|
778
|
+
})) || []);
|
|
775
779
|
|
|
776
780
|
if (_this.props.multiple !== false) {
|
|
777
781
|
var index = value.findIndex(function (it) {
|
|
@@ -793,10 +797,10 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
|
|
|
793
797
|
_createClass(Expiries, [{
|
|
794
798
|
key: "renderValue",
|
|
795
799
|
value: function renderValue() {
|
|
796
|
-
var _this$props$
|
|
800
|
+
var _this$props$value2,
|
|
797
801
|
_this2 = this;
|
|
798
802
|
|
|
799
|
-
var value = (_this$props$
|
|
803
|
+
var value = (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.filter(function (it) {
|
|
800
804
|
return it && !isExpired(it);
|
|
801
805
|
});
|
|
802
806
|
|
|
@@ -811,9 +815,9 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
|
|
|
811
815
|
}, "Choose");
|
|
812
816
|
|
|
813
817
|
if (this.props.multiple === false) {
|
|
814
|
-
var _this$props$
|
|
818
|
+
var _this$props$value3;
|
|
815
819
|
|
|
816
|
-
var _val = (_this$props$
|
|
820
|
+
var _val = (_this$props$value3 = this.props.value) === null || _this$props$value3 === void 0 ? void 0 : _this$props$value3[0];
|
|
817
821
|
|
|
818
822
|
return !_val || isExpired(_val) ? placeholder : /*#__PURE__*/React.createElement("span", {
|
|
819
823
|
className: "param-expiries-val"
|
|
@@ -836,7 +840,7 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
|
|
|
836
840
|
}, {
|
|
837
841
|
key: "render",
|
|
838
842
|
value: function render() {
|
|
839
|
-
var _this$props$
|
|
843
|
+
var _this$props$options2,
|
|
840
844
|
_this3 = this;
|
|
841
845
|
|
|
842
846
|
return /*#__PURE__*/React.createElement(Popover, {
|
|
@@ -845,7 +849,7 @@ var Expiries = /*#__PURE__*/function (_PureComponent) {
|
|
|
845
849
|
placement: 'bottomLeft',
|
|
846
850
|
visible: !this.props.readonly && this.state.visible,
|
|
847
851
|
onVisibleChange: this.handleVisibleChange,
|
|
848
|
-
content: (_this$props$
|
|
852
|
+
content: (_this$props$options2 = this.props.options) === null || _this$props$options2 === void 0 ? void 0 : _this$props$options2.map(function (it) {
|
|
849
853
|
var _this3$props$value, _this3$props$calcDisa, _this3$props, _this3$onChange;
|
|
850
854
|
|
|
851
855
|
var checked = (_this3$props$value = _this3.props.value) === null || _this3$props$value === void 0 ? void 0 : _this3$props$value.includes(it);
|