@progress/kendo-react-form 14.5.0-develop.9 → 15.0.0-develop.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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { FormHandle } from './Form.js';
9
+ import { FormProps } from './interfaces/FormProps';
10
+ /**
11
+ * Form wrapper that integrates the Web MCP hook.
12
+ *
13
+ * @hidden
14
+ */
15
+ import * as React from 'react';
16
+ /** @hidden */
17
+ export declare const FormWrapper: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<FormHandle>>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),u=require("./Form.js"),n=require("@progress/kendo-react-common");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const c=f(i),m=n.withIdHOC(u.Form),a=c.forwardRef((e,r)=>{const[t,o]=n.useMergedRef(r);return n.useWebMcpRegister("form",t,e,e.webMcp),c.createElement(m,{...e,ref:o})});a.displayName="KendoReactForm";exports.FormWrapper=a;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as r from "react";
9
+ import { Form as f } from "./Form.mjs";
10
+ import { useMergedRef as a, useWebMcpRegister as c, withIdHOC as i } from "@progress/kendo-react-common";
11
+ const n = i(f), d = r.forwardRef((e, o) => {
12
+ const [t, m] = a(o);
13
+ return c("form", t, e, e.webMcp), /* @__PURE__ */ r.createElement(n, { ...e, ref: m });
14
+ });
15
+ d.displayName = "KendoReactForm";
16
+ export {
17
+ d as FormWrapper
18
+ };
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![KendoReact NPM Banner](https://raw.githubusercontent.com/telerik/kendo-react/master/images/kendoreact-github-banner.png)](https://www.telerik.com/kendo-react-ui/components/free?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-form&utm_content=banner)
1
+ [![KendoReact NPM Banner](https://raw.githubusercontent.com/telerik/kendo-react/master/images/kendoreact-github-banner.png)](https://www.telerik.com/kendo-react-ui/components/getting-started/free-vs-premium?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-form&utm_content=banner)
2
2
 
3
3
  # KendoReact Form Component for React
4
4
 
@@ -12,7 +12,7 @@
12
12
  >
13
13
  > [Start using KendoReact](https://www.telerik.com/try/kendo-react-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-form) and speed up your development process!
14
14
  >
15
- > If you're looking for free React components, check out [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/free).
15
+ > If you're looking for free React components, check out [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started).
16
16
 
17
17
  React Form, part of KendoReact, is a small and fast package for form state management with zero dependencies.
18
18
 
@@ -27,7 +27,7 @@ Among the features which the KendoReact Form component delivers are:
27
27
 
28
28
  The following table outlines the key resources available with KendoReact and KendoReact Free.
29
29
 
30
- | | [KendoReact Free](https://www.telerik.com/kendo-react-ui/components/free) | [KendoReact](https://www.telerik.com/kendo-react-ui) |
30
+ | | [KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started/free-vs-premium) | [KendoReact](https://www.telerik.com/kendo-react-ui) |
31
31
  | -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
32
  | React components | 50+ | 120+ |
33
33
  | Four professional themes | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" stroke="white" stroke-width="2"/></svg> | <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z" stroke="white" stroke-width="2"/></svg> |
@@ -50,7 +50,7 @@ For any issues you might encounter while working with the KendoReact Form, use a
50
50
  ## Resources
51
51
 
52
52
  - [Getting Started with KendoReact](https://www.telerik.com/kendo-react-ui/components/getting-started/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-form)
53
- - [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/free)
53
+ - [Get Started with KendoReact Free](https://www.telerik.com/kendo-react-ui/components/getting-started)
54
54
  - [Get Started with the KendoReact Form](https://www.telerik.com/kendo-react-ui/components/form/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-form)
55
55
  - [API Reference of the KendoReact Form](https://www.telerik.com/kendo-react-ui/components/form/api/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-form)
56
56
  - [KendoReact Roadmap](https://www.telerik.com/support/whats-new/kendo-react-ui/roadmap?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-react-trial-npm-form)
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactForm={},e.React,e.PropTypes,e.KendoReactCommon)}(this,function(e,t,s,i){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,Object.freeze(t)}var r=o(t);const n=r.createContext(null),l=e=>{const{name:t,component:s,validator:i,children:o,onChange:l,...a}=e,u=r.useContext(n),d=u?u.id:"";r.useEffect(()=>u?u.registerField(t,i):void 0,[t,d,i]);const c=r.useCallback(e=>{const s=e&&(void 0!==e.value?e.value:e.target?e.target.value:e.target);u.onChange(t,{value:s}),l&&l.call(void 0,e)},[t,d,l]),h=r.useCallback(e=>u.onChange(t,{value:e.target.value}),[t,d]),m=r.useCallback(()=>u.onBlur(t),[t,d]),f=r.useCallback(()=>u.onFocus(t),[t,d]);if(!u)return null;const p=u.valueGetter(t);if("string"==typeof s)return r.createElement(s,{onChange:h,onBlur:m,onFocus:f,value:p,children:o,...a});const v={children:o,...a,onChange:c,onBlur:m,onFocus:f,value:p,validationMessage:u.errors[t],touched:u.touched[t],modified:u.modified[t],visited:u.visited[t],valid:!(u.errors[t]&&u.touched[t]),name:t};return o||delete v.children,r.createElement(s,v)};l.displayName="KendoReactField";const a=Object.freeze({name:"@progress/kendo-react-form",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"14.5.0-develop.9",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),u=class extends r.Component{constructor(e){super(e),this._touched={},this._visited={},this._modified={},this._validatorsByField={},this._values={},this._fields={},this._unmounted=!1,this._submitted=!1,this.showLicenseWatermark=!1,this.isValid=()=>this.isFormValid(this.errors),this.accumulatedForceUpdate=()=>{this._accumulatorTimeout&&clearTimeout(this._accumulatorTimeout),this._accumulatorTimeout=window.setTimeout(()=>{this._accumulatorTimeout=void 0,this.forceUpdate()},0)},this.resetForm=()=>{this.values=i.clone(this.props.initialValues),this._key=i.guid(),this._touched={},this._visited={},this._modified={},this._validatorsByField={},this._fields={},this._submitted=!1,this.forceUpdate()},this.onReset=()=>this.resetForm(),this.addField=e=>{this._fields[e]=!0},this.onSubmit=e=>{const t={},s=this.fields;e&&("function"==typeof e.preventDefault&&e.preventDefault(),"function"==typeof e.stopPropagation&&e.stopPropagation()),s.forEach(e=>{t[e]=!0}),this.visited={...t},this.touched={...t};const i=this.values,o=this.isFormValid(this.errors),r=this.isFormModified(this.modified,s);this.props.onSubmitClick&&this.props.onSubmitClick.call(void 0,{values:i,isValid:o,isModified:r,event:e}),o&&(this.props.ignoreModified||r)&&this.props.onSubmit&&(this._submitted=!0,this.props.onSubmit.call(void 0,i,e)),this.forceUpdate()},this.onChange=(e,t)=>{const{value:s}=t;this.addField(e),this.modified[e]||(this.modified={...this.modified,[e]:!0}),this.valueSetter(e,s),this.props.onChange&&this.props.onChange(e,s,this.valueGetter),this.forceUpdate()},this.onFocus=(e,t)=>{this.visited[e]||(this.visited={...this.visited,[e]:!0},t||this.forceUpdate())},this.onBlur=(e,t)=>{this.touched[e]||(this.onFocus(e,t),this.touched={...this.touched,[e]:!0},t||this.forceUpdate())},this.onFieldRegister=(e,t)=>{this.addField(e);const s=this.validatorsByField[e]||[],i=s.findIndex(e=>void 0===e),o=[...s];i>=0?o[i]=t:o.push(t);const r=i>=0?i:o.length-1;return this.validatorsByField={...this.validatorsByField,[e]:o},this.accumulatedForceUpdate(),()=>{const t=[...this.validatorsByField[e]||[]],s=!!t[r];t[r]=void 0,this.validatorsByField={...this.validatorsByField,[e]:t},s&&!this._unmounted&&this.accumulatedForceUpdate()}},this.isFormValid=e=>!Object.keys(e).some(t=>!!e[t]),this.isFormModified=(e,t)=>t.some(t=>e[t]),this.isFormHasNotTouched=(e,t)=>t.some(t=>!e[t]),this.isFormTouched=(e,t)=>t.some(t=>e[t]),this.isFormVisited=(e,t)=>t.some(t=>e[t]),this.valueGetter=e=>i.getter(e)(this.values),this.valueSetter=(e,t)=>i.setter(e)(this.values,t),this.onArrayAction=e=>{this.addField(e),this.modified[e]||(this.modified={...this.modified,[e]:!0}),this.onBlur(e,!0)},this.onInsert=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[]];s.splice(t.index,0,t.value),this.valueSetter(e,s),this.forceUpdate()},this.onUnshift=(e,t)=>{this.onInsert(e,{value:t.value,index:0})},this.onPush=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[],t.value];this.valueSetter(e,s),this.forceUpdate()},this.onPop=e=>{this.onArrayAction(e);const t=[...this.valueGetter(e)||[]],s=t.pop();return this.valueSetter(e,t),this.forceUpdate(),s},this.onRemove=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[]],i=s.splice(t.index,1);return this.valueSetter(e,s),this.forceUpdate(),i},this.onReplace=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[]];s.splice(t.index,1,t.value),this.valueSetter(e,s),this.forceUpdate()},this.onMove=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[]],i=s[t.prevIndex];s.splice(t.prevIndex,1),s.splice(t.nextIndex,0,i),this.valueSetter(e,s),this.forceUpdate()},this.showLicenseWatermark=!i.validatePackage(a,{component:"Form"}),this.licenseMessage=i.getLicenseMessage(a),this.values=i.clone(e.initialValues)}get touched(){return this._touched}set touched(e){this._touched=e}get visited(){return this._visited}set visited(e){this._visited=e}get modified(){return this._modified}set modified(e){this._modified=e}get validatorsByField(){return this._validatorsByField}set validatorsByField(e){this._validatorsByField=e}get values(){return this._values}set values(e){this._values=e}get fields(){return Object.keys(this._fields)}get formErrors(){if(this.props.validator)return this.props.validator(this.values,this.valueGetter)}get errors(){const e={},t=this.fields,s=this.validatorsByField;t.forEach(t=>{if(e[t]="",s[t]){const i=[];s[t].forEach(e=>{Array.isArray(e)?i.push(...e):i.push(e)}),i.find(s=>{if(s){const i=s(this.valueGetter(t),this.valueGetter,{name:t});if(i)return e[t]=i,!0}return!1})}});const o=this.formErrors;return o&&i.cloneObject(o,e),this.props.errors&&i.cloneObject(this.props.errors,e),e}componentWillUnmount(){this._unmounted=!0,this._accumulatorTimeout&&clearTimeout(this._accumulatorTimeout)}render(){const{render:e}=this.props,t=this.touched,s=this.visited,o=this.modified,l=this.fields,a=this.errors,u=this.isFormValid(a),d=this.isFormModified(o,l),c=this.isFormTouched(t,l),h=this.isFormVisited(s,l),m=this.isFormHasNotTouched(t,l)&&!u||u&&(this.props.ignoreModified||d);return r.createElement(r.Fragment,null,r.createElement(n.Provider,{key:this._key||this.props.id,value:{id:this.props.id,valueGetter:this.valueGetter,errors:a,modified:o,touched:t,visited:s,registerField:this.onFieldRegister,onSubmit:this.onSubmit,onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,onUnshift:this.onUnshift,onPush:this.onPush,onInsert:this.onInsert,onPop:this.onPop,onRemove:this.onRemove,onReplace:this.onReplace,onMove:this.onMove}},e({valid:u,modified:d,touched:c,visited:h,submitted:this._submitted,valueGetter:this.valueGetter,errors:a,allowSubmit:m,onChange:this.onChange,onSubmit:this.onSubmit,onFormReset:this.resetForm})),this.showLicenseWatermark&&r.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}};u.displayName="KendoReactForm",u.propTypes={initialValues:s.any,onSubmit:s.func,onSubmitClick:s.func,render:s.func.isRequired,id:s.string};let d=u;const c=e=>{const{name:t,component:s,validator:i,type:o,children:l,...a}=e,u=r.useContext(n),d=u?u.id:"";r.useEffect(()=>u?u.registerField(t,i):void 0,[t,d,i]);const c=r.useCallback(e=>u.onUnshift(t,e),[t,d]),h=r.useCallback(e=>u.onPush(t,e),[t,d]),m=r.useCallback(e=>u.onInsert(t,e),[t,d]),f=r.useCallback(()=>u.onPop(t),[t,d]),p=r.useCallback(e=>u.onRemove(t,e),[t,d]),v=r.useCallback(e=>u.onReplace(t,e),[t,d]),y=r.useCallback(e=>u.onMove(t,e),[t,d]);if(!u)return null;const F=u.valueGetter(t);return r.createElement(s,{value:F,validationMessage:u.errors[t],touched:u.touched[t],modified:u.modified[t],visited:u.visited[t],valid:!(u.errors[t]&&u.touched[t]),onUnshift:c,onPush:h,onInsert:m,onPop:f,onRemove:p,onReplace:v,onMove:y,children:l,name:t,...a})};function h(e){let t=e.clientWidth;const s=getComputedStyle(e);return t-=(parseFloat(s.paddingLeft)||0)+(parseFloat(s.borderLeftWidth)||0),t-=(parseFloat(s.paddingRight)||0)+(parseFloat(s.borderRightWidth)||0),t}function m(e,t){var s,i;if(null==e||!e.length||null==t)return"";for(const[o,r]of e.entries()){const n=o>0&&void 0!==e[o-1].maxWidth?e[o-1].maxWidth:void 0,l=o<e.length-1&&void 0!==e[o+1].minWidth?e[o+1].minWidth:void 0,a=null!=(s=r.minWidth)?s:void 0!==n?n+1:0,u=null!=(i=r.maxWidth)?i:void 0!==l?l-1:1/0;if(t>=a&&t<=u)return r.value}return""}c.displayName="KendoReactFieldArray";const f=e=>{if("number"==typeof e)return`${e}px`;if("string"==typeof e){const t=e.trim(),s=parseInt(t,10);return!isNaN(s)&&Number.isFinite(s)?s.toString()===t?`${s}px`:e:null}return null},p=(e,t)=>{if(!e)return null;if(Array.isArray(e)&&e.length>0){const s=m(e,t)||null;return"string"==typeof s?parseInt(s,10):s}return"number"==typeof e?e:null},v=e=>e&&e>0?`k-grid-cols-${e}`:"",y=(e,t)=>{if(!e)return null;if("number"==typeof e)return e;if(Array.isArray(e)&&e.length>0){const s=m(e,t)||null;return"string"==typeof s?parseInt(s,10):s}return null},F=e=>e?`k-col-span-${e}`:"",g=(e,t)=>{if(!e)return null;if("number"==typeof e)return{cols:e,rows:e};if("string"==typeof e){if(!e.includes(" "))return{cols:e,rows:e};const t=e.split(" ");return{cols:t[1],rows:t[0]}}if(Array.isArray(e)){const s=m(e,t)||null;return null!==s?{cols:s,rows:s}:null}if("object"==typeof e){const s=e,i={rows:null,cols:null};return void 0!==s.cols&&null!==s.cols?"number"==typeof s.cols||"string"==typeof s.cols?i.cols=s.cols:Array.isArray(s.cols)&&(i.cols=m(s.cols,t)||null):i.cols=null,void 0!==s.rows?"number"==typeof s.rows||"string"==typeof s.rows?i.rows=s.rows:Array.isArray(s.rows)&&(i.rows=m(s.rows,t)||null):i.rows=null,i}return null},b=(e,t)=>{var s,i,o,r;return`${f(null!=(i=null!=(s=null==e?void 0:e.rows)?s:t.rows)?i:"0px")} ${f(null!=(r=null!=(o=null==e?void 0:e.cols)?o:t.cols)?r:"32px")}`},w=e=>{const{className:t,style:s,dir:o,colSpan:n,children:l}=e,a=r.useRef(null),u=i.useUnstyled(),d=e.unstyled||u,c=d&&d.uForm,[m,f]=r.useState(void 0),p=r.useRef(null);r.useEffect(()=>{a.current&&(p.current=a.current.closest("form"))},[]),r.useEffect(()=>{let e;const t=null==p?void 0:p.current,s=()=>{let e=0;if(t?e=h(t):"undefined"!=typeof window&&(e=window.innerWidth),void 0!==n){const t=y(n,e);f(F(t))}else f(void 0)};return s(),t&&"undefined"!=typeof window&&"ResizeObserver"in window&&(e=new ResizeObserver(s),e.observe(t)),()=>{e&&t&&e.unobserve(t)}},[n]);const v=r.useMemo(()=>i.classNames(i.uForm.field({c:c,isRtl:"rtl"===o}),m,t),[c,t,o,m]);return r.createElement("div",{ref:a,className:v,style:s},l)};w.displayName="KendoReactFieldWrapper";const R={rows:"0px",cols:"32px"},C=r.forwardRef((e,t)=>{const s={size:void 0,...e},o=r.useRef(null),l=r.useRef(null);r.useImperativeHandle(l,()=>({element:o.current,props:s})),r.useImperativeHandle(t,()=>l.current);const a=r.useContext(n),{className:u,style:d,horizontal:c,size:m,cols:f,gutters:y=R,...F}=s,w=i.useUnstyled(),C=w&&w.uForm,[S,_]=r.useState(void 0),[E,N]=r.useState(void 0),k=r.useMemo(()=>c?"horizontal":!1===c?"vertical":void 0,[c]),A=r.useMemo(()=>i.classNames(i.uForm.form({c:C,size:m,orientation:k}),u),[u,C,k,m]);return r.useEffect(()=>{if(!f&&!y)return void _(void 0);if(!y)return void N(void 0);const e=()=>{let e=0;if(o.current?e=h(o.current):"undefined"!=typeof window&&(e=window.innerWidth),f){const t=p(f,e);_(v(t))}if(y){const t=g(y,e);N(t?{gap:b(t,R)}:{gap:b(R,R)})}};let t;e();const s=o.current;return s&&"undefined"!=typeof window&&"ResizeObserver"in window&&(t=new ResizeObserver(e),t.observe(s)),()=>{t&&s&&t.unobserve(s)}},[f,y]),r.createElement("form",{ref:o,...F,id:e.id||(a?a.id:void 0),style:e.style,className:A,onSubmit:a?a.onSubmit:void 0},f?r.createElement("div",{className:i.classNames(i.uForm.formLayout({c:C}),S),style:E},e.children):e.children)});C.displayName="KendoReactFormElement";const S=r.forwardRef((e,t)=>{const s=r.useRef(null),o=r.useRef(null);r.useImperativeHandle(o,()=>({element:s.current,props:e})),r.useImperativeHandle(t,()=>o.current);const{className:n,style:l,colSpan:a,...u}=e,d=i.useUnstyled(),c=d&&d.uForm,[m,f]=r.useState(void 0),p=r.useRef(null);r.useEffect(()=>{s.current&&(p.current=s.current.closest("form"))},[]),r.useEffect(()=>{let e;const t=p.current,s=()=>{let e=0;if(t?e=h(t):"undefined"!=typeof window&&(e=window.innerWidth),void 0!==a){const t=y(a,e);f(F(t))}else f(void 0)};return s(),t&&"undefined"!=typeof window&&"ResizeObserver"in window&&(e=new ResizeObserver(s),e.observe(t)),()=>{e&&t&&e.unobserve(t)}},[a]);const v=r.useMemo(()=>i.classNames(i.uForm.separator({c:c}),m,n),[n,c,m]);return r.createElement("span",{ref:s,...u,style:e.style,className:v})});S.displayName="KendoReactFormSeparator";const _={rows:"0px",cols:"16px"},E=r.forwardRef((e,t)=>{const s=r.useRef(null),o=r.useRef(null);r.useImperativeHandle(o,()=>({element:s.current,props:e})),r.useImperativeHandle(t,()=>o.current);const{className:n,style:l,cols:a,colSpan:u,gutters:d=_,legend:c,...m}=e,f=i.useUnstyled(),w=f&&f.uForm,[R,C]=r.useState(void 0),[S,E]=r.useState(void 0),[N,k]=r.useState(void 0),A=r.useMemo(()=>i.classNames(i.uForm.fieldset({c:w}),S,n),[n,w,S]),x=r.useMemo(()=>i.classNames(i.uForm.formLayout({c:w}),R),[w,R]),U=r.useMemo(()=>i.classNames(i.uForm.legend({c:w})),[w]),O=r.useRef(null);return r.useEffect(()=>{s.current&&(O.current=s.current.closest("form"))},[]),r.useEffect(()=>{if(!a)return void C(void 0);if(!d)return void k(void 0);const e=null==O?void 0:O.current,t=()=>{let t=0;e?t=h(e):"undefined"!=typeof window&&(t=window.innerWidth);const s=p(a,t);if(C(v(s)),void 0!==u){const e=y(u,t);E(F(e))}else E(void 0);if(d){const e=g(d,t);k(e?{gap:b(e,_)}:{gap:b(_,_)})}};let s;return t(),e&&"undefined"!=typeof window&&"ResizeObserver"in window&&(s=new ResizeObserver(t),s.observe(e)),()=>{s&&e&&s.unobserve(e)}},[a,u,d]),r.createElement("fieldset",{ref:s,...m,style:e.style,className:A},c&&r.createElement("legend",{className:U},c),a?r.createElement("div",{className:x,style:N},e.children):e.children)});E.displayName="KendoReactFormFieldSet";const N=i.withIdHOC(d);N.displayName="KendoReactForm",e.Field=l,e.FieldArray=c,e.FieldWrapper=w,e.Form=N,e.FormClassComponent=d,e.FormElement=C,e.FormFieldSet=E,e.FormSeparator=S});
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactForm={},e.React,e.PropTypes,e.KendoReactCommon)}(this,function(e,t,s,i){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(s){if("default"!==s){var i=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return e[s]}})}}),t.default=e,Object.freeze(t)}var r=o(t);const n=r.createContext(null),l=e=>{const{name:t,component:s,validator:i,children:o,onChange:l,...a}=e,u=r.useContext(n),d=u?u.id:"";r.useEffect(()=>u?u.registerField(t,i):void 0,[t,d,i]);const c=r.useCallback(e=>{const s=e&&(void 0!==e.value?e.value:e.target?e.target.value:e.target);u.onChange(t,{value:s}),l&&l.call(void 0,e)},[t,d,l]),h=r.useCallback(e=>u.onChange(t,{value:e.target.value}),[t,d]),m=r.useCallback(()=>u.onBlur(t),[t,d]),f=r.useCallback(()=>u.onFocus(t),[t,d]);if(!u)return null;const p=u.valueGetter(t);if("string"==typeof s)return r.createElement(s,{onChange:h,onBlur:m,onFocus:f,value:p,children:o,...a});const v={children:o,...a,onChange:c,onBlur:m,onFocus:f,value:p,validationMessage:u.errors[t],touched:u.touched[t],modified:u.modified[t],visited:u.visited[t],valid:!(u.errors[t]&&u.touched[t]),name:t};return o||delete v.children,r.createElement(s,v)};l.displayName="KendoReactField";const a=Object.freeze({name:"@progress/kendo-react-form",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"15.0.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),u=class extends r.Component{constructor(e){super(e),this._touched={},this._visited={},this._modified={},this._validatorsByField={},this._values={},this._fields={},this._unmounted=!1,this._submitted=!1,this.showLicenseWatermark=!1,this.isValid=()=>this.isFormValid(this.errors),this.accumulatedForceUpdate=()=>{this._accumulatorTimeout&&clearTimeout(this._accumulatorTimeout),this._accumulatorTimeout=window.setTimeout(()=>{this._accumulatorTimeout=void 0,this.forceUpdate()},0)},this.resetForm=()=>{this.values=i.clone(this.props.initialValues),this._key=i.guid(),this._touched={},this._visited={},this._modified={},this._validatorsByField={},this._fields={},this._submitted=!1,this.forceUpdate()},this.onReset=()=>this.resetForm(),this.addField=e=>{this._fields[e]=!0},this.onSubmit=e=>{const t={},s=this.fields;e&&("function"==typeof e.preventDefault&&e.preventDefault(),"function"==typeof e.stopPropagation&&e.stopPropagation()),s.forEach(e=>{t[e]=!0}),this.visited={...t},this.touched={...t};const i=this.values,o=this.isFormValid(this.errors),r=this.isFormModified(this.modified,s);this.props.onSubmitClick&&this.props.onSubmitClick.call(void 0,{values:i,isValid:o,isModified:r,event:e}),o&&(this.props.ignoreModified||r)&&this.props.onSubmit&&(this._submitted=!0,this.props.onSubmit.call(void 0,i,e)),this.forceUpdate()},this.onChange=(e,t)=>{const{value:s}=t;this.addField(e),this.modified[e]||(this.modified={...this.modified,[e]:!0}),this.valueSetter(e,s),this.props.onChange&&this.props.onChange(e,s,this.valueGetter),this.forceUpdate()},this.onFocus=(e,t)=>{this.visited[e]||(this.visited={...this.visited,[e]:!0},t||this.forceUpdate())},this.onBlur=(e,t)=>{this.touched[e]||(this.onFocus(e,t),this.touched={...this.touched,[e]:!0},t||this.forceUpdate())},this.onFieldRegister=(e,t)=>{this.addField(e);const s=this.validatorsByField[e]||[],i=s.findIndex(e=>void 0===e),o=[...s];i>=0?o[i]=t:o.push(t);const r=i>=0?i:o.length-1;return this.validatorsByField={...this.validatorsByField,[e]:o},this.accumulatedForceUpdate(),()=>{const t=[...this.validatorsByField[e]||[]],s=!!t[r];t[r]=void 0,this.validatorsByField={...this.validatorsByField,[e]:t},s&&!this._unmounted&&this.accumulatedForceUpdate()}},this.isFormValid=e=>!Object.keys(e).some(t=>!!e[t]),this.isFormModified=(e,t)=>t.some(t=>e[t]),this.isFormHasNotTouched=(e,t)=>t.some(t=>!e[t]),this.isFormTouched=(e,t)=>t.some(t=>e[t]),this.isFormVisited=(e,t)=>t.some(t=>e[t]),this.valueGetter=e=>i.getter(e)(this.values),this.valueSetter=(e,t)=>i.setter(e)(this.values,t),this.onArrayAction=e=>{this.addField(e),this.modified[e]||(this.modified={...this.modified,[e]:!0}),this.onBlur(e,!0)},this.onInsert=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[]];s.splice(t.index,0,t.value),this.valueSetter(e,s),this.forceUpdate()},this.onUnshift=(e,t)=>{this.onInsert(e,{value:t.value,index:0})},this.onPush=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[],t.value];this.valueSetter(e,s),this.forceUpdate()},this.onPop=e=>{this.onArrayAction(e);const t=[...this.valueGetter(e)||[]],s=t.pop();return this.valueSetter(e,t),this.forceUpdate(),s},this.onRemove=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[]],i=s.splice(t.index,1);return this.valueSetter(e,s),this.forceUpdate(),i},this.onReplace=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[]];s.splice(t.index,1,t.value),this.valueSetter(e,s),this.forceUpdate()},this.onMove=(e,t)=>{this.onArrayAction(e);const s=[...this.valueGetter(e)||[]],i=s[t.prevIndex];s.splice(t.prevIndex,1),s.splice(t.nextIndex,0,i),this.valueSetter(e,s),this.forceUpdate()},this.showLicenseWatermark=!i.validatePackage(a,{component:"Form"}),this.licenseMessage=i.getLicenseMessage(a),this.values=i.clone(e.initialValues)}get touched(){return this._touched}set touched(e){this._touched=e}get visited(){return this._visited}set visited(e){this._visited=e}get modified(){return this._modified}set modified(e){this._modified=e}get validatorsByField(){return this._validatorsByField}set validatorsByField(e){this._validatorsByField=e}get values(){return this._values}set values(e){this._values=e}get fields(){return Object.keys(this._fields)}get formErrors(){if(this.props.validator)return this.props.validator(this.values,this.valueGetter)}get errors(){const e={},t=this.fields,s=this.validatorsByField;t.forEach(t=>{if(e[t]="",s[t]){const i=[];s[t].forEach(e=>{Array.isArray(e)?i.push(...e):i.push(e)}),i.find(s=>{if(s){const i=s(this.valueGetter(t),this.valueGetter,{name:t});if(i)return e[t]=i,!0}return!1})}});const o=this.formErrors;return o&&i.cloneObject(o,e),this.props.errors&&i.cloneObject(this.props.errors,e),e}componentWillUnmount(){this._unmounted=!0,this._accumulatorTimeout&&clearTimeout(this._accumulatorTimeout)}render(){const{render:e}=this.props,t=this.touched,s=this.visited,o=this.modified,l=this.fields,a=this.errors,u=this.isFormValid(a),d=this.isFormModified(o,l),c=this.isFormTouched(t,l),h=this.isFormVisited(s,l),m=this.isFormHasNotTouched(t,l)&&!u||u&&(this.props.ignoreModified||d);return r.createElement(r.Fragment,null,r.createElement(n.Provider,{key:this._key||this.props.id,value:{id:this.props.id,valueGetter:this.valueGetter,errors:a,modified:o,touched:t,visited:s,registerField:this.onFieldRegister,onSubmit:this.onSubmit,onChange:this.onChange,onFocus:this.onFocus,onBlur:this.onBlur,onUnshift:this.onUnshift,onPush:this.onPush,onInsert:this.onInsert,onPop:this.onPop,onRemove:this.onRemove,onReplace:this.onReplace,onMove:this.onMove}},e({valid:u,modified:d,touched:c,visited:h,submitted:this._submitted,valueGetter:this.valueGetter,errors:a,allowSubmit:m,onChange:this.onChange,onSubmit:this.onSubmit,onFormReset:this.resetForm})),this.showLicenseWatermark&&r.createElement(i.WatermarkOverlay,{message:this.licenseMessage}))}};u.displayName="KendoReactForm",u.propTypes={initialValues:s.any,onSubmit:s.func,onSubmitClick:s.func,render:s.func.isRequired,id:s.string};let d=u;const c=e=>{const{name:t,component:s,validator:i,type:o,children:l,...a}=e,u=r.useContext(n),d=u?u.id:"";r.useEffect(()=>u?u.registerField(t,i):void 0,[t,d,i]);const c=r.useCallback(e=>u.onUnshift(t,e),[t,d]),h=r.useCallback(e=>u.onPush(t,e),[t,d]),m=r.useCallback(e=>u.onInsert(t,e),[t,d]),f=r.useCallback(()=>u.onPop(t),[t,d]),p=r.useCallback(e=>u.onRemove(t,e),[t,d]),v=r.useCallback(e=>u.onReplace(t,e),[t,d]),y=r.useCallback(e=>u.onMove(t,e),[t,d]);if(!u)return null;const F=u.valueGetter(t);return r.createElement(s,{value:F,validationMessage:u.errors[t],touched:u.touched[t],modified:u.modified[t],visited:u.visited[t],valid:!(u.errors[t]&&u.touched[t]),onUnshift:c,onPush:h,onInsert:m,onPop:f,onRemove:p,onReplace:v,onMove:y,children:l,name:t,...a})};function h(e){let t=e.clientWidth;const s=getComputedStyle(e);return t-=(parseFloat(s.paddingLeft)||0)+(parseFloat(s.borderLeftWidth)||0),t-=(parseFloat(s.paddingRight)||0)+(parseFloat(s.borderRightWidth)||0),t}function m(e,t){var s,i;if(null==e||!e.length||null==t)return"";for(const[o,r]of e.entries()){const n=o>0&&void 0!==e[o-1].maxWidth?e[o-1].maxWidth:void 0,l=o<e.length-1&&void 0!==e[o+1].minWidth?e[o+1].minWidth:void 0,a=null!=(s=r.minWidth)?s:void 0!==n?n+1:0,u=null!=(i=r.maxWidth)?i:void 0!==l?l-1:1/0;if(t>=a&&t<=u)return r.value}return""}c.displayName="KendoReactFieldArray";const f=e=>{if("number"==typeof e)return`${e}px`;if("string"==typeof e){const t=e.trim(),s=parseInt(t,10);return!isNaN(s)&&Number.isFinite(s)?s.toString()===t?`${s}px`:e:null}return null},p=(e,t)=>{if(!e)return null;if(Array.isArray(e)&&e.length>0){const s=m(e,t)||null;return"string"==typeof s?parseInt(s,10):s}return"number"==typeof e?e:null},v=e=>e&&e>0?`k-grid-cols-${e}`:"",y=(e,t)=>{if(!e)return null;if("number"==typeof e)return e;if(Array.isArray(e)&&e.length>0){const s=m(e,t)||null;return"string"==typeof s?parseInt(s,10):s}return null},F=e=>e?`k-col-span-${e}`:"",g=(e,t)=>{if(!e)return null;if("number"==typeof e)return{cols:e,rows:e};if("string"==typeof e){if(!e.includes(" "))return{cols:e,rows:e};const t=e.split(" ");return{cols:t[1],rows:t[0]}}if(Array.isArray(e)){const s=m(e,t)||null;return null!==s?{cols:s,rows:s}:null}if("object"==typeof e){const s=e,i={rows:null,cols:null};return void 0!==s.cols&&null!==s.cols?"number"==typeof s.cols||"string"==typeof s.cols?i.cols=s.cols:Array.isArray(s.cols)&&(i.cols=m(s.cols,t)||null):i.cols=null,void 0!==s.rows?"number"==typeof s.rows||"string"==typeof s.rows?i.rows=s.rows:Array.isArray(s.rows)&&(i.rows=m(s.rows,t)||null):i.rows=null,i}return null},b=(e,t)=>{var s,i,o,r;return`${f(null!=(i=null!=(s=null==e?void 0:e.rows)?s:t.rows)?i:"0px")} ${f(null!=(r=null!=(o=null==e?void 0:e.cols)?o:t.cols)?r:"32px")}`},w=e=>{const{className:t,style:s,dir:o,colSpan:n,children:l}=e,a=r.useRef(null),u=i.useUnstyled(),d=e.unstyled||u,c=d&&d.uForm,[m,f]=r.useState(void 0),p=r.useRef(null);r.useEffect(()=>{a.current&&(p.current=a.current.closest("form"))},[]),r.useEffect(()=>{let e;const t=null==p?void 0:p.current,s=()=>{let e=0;if(t?e=h(t):"undefined"!=typeof window&&(e=window.innerWidth),void 0!==n){const t=y(n,e);f(F(t))}else f(void 0)};return s(),t&&"undefined"!=typeof window&&"ResizeObserver"in window&&(e=new ResizeObserver(s),e.observe(t)),()=>{e&&t&&e.unobserve(t)}},[n]);const v=r.useMemo(()=>i.classNames(i.uForm.field({c:c,isRtl:"rtl"===o}),m,t),[c,t,o,m]);return r.createElement("div",{ref:a,className:v,style:s},l)};w.displayName="KendoReactFieldWrapper";const R={rows:"0px",cols:"32px"},C=r.forwardRef((e,t)=>{const s={size:void 0,...e},o=r.useRef(null),l=r.useRef(null);r.useImperativeHandle(l,()=>({element:o.current,props:s})),r.useImperativeHandle(t,()=>l.current);const a=r.useContext(n),{className:u,style:d,horizontal:c,size:m,cols:f,gutters:y=R,...F}=s,w=i.useUnstyled(),C=w&&w.uForm,[S,_]=r.useState(void 0),[E,N]=r.useState(void 0),k=r.useMemo(()=>c?"horizontal":!1===c?"vertical":void 0,[c]),A=r.useMemo(()=>i.classNames(i.uForm.form({c:C,size:m,orientation:k}),u),[u,C,k,m]);return r.useEffect(()=>{if(!f&&!y)return void _(void 0);if(!y)return void N(void 0);const e=()=>{let e=0;if(o.current?e=h(o.current):"undefined"!=typeof window&&(e=window.innerWidth),f){const t=p(f,e);_(v(t))}if(y){const t=g(y,e);N(t?{gap:b(t,R)}:{gap:b(R,R)})}};let t;e();const s=o.current;return s&&"undefined"!=typeof window&&"ResizeObserver"in window&&(t=new ResizeObserver(e),t.observe(s)),()=>{t&&s&&t.unobserve(s)}},[f,y]),r.createElement("form",{ref:o,...F,id:e.id||(a?a.id:void 0),style:e.style,className:A,onSubmit:a?a.onSubmit:void 0},f?r.createElement("div",{className:i.classNames(i.uForm.formLayout({c:C}),S),style:E},e.children):e.children)});C.displayName="KendoReactFormElement";const S=r.forwardRef((e,t)=>{const s=r.useRef(null),o=r.useRef(null);r.useImperativeHandle(o,()=>({element:s.current,props:e})),r.useImperativeHandle(t,()=>o.current);const{className:n,style:l,colSpan:a,...u}=e,d=i.useUnstyled(),c=d&&d.uForm,[m,f]=r.useState(void 0),p=r.useRef(null);r.useEffect(()=>{s.current&&(p.current=s.current.closest("form"))},[]),r.useEffect(()=>{let e;const t=p.current,s=()=>{let e=0;if(t?e=h(t):"undefined"!=typeof window&&(e=window.innerWidth),void 0!==a){const t=y(a,e);f(F(t))}else f(void 0)};return s(),t&&"undefined"!=typeof window&&"ResizeObserver"in window&&(e=new ResizeObserver(s),e.observe(t)),()=>{e&&t&&e.unobserve(t)}},[a]);const v=r.useMemo(()=>i.classNames(i.uForm.separator({c:c}),m,n),[n,c,m]);return r.createElement("span",{ref:s,...u,style:e.style,className:v})});S.displayName="KendoReactFormSeparator";const _={rows:"0px",cols:"16px"},E=r.forwardRef((e,t)=>{const s=r.useRef(null),o=r.useRef(null);r.useImperativeHandle(o,()=>({element:s.current,props:e})),r.useImperativeHandle(t,()=>o.current);const{className:n,style:l,cols:a,colSpan:u,gutters:d=_,legend:c,...m}=e,f=i.useUnstyled(),w=f&&f.uForm,[R,C]=r.useState(void 0),[S,E]=r.useState(void 0),[N,k]=r.useState(void 0),A=r.useMemo(()=>i.classNames(i.uForm.fieldset({c:w}),S,n),[n,w,S]),x=r.useMemo(()=>i.classNames(i.uForm.formLayout({c:w}),R),[w,R]),U=r.useMemo(()=>i.classNames(i.uForm.legend({c:w})),[w]),M=r.useRef(null);return r.useEffect(()=>{s.current&&(M.current=s.current.closest("form"))},[]),r.useEffect(()=>{if(!a)return void C(void 0);if(!d)return void k(void 0);const e=null==M?void 0:M.current,t=()=>{let t=0;e?t=h(e):"undefined"!=typeof window&&(t=window.innerWidth);const s=p(a,t);if(C(v(s)),void 0!==u){const e=y(u,t);E(F(e))}else E(void 0);if(d){const e=g(d,t);k(e?{gap:b(e,_)}:{gap:b(_,_)})}};let s;return t(),e&&"undefined"!=typeof window&&"ResizeObserver"in window&&(s=new ResizeObserver(t),s.observe(e)),()=>{s&&e&&s.unobserve(e)}},[a,u,d]),r.createElement("fieldset",{ref:s,...m,style:e.style,className:A},c&&r.createElement("legend",{className:U},c),a?r.createElement("div",{className:x,style:N},e.children):e.children)});E.displayName="KendoReactFormFieldSet";const N=i.withIdHOC(d),k=r.forwardRef((e,t)=>{const[s,o]=i.useMergedRef(t);return i.useWebMcpRegister("form",s,e,e.webMcp),r.createElement(N,{...e,ref:o})});k.displayName="KendoReactForm";const A=k;e.Field=l,e.FieldArray=c,e.FieldWrapper=w,e.Form=A,e.FormClassComponent=d,e.FormElement=C,e.FormFieldSet=E,e.FormSeparator=S});
package/index.d.mts CHANGED
@@ -24,6 +24,6 @@ import { FormSeparator, FormSeparatorProps, FormSeparatorHandle } from './FormSe
24
24
  import { FormFieldSet, FormFieldSetProps, FormFieldSetHandle } from './FormFieldSet.js';
25
25
  import { ResponsiveFormBreakPoint } from './interfaces/ResponsiveFormBreakPoint';
26
26
  import { Gutters } from './interfaces/Gutters';
27
- /** @hidden */
28
- declare const Form: import('react').ForwardRefExoticComponent<FormProps & import('react').RefAttributes<any>>;
27
+ declare const Form: import('react').ForwardRefExoticComponent<FormProps & import('react').RefAttributes<FormHandle>>;
28
+ type Form = FormClassComponent;
29
29
  export { FieldArray, FieldArrayProps, FieldArrayRenderProps, Field, FieldProps, FieldRenderProps, Form, FormClassComponent, FormHandle, FormProps, FormRenderProps, FormValidatorType, FieldValidatorType, KeyValue, FieldWrapper, FieldWrapperProps, FormElement, FormElementHandle, FormElementProps, FormSubmitClickEvent, FormSeparator, FormSeparatorProps, FormSeparatorHandle, FormFieldSet, FormFieldSetProps, FormFieldSetHandle, ResponsiveFormBreakPoint, Gutters };
package/index.d.ts CHANGED
@@ -24,6 +24,6 @@ import { FormSeparator, FormSeparatorProps, FormSeparatorHandle } from './FormSe
24
24
  import { FormFieldSet, FormFieldSetProps, FormFieldSetHandle } from './FormFieldSet.js';
25
25
  import { ResponsiveFormBreakPoint } from './interfaces/ResponsiveFormBreakPoint';
26
26
  import { Gutters } from './interfaces/Gutters';
27
- /** @hidden */
28
- declare const Form: import('react').ForwardRefExoticComponent<FormProps & import('react').RefAttributes<any>>;
27
+ declare const Form: import('react').ForwardRefExoticComponent<FormProps & import('react').RefAttributes<FormHandle>>;
28
+ type Form = FormClassComponent;
29
29
  export { FieldArray, FieldArrayProps, FieldArrayRenderProps, Field, FieldProps, FieldRenderProps, Form, FormClassComponent, FormHandle, FormProps, FormRenderProps, FormValidatorType, FieldValidatorType, KeyValue, FieldWrapper, FieldWrapperProps, FormElement, FormElementHandle, FormElementProps, FormSubmitClickEvent, FormSeparator, FormSeparatorProps, FormSeparatorHandle, FormFieldSet, FormFieldSetProps, FormFieldSetHandle, ResponsiveFormBreakPoint, Gutters };
package/index.js CHANGED
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./Field.js"),e=require("./Form.js"),t=require("./FieldArray.js"),F=require("./FieldWrapper.js"),i=require("./FormElement.js"),m=require("@progress/kendo-react-common"),l=require("./FormSeparator.js"),a=require("./FormFieldSet.js"),r=m.withIdHOC(e.Form);r.displayName="KendoReactForm";exports.Field=o.Field;exports.FormClassComponent=e.Form;exports.FieldArray=t.FieldArray;exports.FieldWrapper=F.FieldWrapper;exports.FormElement=i.FormElement;exports.FormSeparator=l.FormSeparator;exports.FormFieldSet=a.FormFieldSet;exports.Form=r;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Field.js"),e=require("./Form.js"),o=require("./FieldArray.js"),F=require("./FieldWrapper.js"),t=require("./FormElement.js"),i=require("./FormSeparator.js"),m=require("./FormFieldSet.js"),l=require("./FormMcpWrapper.js"),a=l.FormWrapper;exports.Field=r.Field;exports.FormClassComponent=e.Form;exports.FieldArray=o.FieldArray;exports.FieldWrapper=F.FieldWrapper;exports.FormElement=t.FormElement;exports.FormSeparator=i.FormSeparator;exports.FormFieldSet=m.FormFieldSet;exports.Form=a;
package/index.mjs CHANGED
@@ -6,23 +6,22 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import { Field as a } from "./Field.mjs";
10
- import { Form as r } from "./Form.mjs";
11
- import { FieldArray as i } from "./FieldArray.mjs";
12
- import { FieldWrapper as l } from "./FieldWrapper.mjs";
13
- import { FormElement as s } from "./FormElement.mjs";
14
- import { withIdHOC as o } from "@progress/kendo-react-common";
9
+ import { Field as t } from "./Field.mjs";
10
+ import { Form as f } from "./Form.mjs";
11
+ import { FieldArray as a } from "./FieldArray.mjs";
12
+ import { FieldWrapper as i } from "./FieldWrapper.mjs";
13
+ import { FormElement as n } from "./FormElement.mjs";
15
14
  import { FormSeparator as C } from "./FormSeparator.mjs";
16
- import { FormFieldSet as y } from "./FormFieldSet.mjs";
17
- const m = o(r);
18
- m.displayName = "KendoReactForm";
15
+ import { FormFieldSet as W } from "./FormFieldSet.mjs";
16
+ import { FormWrapper as r } from "./FormMcpWrapper.mjs";
17
+ const e = r;
19
18
  export {
20
- a as Field,
21
- i as FieldArray,
22
- l as FieldWrapper,
23
- m as Form,
24
- r as FormClassComponent,
25
- s as FormElement,
26
- y as FormFieldSet,
19
+ t as Field,
20
+ a as FieldArray,
21
+ i as FieldWrapper,
22
+ e as Form,
23
+ f as FormClassComponent,
24
+ n as FormElement,
25
+ W as FormFieldSet,
27
26
  C as FormSeparator
28
27
  };
@@ -8,6 +8,7 @@
8
8
  import { FormRenderProps } from './FormRenderProps';
9
9
  import { FormValidatorType } from './FormValidator';
10
10
  import { FormSubmitClickEvent } from './FormSubmitClickEvent';
11
+ import { WebMcpProps } from '@progress/kendo-react-common';
11
12
  /**
12
13
  * Contains the props for the KendoReact Form component.
13
14
  */
@@ -128,6 +129,22 @@ export interface FormProps {
128
129
  * ```
129
130
  */
130
131
  ignoreModified?: boolean;
132
+ /**
133
+ * Enables browser-native AI agent tools via Web MCP (Chrome 146+).
134
+ *
135
+ * Pass `true` for defaults or an object for fine-grained control.
136
+ * AI agents are multilingual — `dataName` accepts any language.
137
+ *
138
+ * @example
139
+ * ```tsx
140
+ * // Boolean: generic "form" label
141
+ * <Form webMcp render={props => <FormElement>...</FormElement>} />
142
+ *
143
+ * // Config object: explicit name
144
+ * <Form webMcp={{ dataName: 'employee' }} render={props => <FormElement>...</FormElement>} />
145
+ * ```
146
+ */
147
+ webMcp?: boolean | WebMcpProps;
131
148
  /**
132
149
  * @hidden
133
150
  * This prop comes from the `withId` HOC and is used internally by the Form.
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-form",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1778599480,version:"14.5.0-develop.9",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-form",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1779253141,version:"15.0.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
7
7
  productName: 'KendoReact',
8
8
  productCode: 'KENDOUIREACT',
9
9
  productCodes: ['KENDOUIREACT'],
10
- publishDate: 1778599480,
11
- version: '14.5.0-develop.9',
10
+ publishDate: 1779253141,
11
+ version: '15.0.0-develop.2',
12
12
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
13
13
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-form",
3
- "version": "14.5.0-develop.9",
3
+ "version": "15.0.0-develop.2",
4
4
  "description": "React Form is a small and fast package for form state management with zero dependencies. KendoReact Form package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,7 +26,7 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.7.2",
29
- "@progress/kendo-react-common": "14.5.0-develop.9",
29
+ "@progress/kendo-react-common": "15.0.0-develop.2",
30
30
  "react": "^18.0.0 || ^19.0.0",
31
31
  "react-dom": "^18.0.0 || ^19.0.0"
32
32
  },
@@ -51,7 +51,7 @@
51
51
  "package": {
52
52
  "productName": "KendoReact",
53
53
  "productCode": "KENDOUIREACT",
54
- "publishDate": 1778599480,
54
+ "publishDate": 1779253141,
55
55
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
56
56
  }
57
57
  },