@progress/kendo-react-form 5.4.0-dev.202205200719 → 5.4.0-dev.202206061009
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/cdn/js/kendo-react-form.js +1 -1
- package/dist/es/Field.d.ts +1 -1
- package/dist/es/Field.js +5 -3
- package/dist/es/FieldArray.js +4 -2
- package/dist/es/Form.d.ts +25 -20
- package/dist/es/Form.js +33 -22
- package/dist/es/FormContext.d.ts +3 -1
- package/dist/es/FormElement.js +4 -2
- package/dist/es/interfaces/FieldArrayProps.js +1 -0
- package/dist/es/interfaces/FieldArrayRenderProps.js +1 -0
- package/dist/es/interfaces/FieldProps.js +1 -0
- package/dist/es/interfaces/FieldRenderProps.js +1 -0
- package/dist/es/interfaces/FieldValidator.js +1 -0
- package/dist/es/interfaces/FormProps.js +1 -0
- package/dist/es/interfaces/FormRenderProps.js +1 -0
- package/dist/es/interfaces/FormSubmitClickEvent.js +1 -0
- package/dist/es/interfaces/FormValidator.js +1 -0
- package/dist/es/interfaces/KeyValue.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/npm/Field.d.ts +1 -1
- package/dist/npm/Field.js +8 -4
- package/dist/npm/FieldArray.js +7 -3
- package/dist/npm/FieldWrapper.js +4 -2
- package/dist/npm/Form.d.ts +25 -20
- package/dist/npm/Form.js +42 -30
- package/dist/npm/FormContext.d.ts +3 -1
- package/dist/npm/FormContext.js +1 -0
- package/dist/npm/FormElement.js +6 -3
- package/dist/npm/main.js +6 -5
- package/dist/npm/package-metadata.js +2 -1
- package/dist/systemjs/kendo-react-form.js +1 -1
- package/package.json +13 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-form',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1654509395,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
package/dist/npm/Field.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ import { FieldProps } from './interfaces/FieldProps';
|
|
|
5
5
|
* It uses `name` property to access field value and meta information from Form state.
|
|
6
6
|
*/
|
|
7
7
|
export declare const Field: {
|
|
8
|
-
(props: FieldProps): React.ReactElement<any, string |
|
|
8
|
+
(props: FieldProps): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
|
|
9
9
|
displayName: string;
|
|
10
10
|
};
|
package/dist/npm/Field.js
CHANGED
|
@@ -15,18 +15,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.Field = void 0;
|
|
23
26
|
var React = require("react");
|
|
24
27
|
var FormContext_1 = require("./FormContext");
|
|
25
28
|
/**
|
|
26
29
|
* Represents the Field component that is used inside the KendoReact Form component.
|
|
27
30
|
* It uses `name` property to access field value and meta information from Form state.
|
|
28
31
|
*/
|
|
29
|
-
|
|
32
|
+
var Field = function (props) {
|
|
30
33
|
var name = props.name, component = props.component, validator = props.validator, children = props.children, onChange = props.onChange, others = __rest(props, ["name", "component", "validator", "children", "onChange"]);
|
|
31
34
|
var form = React.useContext(FormContext_1.FormContext);
|
|
32
35
|
var formId = form ? form.id : '';
|
|
@@ -77,7 +80,7 @@ exports.Field = function (props) {
|
|
|
77
80
|
// ignore meta, combine input with any other props
|
|
78
81
|
return React.createElement(component, __assign({ onChange: onNativeComponentChange, onBlur: handleOnBlur, onFocus: handleOnFocus, value: value, children: children }, others));
|
|
79
82
|
}
|
|
80
|
-
return React.createElement(component, __assign({ children: children }, others, {
|
|
83
|
+
return React.createElement(component, __assign(__assign({ children: children }, others), {
|
|
81
84
|
// input
|
|
82
85
|
onChange: handleOnChange, onBlur: handleOnBlur, onFocus: handleOnFocus, value: value,
|
|
83
86
|
// meta
|
|
@@ -89,4 +92,5 @@ exports.Field = function (props) {
|
|
|
89
92
|
// - You can have a page in one language but an error message displayed in another language (not localizable)
|
|
90
93
|
valid: !(Boolean(form.errors[name]) && form.touched[name]), name: name }));
|
|
91
94
|
};
|
|
95
|
+
exports.Field = Field;
|
|
92
96
|
exports.Field.displayName = 'KendoReactField';
|
package/dist/npm/FieldArray.js
CHANGED
|
@@ -15,18 +15,21 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.FieldArray = void 0;
|
|
23
26
|
var React = require("react");
|
|
24
27
|
var FormContext_1 = require("./FormContext");
|
|
25
28
|
/**
|
|
26
29
|
* Represents the FieldArray component that is used inside the KendoReact Form component.
|
|
27
30
|
* It provides methods via render props for common array manipulations.
|
|
28
31
|
*/
|
|
29
|
-
|
|
32
|
+
var FieldArray = function (props) {
|
|
30
33
|
var name = props.name, component = props.component, validator = props.validator, type = props.type, children = props.children, others = __rest(props, ["name", "component", "validator", "type", "children"]);
|
|
31
34
|
var form = React.useContext(FormContext_1.FormContext);
|
|
32
35
|
var formId = form ? form.id : '';
|
|
@@ -69,4 +72,5 @@ exports.FieldArray = function (props) {
|
|
|
69
72
|
// - You can have a page in one language but an error message displayed in another language (not localizable)
|
|
70
73
|
valid: !(Boolean(form.errors[name]) && form.touched[name]), onUnshift: onUnshift, onPush: onPush, onInsert: onInsert, onPop: onPop, onRemove: onRemove, onReplace: onReplace, onMove: onMove, children: children, name: name }, others));
|
|
71
74
|
};
|
|
75
|
+
exports.FieldArray = FieldArray;
|
|
72
76
|
exports.FieldArray.displayName = 'KendoReactFieldArray';
|
package/dist/npm/FieldWrapper.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldWrapper = void 0;
|
|
3
4
|
var React = require("react");
|
|
4
5
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
5
6
|
/**
|
|
@@ -7,11 +8,12 @@ var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
|
7
8
|
* It's designed to wrap the field editor, Label, Hint and Error components.
|
|
8
9
|
* The FieldWrapper supports only single editor inside it.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
-
var fieldClassName = kendo_react_common_1.classNames({
|
|
11
|
+
var FieldWrapper = function (props) {
|
|
12
|
+
var fieldClassName = (0, kendo_react_common_1.classNames)({
|
|
12
13
|
'k-form-field': true,
|
|
13
14
|
'k-rtl': props.dir === 'rtl'
|
|
14
15
|
}, props.className);
|
|
15
16
|
return (React.createElement("div", { className: fieldClassName, style: props.style }, props.children));
|
|
16
17
|
};
|
|
18
|
+
exports.FieldWrapper = FieldWrapper;
|
|
17
19
|
exports.FieldWrapper.displayName = 'KendoReactFieldWrapper';
|
package/dist/npm/Form.d.ts
CHANGED
|
@@ -77,50 +77,55 @@ export declare class Form extends React.Component<FormProps, {}> {
|
|
|
77
77
|
/**
|
|
78
78
|
* @hidden
|
|
79
79
|
*/
|
|
80
|
+
get touched(): KeyValue<boolean>;
|
|
80
81
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
touched: KeyValue<boolean
|
|
82
|
+
* @hidden
|
|
83
|
+
*/
|
|
84
|
+
set touched(value: KeyValue<boolean>);
|
|
84
85
|
/**
|
|
85
86
|
* @hidden
|
|
86
87
|
*/
|
|
88
|
+
get visited(): KeyValue<boolean>;
|
|
87
89
|
/**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
visited: KeyValue<boolean
|
|
90
|
+
* @hidden
|
|
91
|
+
*/
|
|
92
|
+
set visited(value: KeyValue<boolean>);
|
|
91
93
|
/**
|
|
92
94
|
* @hidden
|
|
93
95
|
*/
|
|
96
|
+
get modified(): KeyValue<boolean>;
|
|
94
97
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
modified: KeyValue<boolean
|
|
98
|
+
* @hidden
|
|
99
|
+
*/
|
|
100
|
+
set modified(value: KeyValue<boolean>);
|
|
98
101
|
/**
|
|
99
102
|
* @hidden
|
|
100
103
|
*/
|
|
104
|
+
get validatorsByField(): KeyValue<(FieldValidatorType | FieldValidatorType[] | undefined)[]>;
|
|
101
105
|
/**
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
validatorsByField: KeyValue<(FieldValidatorType | FieldValidatorType[] | undefined)[]
|
|
106
|
+
* @hidden
|
|
107
|
+
*/
|
|
108
|
+
set validatorsByField(value: KeyValue<(FieldValidatorType | FieldValidatorType[] | undefined)[]>);
|
|
105
109
|
/**
|
|
106
110
|
* @hidden
|
|
107
111
|
*/
|
|
112
|
+
get values(): KeyValue<any>;
|
|
108
113
|
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
values: KeyValue<any
|
|
114
|
+
* @hidden
|
|
115
|
+
*/
|
|
116
|
+
set values(value: KeyValue<any>);
|
|
112
117
|
/**
|
|
113
118
|
* @hidden
|
|
114
119
|
*/
|
|
115
|
-
|
|
120
|
+
get fields(): string[];
|
|
116
121
|
/**
|
|
117
122
|
* @hidden
|
|
118
123
|
*/
|
|
119
|
-
|
|
124
|
+
get formErrors(): KeyValue<string> | undefined;
|
|
120
125
|
/**
|
|
121
126
|
* @hidden
|
|
122
127
|
*/
|
|
123
|
-
|
|
128
|
+
get errors(): KeyValue<string>;
|
|
124
129
|
/**
|
|
125
130
|
* @hidden
|
|
126
131
|
*/
|
|
@@ -154,7 +159,7 @@ export declare class Form extends React.Component<FormProps, {}> {
|
|
|
154
159
|
/**
|
|
155
160
|
* @hidden
|
|
156
161
|
*/
|
|
157
|
-
onSubmit: (event: React.SyntheticEvent<any
|
|
162
|
+
onSubmit: (event: React.SyntheticEvent<any>) => void;
|
|
158
163
|
/**
|
|
159
164
|
* Method for emiting changes to a specific field outside the form component.
|
|
160
165
|
*
|
|
@@ -174,7 +179,7 @@ export declare class Form extends React.Component<FormProps, {}> {
|
|
|
174
179
|
/**
|
|
175
180
|
* @hidden
|
|
176
181
|
*/
|
|
177
|
-
onFieldRegister: (name: string, validator: FieldValidatorType | FieldValidatorType[]) => () => void;
|
|
182
|
+
onFieldRegister: (name: string, validator: FieldValidatorType | FieldValidatorType[] | undefined) => () => void;
|
|
178
183
|
/**
|
|
179
184
|
* @hidden
|
|
180
185
|
*/
|
package/dist/npm/Form.js
CHANGED
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -23,7 +25,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
23
25
|
};
|
|
24
26
|
return __assign.apply(this, arguments);
|
|
25
27
|
};
|
|
28
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
29
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
30
|
+
if (ar || !(i in from)) {
|
|
31
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
32
|
+
ar[i] = from[i];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
36
|
+
};
|
|
26
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.Form = void 0;
|
|
27
39
|
var React = require("react");
|
|
28
40
|
var PropTypes = require("prop-types");
|
|
29
41
|
var FormContext_1 = require("./FormContext");
|
|
@@ -85,7 +97,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
85
97
|
*/
|
|
86
98
|
function Form(props) {
|
|
87
99
|
var _this = _super.call(this, props) || this;
|
|
88
|
-
_this._id = kendo_react_common_1.guid();
|
|
100
|
+
_this._id = (0, kendo_react_common_1.guid)();
|
|
89
101
|
_this._touched = {};
|
|
90
102
|
_this._visited = {};
|
|
91
103
|
_this._modified = {};
|
|
@@ -119,8 +131,8 @@ var Form = /** @class */ (function (_super) {
|
|
|
119
131
|
* @hidden
|
|
120
132
|
*/
|
|
121
133
|
_this.resetForm = function () {
|
|
122
|
-
_this.values = kendo_react_common_1.clone(_this.props.initialValues);
|
|
123
|
-
_this._id = kendo_react_common_1.guid();
|
|
134
|
+
_this.values = (0, kendo_react_common_1.clone)(_this.props.initialValues);
|
|
135
|
+
_this._id = (0, kendo_react_common_1.guid)();
|
|
124
136
|
_this._touched = {};
|
|
125
137
|
_this._visited = {};
|
|
126
138
|
_this._modified = {};
|
|
@@ -188,7 +200,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
188
200
|
var value = options.value;
|
|
189
201
|
_this.addField(name);
|
|
190
202
|
if (!_this.modified[name]) {
|
|
191
|
-
_this.modified = __assign({}, _this.modified, (_a = {}, _a[name] = true, _a));
|
|
203
|
+
_this.modified = __assign(__assign({}, _this.modified), (_a = {}, _a[name] = true, _a));
|
|
192
204
|
}
|
|
193
205
|
_this.valueSetter(name, value);
|
|
194
206
|
_this.forceUpdate();
|
|
@@ -201,7 +213,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
201
213
|
if (_this.visited[name]) {
|
|
202
214
|
return;
|
|
203
215
|
}
|
|
204
|
-
_this.visited = __assign({}, _this.visited, (_a = {}, _a[name] = true, _a));
|
|
216
|
+
_this.visited = __assign(__assign({}, _this.visited), (_a = {}, _a[name] = true, _a));
|
|
205
217
|
if (!skipForceUpdate) {
|
|
206
218
|
_this.forceUpdate();
|
|
207
219
|
}
|
|
@@ -215,7 +227,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
215
227
|
return;
|
|
216
228
|
}
|
|
217
229
|
_this.onFocus(name, skipForceUpdate);
|
|
218
|
-
_this.touched = __assign({}, _this.touched, (_a = {}, _a[name] = true, _a));
|
|
230
|
+
_this.touched = __assign(__assign({}, _this.touched), (_a = {}, _a[name] = true, _a));
|
|
219
231
|
if (!skipForceUpdate) {
|
|
220
232
|
_this.forceUpdate();
|
|
221
233
|
}
|
|
@@ -229,7 +241,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
229
241
|
// The sole reason for using class props over state - nextIndex, needed for destroying validators
|
|
230
242
|
var oldValidators = (_this.validatorsByField[name] || []);
|
|
231
243
|
var nextIndex = oldValidators.length;
|
|
232
|
-
_this.validatorsByField = __assign({}, _this.validatorsByField, (_a = {}, _a[name] =
|
|
244
|
+
_this.validatorsByField = __assign(__assign({}, _this.validatorsByField), (_a = {}, _a[name] = __spreadArray(__spreadArray([], oldValidators, true), [validator], false), _a));
|
|
233
245
|
_this.accumulatedForceUpdate();
|
|
234
246
|
return function () {
|
|
235
247
|
var _a;
|
|
@@ -237,10 +249,10 @@ var Form = /** @class */ (function (_super) {
|
|
|
237
249
|
if (_this._unmounted) {
|
|
238
250
|
return;
|
|
239
251
|
}
|
|
240
|
-
var newValidators = (_this.validatorsByField[name] || [])
|
|
252
|
+
var newValidators = __spreadArray([], (_this.validatorsByField[name] || []), true);
|
|
241
253
|
var validatorIsUnregistered = Boolean(newValidators[nextIndex]);
|
|
242
254
|
newValidators[nextIndex] = undefined;
|
|
243
|
-
_this.validatorsByField = __assign({}, _this.validatorsByField, (_a = {}, _a[name] = newValidators, _a));
|
|
255
|
+
_this.validatorsByField = __assign(__assign({}, _this.validatorsByField), (_a = {}, _a[name] = newValidators, _a));
|
|
244
256
|
if (validatorIsUnregistered) {
|
|
245
257
|
_this.accumulatedForceUpdate();
|
|
246
258
|
}
|
|
@@ -280,13 +292,13 @@ var Form = /** @class */ (function (_super) {
|
|
|
280
292
|
* @hidden
|
|
281
293
|
*/
|
|
282
294
|
_this.valueGetter = function (fieldName) {
|
|
283
|
-
return kendo_react_common_1.getter(fieldName)(_this.values);
|
|
295
|
+
return (0, kendo_react_common_1.getter)(fieldName)(_this.values);
|
|
284
296
|
};
|
|
285
297
|
/**
|
|
286
298
|
* @hidden
|
|
287
299
|
*/
|
|
288
300
|
_this.valueSetter = function (fieldName, value) {
|
|
289
|
-
return kendo_react_common_1.setter(fieldName)(_this.values, value);
|
|
301
|
+
return (0, kendo_react_common_1.setter)(fieldName)(_this.values, value);
|
|
290
302
|
};
|
|
291
303
|
/**
|
|
292
304
|
* @hidden
|
|
@@ -295,7 +307,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
295
307
|
var _a;
|
|
296
308
|
_this.addField(name);
|
|
297
309
|
if (!_this.modified[name]) {
|
|
298
|
-
_this.modified = __assign({}, _this.modified, (_a = {}, _a[name] = true, _a));
|
|
310
|
+
_this.modified = __assign(__assign({}, _this.modified), (_a = {}, _a[name] = true, _a));
|
|
299
311
|
}
|
|
300
312
|
_this.onBlur(name, true);
|
|
301
313
|
};
|
|
@@ -304,7 +316,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
304
316
|
*/
|
|
305
317
|
_this.onInsert = function (name, options) {
|
|
306
318
|
_this.onArrayAction(name);
|
|
307
|
-
var newArray = (_this.valueGetter(name) || [])
|
|
319
|
+
var newArray = __spreadArray([], (_this.valueGetter(name) || []), true);
|
|
308
320
|
newArray.splice(options.index, 0, options.value);
|
|
309
321
|
_this.valueSetter(name, newArray);
|
|
310
322
|
_this.forceUpdate();
|
|
@@ -323,7 +335,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
323
335
|
*/
|
|
324
336
|
_this.onPush = function (name, options) {
|
|
325
337
|
_this.onArrayAction(name);
|
|
326
|
-
var newArray = (_this.valueGetter(name) || [])
|
|
338
|
+
var newArray = __spreadArray(__spreadArray([], (_this.valueGetter(name) || []), true), [options.value], false);
|
|
327
339
|
_this.valueSetter(name, newArray);
|
|
328
340
|
_this.forceUpdate();
|
|
329
341
|
};
|
|
@@ -332,7 +344,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
332
344
|
*/
|
|
333
345
|
_this.onPop = function (name) {
|
|
334
346
|
_this.onArrayAction(name);
|
|
335
|
-
var newArray = (_this.valueGetter(name) || [])
|
|
347
|
+
var newArray = __spreadArray([], (_this.valueGetter(name) || []), true);
|
|
336
348
|
var value = newArray.pop();
|
|
337
349
|
_this.valueSetter(name, newArray);
|
|
338
350
|
_this.forceUpdate();
|
|
@@ -343,7 +355,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
343
355
|
*/
|
|
344
356
|
_this.onRemove = function (name, options) {
|
|
345
357
|
_this.onArrayAction(name);
|
|
346
|
-
var newArray = (_this.valueGetter(name) || [])
|
|
358
|
+
var newArray = __spreadArray([], (_this.valueGetter(name) || []), true);
|
|
347
359
|
var value = newArray.splice(options.index, 1);
|
|
348
360
|
_this.valueSetter(name, newArray);
|
|
349
361
|
_this.forceUpdate();
|
|
@@ -354,7 +366,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
354
366
|
*/
|
|
355
367
|
_this.onReplace = function (name, options) {
|
|
356
368
|
_this.onArrayAction(name);
|
|
357
|
-
var newArray = (_this.valueGetter(name) || [])
|
|
369
|
+
var newArray = __spreadArray([], (_this.valueGetter(name) || []), true);
|
|
358
370
|
newArray.splice(options.index, 1, options.value);
|
|
359
371
|
_this.valueSetter(name, newArray);
|
|
360
372
|
_this.forceUpdate();
|
|
@@ -364,15 +376,15 @@ var Form = /** @class */ (function (_super) {
|
|
|
364
376
|
*/
|
|
365
377
|
_this.onMove = function (name, options) {
|
|
366
378
|
_this.onArrayAction(name);
|
|
367
|
-
var newArray = (_this.valueGetter(name) || [])
|
|
379
|
+
var newArray = __spreadArray([], (_this.valueGetter(name) || []), true);
|
|
368
380
|
var value = newArray[options.prevIndex];
|
|
369
381
|
newArray.splice(options.prevIndex, 1);
|
|
370
382
|
newArray.splice(options.nextIndex, 0, value);
|
|
371
383
|
_this.valueSetter(name, newArray);
|
|
372
384
|
_this.forceUpdate();
|
|
373
385
|
};
|
|
374
|
-
kendo_react_common_2.validatePackage(package_metadata_1.packageMetadata);
|
|
375
|
-
_this.values = kendo_react_common_1.clone(props.initialValues);
|
|
386
|
+
(0, kendo_react_common_2.validatePackage)(package_metadata_1.packageMetadata);
|
|
387
|
+
_this.values = (0, kendo_react_common_1.clone)(props.initialValues);
|
|
376
388
|
return _this;
|
|
377
389
|
}
|
|
378
390
|
Object.defineProperty(Form.prototype, "touched", {
|
|
@@ -388,7 +400,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
388
400
|
set: function (value) {
|
|
389
401
|
this._touched = value;
|
|
390
402
|
},
|
|
391
|
-
enumerable:
|
|
403
|
+
enumerable: false,
|
|
392
404
|
configurable: true
|
|
393
405
|
});
|
|
394
406
|
Object.defineProperty(Form.prototype, "visited", {
|
|
@@ -404,7 +416,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
404
416
|
set: function (value) {
|
|
405
417
|
this._visited = value;
|
|
406
418
|
},
|
|
407
|
-
enumerable:
|
|
419
|
+
enumerable: false,
|
|
408
420
|
configurable: true
|
|
409
421
|
});
|
|
410
422
|
Object.defineProperty(Form.prototype, "modified", {
|
|
@@ -420,7 +432,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
420
432
|
set: function (value) {
|
|
421
433
|
this._modified = value;
|
|
422
434
|
},
|
|
423
|
-
enumerable:
|
|
435
|
+
enumerable: false,
|
|
424
436
|
configurable: true
|
|
425
437
|
});
|
|
426
438
|
Object.defineProperty(Form.prototype, "validatorsByField", {
|
|
@@ -436,7 +448,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
436
448
|
set: function (value) {
|
|
437
449
|
this._validatorsByField = value;
|
|
438
450
|
},
|
|
439
|
-
enumerable:
|
|
451
|
+
enumerable: false,
|
|
440
452
|
configurable: true
|
|
441
453
|
});
|
|
442
454
|
Object.defineProperty(Form.prototype, "values", {
|
|
@@ -452,7 +464,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
452
464
|
set: function (value) {
|
|
453
465
|
this._values = value;
|
|
454
466
|
},
|
|
455
|
-
enumerable:
|
|
467
|
+
enumerable: false,
|
|
456
468
|
configurable: true
|
|
457
469
|
});
|
|
458
470
|
Object.defineProperty(Form.prototype, "fields", {
|
|
@@ -462,7 +474,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
462
474
|
get: function () {
|
|
463
475
|
return Object.keys(this._fields);
|
|
464
476
|
},
|
|
465
|
-
enumerable:
|
|
477
|
+
enumerable: false,
|
|
466
478
|
configurable: true
|
|
467
479
|
});
|
|
468
480
|
Object.defineProperty(Form.prototype, "formErrors", {
|
|
@@ -474,7 +486,7 @@ var Form = /** @class */ (function (_super) {
|
|
|
474
486
|
return this.props.validator(this.values, this.valueGetter);
|
|
475
487
|
}
|
|
476
488
|
},
|
|
477
|
-
enumerable:
|
|
489
|
+
enumerable: false,
|
|
478
490
|
configurable: true
|
|
479
491
|
});
|
|
480
492
|
Object.defineProperty(Form.prototype, "errors", {
|
|
@@ -513,11 +525,11 @@ var Form = /** @class */ (function (_super) {
|
|
|
513
525
|
});
|
|
514
526
|
var formErrors = this.formErrors;
|
|
515
527
|
if (formErrors) {
|
|
516
|
-
kendo_react_common_1.cloneObject(this.formErrors, errors);
|
|
528
|
+
(0, kendo_react_common_1.cloneObject)(this.formErrors, errors);
|
|
517
529
|
}
|
|
518
530
|
return errors;
|
|
519
531
|
},
|
|
520
|
-
enumerable:
|
|
532
|
+
enumerable: false,
|
|
521
533
|
configurable: true
|
|
522
534
|
});
|
|
523
535
|
/**
|
|
@@ -8,7 +8,9 @@ export declare type FormContextType = {
|
|
|
8
8
|
}) => void;
|
|
9
9
|
onFocus: (name: string) => void;
|
|
10
10
|
onBlur: (name: string) => void;
|
|
11
|
-
onUnshift: (name: string, options: {
|
|
11
|
+
onUnshift: (name: string, options: {
|
|
12
|
+
value: any;
|
|
13
|
+
}) => void;
|
|
12
14
|
onPush: (name: string, options: {
|
|
13
15
|
value: any;
|
|
14
16
|
}) => void;
|
package/dist/npm/FormContext.js
CHANGED
package/dist/npm/FormElement.js
CHANGED
|
@@ -15,11 +15,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
15
15
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
16
|
t[p] = s[p];
|
|
17
17
|
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
19
|
-
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
20
22
|
return t;
|
|
21
23
|
};
|
|
22
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.FormElement = void 0;
|
|
23
26
|
var React = require("react");
|
|
24
27
|
var kendo_react_common_1 = require("@progress/kendo-react-common");
|
|
25
28
|
var FormContext_1 = require("./FormContext");
|
|
@@ -36,7 +39,7 @@ exports.FormElement = React.forwardRef(function (props, ref) {
|
|
|
36
39
|
React.useImperativeHandle(ref, function () { return target.current; });
|
|
37
40
|
var form = React.useContext(FormContext_1.FormContext);
|
|
38
41
|
var className = props.className, onSubmit = props.onSubmit, style = props.style, horizontal = props.horizontal, others = __rest(props, ["className", "onSubmit", "style", "horizontal"]);
|
|
39
|
-
var formClassName = kendo_react_common_1.classNames({
|
|
42
|
+
var formClassName = (0, kendo_react_common_1.classNames)({
|
|
40
43
|
'k-form': true,
|
|
41
44
|
'k-form-horizontal': horizontal === true
|
|
42
45
|
}, className);
|
package/dist/npm/main.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FormElement = exports.FieldWrapper = exports.Form = exports.Field = exports.FieldArray = void 0;
|
|
3
4
|
var Field_1 = require("./Field");
|
|
4
|
-
exports
|
|
5
|
+
Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return Field_1.Field; } });
|
|
5
6
|
var Form_1 = require("./Form");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "Form", { enumerable: true, get: function () { return Form_1.Form; } });
|
|
7
8
|
var FieldArray_1 = require("./FieldArray");
|
|
8
|
-
exports
|
|
9
|
+
Object.defineProperty(exports, "FieldArray", { enumerable: true, get: function () { return FieldArray_1.FieldArray; } });
|
|
9
10
|
var FieldWrapper_1 = require("./FieldWrapper");
|
|
10
|
-
exports
|
|
11
|
+
Object.defineProperty(exports, "FieldWrapper", { enumerable: true, get: function () { return FieldWrapper_1.FieldWrapper; } });
|
|
11
12
|
var FormElement_1 = require("./FormElement");
|
|
12
|
-
exports
|
|
13
|
+
Object.defineProperty(exports, "FormElement", { enumerable: true, get: function () { return FormElement_1.FormElement; } });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.packageMetadata = void 0;
|
|
3
4
|
/**
|
|
4
5
|
* @hidden
|
|
5
6
|
*/
|
|
@@ -7,7 +8,7 @@ exports.packageMetadata = {
|
|
|
7
8
|
name: '@progress/kendo-react-form',
|
|
8
9
|
productName: 'KendoReact',
|
|
9
10
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
10
|
-
publishDate:
|
|
11
|
+
publishDate: 1654509395,
|
|
11
12
|
version: '',
|
|
12
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
13
14
|
};
|