@steroidsjs/core 3.0.37 → 3.0.38
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/docs-autogen-result.json
CHANGED
|
@@ -13866,6 +13866,24 @@
|
|
|
13866
13866
|
"example": null
|
|
13867
13867
|
}
|
|
13868
13868
|
]
|
|
13869
|
+
},
|
|
13870
|
+
{
|
|
13871
|
+
"name": "onClear",
|
|
13872
|
+
"decorators": [],
|
|
13873
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
13874
|
+
"required": false,
|
|
13875
|
+
"type": "void",
|
|
13876
|
+
"example": null,
|
|
13877
|
+
"parameters": [
|
|
13878
|
+
{
|
|
13879
|
+
"name": "value",
|
|
13880
|
+
"decorators": [],
|
|
13881
|
+
"description": "",
|
|
13882
|
+
"required": true,
|
|
13883
|
+
"type": "string",
|
|
13884
|
+
"example": null
|
|
13885
|
+
}
|
|
13886
|
+
]
|
|
13869
13887
|
}
|
|
13870
13888
|
]
|
|
13871
13889
|
},
|
|
@@ -19853,6 +19871,24 @@
|
|
|
19853
19871
|
"example": null
|
|
19854
19872
|
}
|
|
19855
19873
|
]
|
|
19874
|
+
},
|
|
19875
|
+
{
|
|
19876
|
+
"name": "onClear",
|
|
19877
|
+
"decorators": [],
|
|
19878
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
19879
|
+
"required": false,
|
|
19880
|
+
"type": "void",
|
|
19881
|
+
"example": null,
|
|
19882
|
+
"parameters": [
|
|
19883
|
+
{
|
|
19884
|
+
"name": "value",
|
|
19885
|
+
"decorators": [],
|
|
19886
|
+
"description": "",
|
|
19887
|
+
"required": true,
|
|
19888
|
+
"type": "string",
|
|
19889
|
+
"example": null
|
|
19890
|
+
}
|
|
19891
|
+
]
|
|
19856
19892
|
}
|
|
19857
19893
|
]
|
|
19858
19894
|
},
|
|
@@ -24599,6 +24635,24 @@
|
|
|
24599
24635
|
"example": null
|
|
24600
24636
|
}
|
|
24601
24637
|
]
|
|
24638
|
+
},
|
|
24639
|
+
{
|
|
24640
|
+
"name": "onClear",
|
|
24641
|
+
"decorators": [],
|
|
24642
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
24643
|
+
"required": false,
|
|
24644
|
+
"type": "void",
|
|
24645
|
+
"example": null,
|
|
24646
|
+
"parameters": [
|
|
24647
|
+
{
|
|
24648
|
+
"name": "value",
|
|
24649
|
+
"decorators": [],
|
|
24650
|
+
"description": "",
|
|
24651
|
+
"required": true,
|
|
24652
|
+
"type": "string",
|
|
24653
|
+
"example": null
|
|
24654
|
+
}
|
|
24655
|
+
]
|
|
24602
24656
|
}
|
|
24603
24657
|
]
|
|
24604
24658
|
},
|
|
@@ -24884,6 +24938,24 @@
|
|
|
24884
24938
|
"example": null
|
|
24885
24939
|
}
|
|
24886
24940
|
]
|
|
24941
|
+
},
|
|
24942
|
+
{
|
|
24943
|
+
"name": "onClear",
|
|
24944
|
+
"decorators": [],
|
|
24945
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
24946
|
+
"required": false,
|
|
24947
|
+
"type": "void",
|
|
24948
|
+
"example": null,
|
|
24949
|
+
"parameters": [
|
|
24950
|
+
{
|
|
24951
|
+
"name": "value",
|
|
24952
|
+
"decorators": [],
|
|
24953
|
+
"description": "",
|
|
24954
|
+
"required": true,
|
|
24955
|
+
"type": "string",
|
|
24956
|
+
"example": null
|
|
24957
|
+
}
|
|
24958
|
+
]
|
|
24887
24959
|
}
|
|
24888
24960
|
]
|
|
24889
24961
|
},
|
|
@@ -25196,7 +25268,7 @@
|
|
|
25196
25268
|
{
|
|
25197
25269
|
"name": "onClear",
|
|
25198
25270
|
"decorators": [],
|
|
25199
|
-
"description": "",
|
|
25271
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
25200
25272
|
"required": false,
|
|
25201
25273
|
"type": "void",
|
|
25202
25274
|
"example": null,
|
|
@@ -25793,6 +25865,24 @@
|
|
|
25793
25865
|
"example": null
|
|
25794
25866
|
}
|
|
25795
25867
|
]
|
|
25868
|
+
},
|
|
25869
|
+
{
|
|
25870
|
+
"name": "onClear",
|
|
25871
|
+
"decorators": [],
|
|
25872
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
25873
|
+
"required": false,
|
|
25874
|
+
"type": "void",
|
|
25875
|
+
"example": null,
|
|
25876
|
+
"parameters": [
|
|
25877
|
+
{
|
|
25878
|
+
"name": "value",
|
|
25879
|
+
"decorators": [],
|
|
25880
|
+
"description": "",
|
|
25881
|
+
"required": true,
|
|
25882
|
+
"type": "string",
|
|
25883
|
+
"example": null
|
|
25884
|
+
}
|
|
25885
|
+
]
|
|
25796
25886
|
}
|
|
25797
25887
|
]
|
|
25798
25888
|
},
|
|
@@ -26091,6 +26181,24 @@
|
|
|
26091
26181
|
"example": null
|
|
26092
26182
|
}
|
|
26093
26183
|
]
|
|
26184
|
+
},
|
|
26185
|
+
{
|
|
26186
|
+
"name": "onClear",
|
|
26187
|
+
"decorators": [],
|
|
26188
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
26189
|
+
"required": false,
|
|
26190
|
+
"type": "void",
|
|
26191
|
+
"example": null,
|
|
26192
|
+
"parameters": [
|
|
26193
|
+
{
|
|
26194
|
+
"name": "value",
|
|
26195
|
+
"decorators": [],
|
|
26196
|
+
"description": "",
|
|
26197
|
+
"required": true,
|
|
26198
|
+
"type": "string",
|
|
26199
|
+
"example": null
|
|
26200
|
+
}
|
|
26201
|
+
]
|
|
26094
26202
|
}
|
|
26095
26203
|
]
|
|
26096
26204
|
},
|
|
@@ -26331,6 +26439,24 @@
|
|
|
26331
26439
|
"example": null
|
|
26332
26440
|
}
|
|
26333
26441
|
]
|
|
26442
|
+
},
|
|
26443
|
+
{
|
|
26444
|
+
"name": "onClear",
|
|
26445
|
+
"decorators": [],
|
|
26446
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
26447
|
+
"required": false,
|
|
26448
|
+
"type": "void",
|
|
26449
|
+
"example": null,
|
|
26450
|
+
"parameters": [
|
|
26451
|
+
{
|
|
26452
|
+
"name": "value",
|
|
26453
|
+
"decorators": [],
|
|
26454
|
+
"description": "",
|
|
26455
|
+
"required": true,
|
|
26456
|
+
"type": "string",
|
|
26457
|
+
"example": null
|
|
26458
|
+
}
|
|
26459
|
+
]
|
|
26334
26460
|
}
|
|
26335
26461
|
]
|
|
26336
26462
|
},
|
|
@@ -26585,7 +26711,7 @@
|
|
|
26585
26711
|
{
|
|
26586
26712
|
"name": "onClear",
|
|
26587
26713
|
"decorators": [],
|
|
26588
|
-
"description": "",
|
|
26714
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
26589
26715
|
"required": false,
|
|
26590
26716
|
"type": "void",
|
|
26591
26717
|
"example": null,
|
|
@@ -29937,6 +30063,24 @@
|
|
|
29937
30063
|
"example": null
|
|
29938
30064
|
}
|
|
29939
30065
|
]
|
|
30066
|
+
},
|
|
30067
|
+
{
|
|
30068
|
+
"name": "onClear",
|
|
30069
|
+
"decorators": [],
|
|
30070
|
+
"description": "Callback-функция, которая вызывается при очистке input",
|
|
30071
|
+
"required": false,
|
|
30072
|
+
"type": "void",
|
|
30073
|
+
"example": null,
|
|
30074
|
+
"parameters": [
|
|
30075
|
+
{
|
|
30076
|
+
"name": "value",
|
|
30077
|
+
"decorators": [],
|
|
30078
|
+
"description": "",
|
|
30079
|
+
"required": true,
|
|
30080
|
+
"type": "string",
|
|
30081
|
+
"example": null
|
|
30082
|
+
}
|
|
30083
|
+
]
|
|
29940
30084
|
}
|
|
29941
30085
|
]
|
|
29942
30086
|
},
|
package/package.json
CHANGED
|
@@ -23,6 +23,10 @@ export interface IBaseFieldProps extends IFieldWrapperInputProps, IUiComponent {
|
|
|
23
23
|
* @example true
|
|
24
24
|
*/
|
|
25
25
|
showClear?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Callback-функция, которая вызывается при очистке input
|
|
28
|
+
*/
|
|
29
|
+
onClear?: (value: string) => void;
|
|
26
30
|
/**
|
|
27
31
|
* Свойства для компонента отображения
|
|
28
32
|
* @example
|
|
@@ -90,14 +90,19 @@ function InputField(props) {
|
|
|
90
90
|
var maskedInputRef = (0, react_2.useMaskito)({
|
|
91
91
|
options: props.maskOptions
|
|
92
92
|
});
|
|
93
|
-
var _a = (0, hooks_1.useSaveCursorPosition)(props.input), inputRef = _a.inputRef, onChange = _a.onChange;
|
|
93
|
+
var _a = (0, hooks_1.useSaveCursorPosition)(props.input, props.onChange), inputRef = _a.inputRef, onChange = _a.onChange;
|
|
94
94
|
React.useEffect(function () {
|
|
95
95
|
if (inputRef.current) {
|
|
96
96
|
maskedInputRef(inputRef.current);
|
|
97
97
|
}
|
|
98
98
|
}, [inputRef, maskedInputRef]);
|
|
99
99
|
(0, useInputFieldWarningByType_1.useInputFieldWarningByType)(props.type);
|
|
100
|
-
var onClear = React.useCallback(function () {
|
|
100
|
+
var onClear = React.useCallback(function () {
|
|
101
|
+
if (props.onClear) {
|
|
102
|
+
props.onClear('');
|
|
103
|
+
}
|
|
104
|
+
props.input.onChange('');
|
|
105
|
+
}, [props.input, props.onClear]);
|
|
101
106
|
var inputProps = (0, react_1.useMemo)(function () {
|
|
102
107
|
var _a;
|
|
103
108
|
return (__assign({ type: props.type, name: props.input.name, value: (_a = props.input.value) !== null && _a !== void 0 ? _a : '', onInput: onChange, placeholder: props.placeholder }, props.inputProps));
|