@progress/kendo-vue-form 3.4.2-dev.202207070519 → 3.4.3-dev.202207120901
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue"),require("@progress/kendo-licensing")):"function"==typeof define&&define.amd?define(["vue","@progress/kendo-licensing"],t):"object"==typeof exports?exports.KendoVueForm=t(require("vue"),require("@progress/kendo-licensing")):e.KendoVueForm=t(e.Vue,e.KendoLicensing)}(window,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t),n.d(t,"getRef",(function(){return a})),n.d(t,"setRef",(function(){return d})),n.d(t,"classNames",(function(){return o})),n.d(t,"guid",(function(){return i})),n.d(t,"Keys",(function(){return u})),n.d(t,"noop",(function(){return E})),n.d(t,"isObject",(function(){return r})),n.d(t,"getListeners",(function(){return L})),n.d(t,"hasListener",(function(){return I})),n.d(t,"canUseDOM",(function(){return s})),n.d(t,"focusFirstFocusableChild",(function(){return l})),n.d(t,"clone",(function(){return $})),n.d(t,"Draggable",(function(){return B})),n.d(t,"cloneArray",(function(){return A})),n.d(t,"cloneValue",(function(){return V})),n.d(t,"cloneObject",(function(){return M})),n.d(t,"cloneDate",(function(){return S})),n.d(t,"getTemplate",(function(){return W})),n.d(t,"templateRendering",(function(){return U})),n.d(t,"templateDefinition",(function(){return K})),n.d(t,"getTabIndex",(function(){return X})),n.d(t,"getDefaultSlots",(function(){return j})),n.d(t,"isRtl",(function(){return Y})),n.d(t,"getDir",(function(){return q})),n.d(t,"getter",(function(){return x})),n.d(t,"setter",(function(){return R})),n.d(t,"validatePackage",(function(){return J})),n.d(t,"kendoThemeMaps",(function(){return Q}));var r=function(e){return"object"==typeof e},o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return!0!==e&&!!e})).map((function(e){return Array.isArray(e)?o.apply(void 0,e):r(e)?Object.keys(e).map((function(t,n){return e[n]||e[t]&&t||null})).filter((function(e){return null!==e})).join(" "):e})).filter((function(e){return!!e})).join(" ")},i=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n},u={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},s=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function a(e,t,n){return e.v3?e[t+"Ref"]:e.$refs[""+(n||t)]}function d(e,t,n){return e.v3?function(n){e[t+"Ref"]=n}:n||t}var l=function(e){if(e){var t=e.querySelectorAll('input, [tabindex]:not([tabindex="-1"])');t.length&&t[0].focus&&t[0].focus()}},c=n(0),f=function(e,t){return function(n){return t(e(n))}},h=function(e,t,n){return e.addEventListener&&e.addEventListener(t,n)},m=function(e,t,n){return e&&e.removeEventListener&&e.removeEventListener(t,n)},p=function(){},v=function(e){return e.preventDefault()},y=/touch/;function g(e){return e.type.match(y)?{pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,type:e.type,originalEvent:e,isTouch:!0}:{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,type:e.type,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,originalEvent:e}}var F=function(e){var t=this,n=e.press;void 0===n&&(n=p);var r=e.drag;void 0===r&&(r=p);var o=e.release;void 0===o&&(o=p);var i=e.mouseOnly;void 0===i&&(i=!1),this._pressHandler=f(g,n),this._dragHandler=f(g,r),this._releaseHandler=f(g,o),this._ignoreMouse=!1,this._mouseOnly=i,this._touchstart=function(e){1===e.touches.length&&t._pressHandler(e)},this._touchmove=function(e){1===e.touches.length&&t._dragHandler(e)},this._touchend=function(e){0===e.touches.length&&1===e.changedTouches.length&&(t._releaseHandler(e),t._ignoreMouse=!0,setTimeout(t._restoreMouse,2e3))},this._restoreMouse=function(){t._ignoreMouse=!1},this._mousedown=function(e){var n=e.which;n&&n>1||t._ignoreMouse||(h(t.document,"mousemove",t._mousemove),h(t.document,"mouseup",t._mouseup),t._pressHandler(e))},this._mousemove=function(e){t._dragHandler(e)},this._mouseup=function(e){m(t.document,"mousemove",t._mousemove),m(t.document,"mouseup",t._mouseup),t._releaseHandler(e)},this._pointerdown=function(e){e.isPrimary&&0===e.button&&(h(t.document,"pointermove",t._pointermove),h(t.document,"pointerup",t._pointerup),h(t.document,"pointercancel",t._pointerup),h(t.document,"contextmenu",v),t._pressHandler(e))},this._pointermove=function(e){e.isPrimary&&t._dragHandler(e)},this._pointerup=function(e){e.isPrimary&&(m(t.document,"pointermove",t._pointermove),m(t.document,"pointerup",t._pointerup),m(t.document,"pointercancel",t._pointerup),m(t.document,"contextmenu",v),t._releaseHandler(e))}},b={document:{configurable:!0}};F.supportPointerEvent=function(){return"undefined"!=typeof window&&window.PointerEvent},b.document.get=function(){return this._element?this._element.ownerDocument:document},F.prototype.bindTo=function(e){e!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=e,this._bindToCurrent())},F.prototype._bindToCurrent=function(){var e=this._element;this._usePointers()?h(e,"pointerdown",this._pointerdown):(h(e,"mousedown",this._mousedown),this._mouseOnly||(h(e,"touchstart",this._touchstart),h(e,"touchmove",this._touchmove),h(e,"touchend",this._touchend)))},F.prototype._unbindFromCurrent=function(){var e=this._element;if(this._usePointers())return m(e,"pointerdown",this._pointerdown),m(this.document,"pointermove",this._pointermove),m(this.document,"pointerup",this._pointerup),m(this.document,"contextmenu",v),void m(this.document,"pointercancel",this._pointerup);m(e,"mousedown",this._mousedown),this._mouseOnly||(m(e,"touchstart",this._touchstart),m(e,"touchmove",this._touchmove),m(e,"touchend",this._touchend))},F.prototype._usePointers=function(){return!this._mouseOnly&&F.supportPointerEvent()},F.prototype.update=function(e){var t=e.press;void 0===t&&(t=p);var n=e.drag;void 0===n&&(n=p);var r=e.release;void 0===r&&(r=p);var o=e.mouseOnly;void 0===o&&(o=!1),this._pressHandler=f(g,t),this._dragHandler=f(g,n),this._releaseHandler=f(g,r),this._mouseOnly=o},F.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},Object.defineProperties(F.prototype,b),F.default=F;var O,_=F;function j(e){var t=e.$slots.default;return e.v3&&t&&"function"==typeof t?t():t}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=c,w=(P.h,"3"===P.version[0]),B=(k(O={emits:{press:null,drag:null,release:null},inheritAttrs:!1,created:function(){this.element=null,this.draggable=new _({press:this.press,drag:this.drag,release:this.release})},setup:w?function(){return{v3:!!w}}:void 0,mounted:function(){this.$el&&(this.element=3===this.$el.nodeType?this.$el.nextElementSibling:this.$el,this.draggable.bindTo(this.element))},destroyed:w?void 0:function(){this.draggable.destroy()},unmounted:function(){this.draggable.destroy()},methods:{press:function(e){this.element&&this.$emit("press",e,this.element)},drag:function(e){this.element&&this.$emit("drag",e,this.element)},release:function(e){this.element&&this.$emit("release",e,this.element)}}},"setup",w?function(){return{v3:!!w}}:void 0),k(O,"render",(function(e){return j(this)})),O),S=function(e){return e?new Date(e.getTime()):null};function $(e){var t={};return M(e,t),t}function M(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t[n]=V(r,t[n])}}function V(e,t){if(Array.isArray(e))return A(e);if(e instanceof Date)return S(e);if(e&&r(e)){var n=t||{};return M(e,n),n}return e}function A(e){return e.map((function(e){return V(e,void 0)}))}var E=function(){},T=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,C={};function x(e){if(C[e])return C[e];var t=[];return e.replace(T,(function(e,n,r,o){t.push(void 0!==n?n:r||o)})),C[e]=function(e){for(var n=e,r=0;r<t.length&&n;r++)n=n[t[r]];return n},C[e]}C.undefined=function(){};var D={};function R(e){if(D[e])return D[e];var t=[];return e.replace(T,(function(e,n,r,o){t.push(void 0!==n?n:r||o)})),D[e]=function(e,n){for(var r=e,o=t.length-1,i=0;i<o&&r;i++)r=r[t[i]]=r[t[i]]||{};r[t[o]]=n},D[e]}function I(e){return this.v3?Object.keys(this.$attrs).map((function(e){return e.toLowerCase()})).some((function(t){return t.endsWith(e.toLowerCase())})):this.$listeners[e]}function L(){if(this.v3){var e={};for(var t in this.$attrs)t.startsWith("on")&&(e[t]=this.$attrs[t]);return e}return this.$listeners}D.undefined=function(e){return e};var H=function(){return(H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},N="3"===c.version[0],K={type:[String,Function,Object,Boolean],default:function(){}};function U(e,t){if(e||!1===e){var n=N?this.$slots[e]||(e.toLowerCase?this.$slots[e.toLowerCase()]:null):this.$scopedSlots[e]||(e.toLowerCase?this.$scopedSlots[e.toLowerCase()]:null);return"string"==typeof e&&n?{kt:!0,type:"slot",render:n,listeners:t}:"string"==typeof e||r(e)||"function"==typeof e&&e.component?{kt:!0,type:"component",render:e,listeners:t}:{kt:!0,type:"renderFunction",render:e,listeners:t}}}function W(e){var t,n,r,o=e.h,i=e.template,u=e.defaultRendering,s=e.defaultSlots,a=e.additionalProps,d=e.additionalListeners,l=e.swapDefaultSlots;if(!i||i&&!0===i.render)return u;if(N){var c=u?u.props:{};t=H(H({},G(d)),i.listeners),n=H(H(H({},c),a),t),r=H(H({},n),t)}else{var f=u&&u.componentOptions,h=f?u.componentOptions.listeners:{},m=f?u.componentOptions.propsData:{};t=H(H(H(H({},h),d),G(d)),i.listeners),r={props:n=H(H(H({},m),a),t),on:t}}if("slot"===i.type){var p=i.render({props:n,listeners:t,methods:t,defaultSlots:s});return p?p[0]:void 0}return"renderFunction"===i.type?l?i.render?i.render(o,u,s,n,t):void 0:i.render?i.render(o,u,n,t,s):void 0:o(i.render,r,N?function(){return[s]}:[s])}function G(e){if(!e)return e;for(var t={},n=Object.keys(e),r=0;r<n.length;r++){var o=n[r];t["on"+o.charAt(0).toUpperCase()+o.slice(1)]=e[o]}return t}var X=function(e,t,n){var r="string"==typeof e?parseInt(e,void 0):e;if(NaN!==r)return void 0!==r?r:t?n?void 0:-1:0};function Y(e){return Boolean(s&&e&&"rtl"===getComputedStyle(e).direction)}function q(e,t){if(!t&&s&&e){var n=window.getComputedStyle(e).direction;if(n)return n}return t}var z=n(3);function J(e){if(void 0!==z)z.validatePackage(e);else{var t="License activation failed for "+e.name+"\n";t+="The @progress/kendo-licensing script is not loaded.\n",t+="See "+e.licensingDocsUrl+" for more information.\n",console.warn(t)}}var Q={sizeMap:{small:"sm",medium:"md",large:"lg"},roundedMap:{small:"sm",medium:"md",large:"lg"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata=void 0,t.packageMetadata={name:"@progress/kendo-vue-form",productName:"Kendo UI for Vue",productCodes:["KENDOUIVUE","KENDOUICOMPLETE"],publishDate:1657170914,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"}},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormElementVue2=t.FormElement=t.FieldWrapperVue2=t.FieldWrapper=t.FormVue2=t.Form=t.FieldVue2=t.Field=t.FieldArrayVue2=t.FieldArray=void 0;var r=n(5);Object.defineProperty(t,"Field",{enumerable:!0,get:function(){return r.Field}}),Object.defineProperty(t,"FieldVue2",{enumerable:!0,get:function(){return r.FieldVue2}});var o=n(6);Object.defineProperty(t,"Form",{enumerable:!0,get:function(){return o.Form}}),Object.defineProperty(t,"FormVue2",{enumerable:!0,get:function(){return o.FormVue2}});var i=n(7);Object.defineProperty(t,"FieldArray",{enumerable:!0,get:function(){return i.FieldArray}}),Object.defineProperty(t,"FieldArrayVue2",{enumerable:!0,get:function(){return i.FieldArrayVue2}});var u=n(8);Object.defineProperty(t,"FieldWrapper",{enumerable:!0,get:function(){return u.FieldWrapper}}),Object.defineProperty(t,"FieldWrapperVue2",{enumerable:!0,get:function(){return u.FieldWrapperVue2}});var s=n(9);Object.defineProperty(t,"FormElement",{enumerable:!0,get:function(){return s.FormElement}}),Object.defineProperty(t,"FormElementVue2",{enumerable:!0,get:function(){return s.FormElementVue2}})},function(e,t,n){"use strict";var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.FieldVue2=t.Field=void 0;var a=u(n(0)),d=a.h,l="3"===a.version[0],c=n(1),f={name:"KendoField",props:{component:[String,Number,Boolean,Object],validator:[Function,Array],name:String,changeOnInput:{type:Boolean,default:!0}},created:function(){if(this.kendoForm)return this.kendoForm.registerField(this.$props.name,this.$props.validator)},inject:{kendoForm:{default:null}},methods:{handleOnChange:function(e){var t=e?void 0!==e.value?e.value:e.target?e.target.value:e.target:e;this.kendoForm.onChange(this.$props.name,{value:t}),this.$emit("change",e)},handleOnInput:function(e){var t=e?void 0!==e.value?e.value:e.target?e.target.value:e.target:e;this.changeOnInput&&this.kendoForm.onChange(this.$props.name,{value:t}),this.$emit("input",e)},onNativeComponentChange:function(e){this.kendoForm.onChange(this.$props.name,{value:e.target.value})},handleOnBlur:function(){this.kendoForm.onBlur(this.$props.name)},handleOnFocus:function(){this.kendoForm.onFocus(this.$props.name)}},setup:l?function(){return{v3:!!l}}:void 0,render:function(e){var t=d||e,n=c.getDefaultSlots(this),o=this.$props,i=o.name,u=o.component,a=(o.validator,o.id);s(o,["name","component","validator","id"]);if(!this.kendoForm)return null;var l=this.kendoForm.values[i];if("string"==typeof u&&"input"===u)return t(u,r(r({attrs:this.$attrs},this.$attrs),{onChange:this.onNativeComponentChange,onBlur:this.handleOnBlur,onFocus:this.handleOnFocus,on:this.v3?void 0:{change:this.handleOnChange,blur:this.handleOnBlur,focus:this.handleOnFocus},domProps:this.v3?void 0:{value:l||""},name:i,value:l||""}));if(u){var f=u?u.kt?u:c.templateRendering.call(this,u,c.getListeners.call(this)):null;return c.getTemplate.call(this,{h:t,template:f,additionalProps:r({value:l,validationMessage:this.kendoForm.errors[i],touched:this.kendoForm.touchedByField[i],modified:this.kendoForm.modifiedByField[i],visited:this.kendoForm.visitedByField[i],valid:!(Boolean(this.kendoForm.errors[i])&&this.kendoForm.touchedByField[i]),name:i,id:a},this.$attrs),additionalListeners:{change:this.handleOnChange,input:this.handleOnInput,blur:this.handleOnBlur,focus:this.handleOnFocus},defaultSlots:n})}}};t.FieldVue2=f;var h=f;t.Field=h},function(e,t,n){"use strict";var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],u=0,s=i.length;u<s;u++,o++)r[o]=i[u];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.FormVue2=t.Form=void 0;var a=n(1),d=n(2),l=u(n(0)),c=(l.h,"3"===l.version[0]),f=n(1),h={name:"KendoForm",inheritAttrs:!1,props:{renderForm:[Object,Function],initialValues:Object,validator:Function,ignoreModified:Boolean},emits:{submitclick:null,submit:null},created:function(){this._accumulatorTimeout=void 0,a.validatePackage(d.packageMetadata),this.form.values=a.clone(this.$props.initialValues)},mounted:function(){this.form.errors=this.getErrors(),this.form.allowSubmit=this.allowSubmit(),this.form.valid=this.isValid()},destroyed:c?void 0:function(){this.onDestroy()},unmounted:function(){this.onDestroy()},data:function(){return{validatorsByField:{},fields:[],unmounted:!1,form:{id:this.id,errors:{},values:{},modifiedByField:{},touchedByField:{},visitedByField:{},valid:!1,modified:!1,touched:!1,visited:!1,submitted:!1,valueGetter:this.valueGetter,allowSubmit:!1,onChange:this.onChange,onSubmit:this.onSubmit,onFormReset:this.resetForm,registerField:this.onFieldRegister,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}}},provide:function(){return{kendoForm:this.$data.form}},watch:{"form.values":function(){this.form.errors=this.getErrors(),this.form.allowSubmit=this.allowSubmit(),this.form.valid=this.isValid()},"form.touchedByField":function(e){this.form.touched=this.isFormTouched(e,this.fields),this.form.allowSubmit=this.allowSubmit()},"form.modifiedByField":function(e){this.form.modified=this.isFormModified(e,this.fields),this.form.allowSubmit=this.allowSubmit()},"form.visitedByField":function(e){this.form.visited=this.isFormVisited(e,this.fields)}},methods:{isValid:function(){return this.isFormValid(this.form.errors)},formErrors:function(){if(this.$props.validator)return this.$props.validator(this.form.values,this.valueGetter)},getErrors:function(){var e=this,t={},n=this.validatorsByField;return Object.keys(this.fields).forEach((function(r){if(t[r]="",n[r]){var o=[];n[r].forEach((function(e){Array.isArray(e)?o.push.apply(o,e):o.push(e)})),o.find((function(n){if(n){var o=n(e.valueGetter(r),e.valueGetter,{name:r});if(o)return t[r]=o,!0}return!1}))}})),this.formErrors()&&a.cloneObject(this.formErrors(),t),t},accumulatedForceUpdate:function(){var e=this;this._accumulatorTimeout&&clearTimeout(this._accumulatorTimeout),this._accumulatorTimeout=window.setTimeout((function(){e._accumulatorTimeout=void 0}),0)},resetForm:function(){this.form.values=a.clone(this.$props.initialValues),this.id=a.guid(),this.form.touchedByField={},this.form.visitedByField={},this.form.modifiedByField={},this.form.submitted=!1},onReset:function(){this.resetForm()},addField:function(e){this.fields[e]=!0},onSubmit:function(e){var t={},n=this.fields;e&&("function"==typeof e.preventDefault&&e.preventDefault(),"function"==typeof e.stopPropagation&&e.stopPropagation()),Object.keys(n).forEach((function(e){t[e]=!0})),this.form.visitedByField=r({},t),this.form.touchedByField=r({},t);var o=this.form.values,i=this.isValid(),u=this.isFormModified(this.form.modifiedByField,n);this.$emit("submitclick",{values:o,isValid:i,isModified:u,event:e}),i&&(this.$props.ignoreModified||u)&&(this.form.submitted=!0,this.$emit("submit",o,e))},onChange:function(e,t){var n,o=t.value;this.addField(e),this.form.modifiedByField[e]||(this.form.modifiedByField=r(r({},this.form.modifiedByField),((n={})[e]=!0,n))),this.valueSetter(e,o)},onFocus:function(e){var t;this.form.visitedByField[e]||(this.form.visitedByField=r(r({},this.form.visitedByField),((t={})[e]=!0,t)))},onBlur:function(e){var t;this.form.touchedByField[e]||(this.onFocus(e),this.form.touchedByField=r(r({},this.form.touchedByField),((t={})[e]=!0,t)))},onFieldRegister:function(e,t){var n,o=this;this.addField(e);var i=this.validatorsByField[e]||[],u=i.length;return this.validatorsByField=r(r({},this.validatorsByField),((n={})[e]=s(i,[t]),n)),this.accumulatedForceUpdate(),function(){var t;if(!o._unmounted){var n=s(o.validatorsByField[e]||[]),i=Boolean(n[u]);n[u]=void 0,o.validatorsByField=r(r({},o.validatorsByField),((t={})[e]=n,t)),i&&o.accumulatedForceUpdate()}}},isFormValid:function(e){return!Object.keys(e).some((function(t){return Boolean(e[t])}))},isFormModified:function(e,t){return Object.keys(t).some((function(t){return e[t]}))},isFormHasNotTouched:function(e,t){return Object.keys(t).some((function(t){return!e[t]}))},isFormTouched:function(e,t){return Object.keys(t).some((function(t){return e[t]}))},isFormVisited:function(e,t){return Object.keys(t).some((function(t){return e[t]}))},formHasNotTouched:function(){return this.isFormHasNotTouched(this.form.touchedByField,this.fields)},allowSubmit:function(){return this.formHasNotTouched()&&!this.isValid()||this.isValid()&&(this.$props.ignoreModified||this.isFormModified(this.form.modifiedByField,this.fields))},valueGetter:function(e){return this.form.values[e]},valueSetter:function(e,t){var n;this.form.values=r(r({},this.form.values),((n={})[e]=t,n))},onArrayAction:function(e){var t;this.addField(e),this.form.modifiedByField[e]||(this.form.modifiedByField=r(r({},this.form.modifiedByField),((t={})[e]=!0,t))),this.onBlur(e,!0)},onInsert:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[]);n.splice(t.index,0,t.value),this.valueSetter(e,n)},onUnshift:function(e,t){this.onInsert(e,{value:t.value,index:0})},onPush:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[],[t.value]);this.valueSetter(e,n)},onPop:function(e){this.onArrayAction(e);var t=s(this.valueGetter(e)||[]),n=t.pop();return this.valueSetter(e,t),n},onRemove:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[]),r=n.splice(t.index,1);return this.valueSetter(e,n),r},onReplace:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[]);n.splice(t.index,1,t.value),this.valueSetter(e,n)},onMove:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[]),r=n[t.prevIndex];n.splice(t.prevIndex,1),n.splice(t.nextIndex,0,r),this.valueSetter(e,n)},onDestroy:function(){this.unmounted=!0,this._accumulatorTimeout&&clearTimeout(this._accumulatorTimeout)}},setup:c?function(){return{v3:!!c}}:void 0,render:function(e){return f.getDefaultSlots(this)}};t.FormVue2=h;var m=h;t.Form=m},function(e,t,n){"use strict";var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.FieldArrayVue2=t.FieldArray=void 0;var s=u(n(0)),a=s.h,d="3"===s.version[0],l=n(1),c={name:"KendoFieldArray",props:{value:[String,Number,Boolean,Object,Array],component:[String,Number,Boolean,Object],validationMessage:String,touched:Boolean,modified:Boolean,validator:[Function,Array],visited:Boolean,valid:Boolean,name:String,id:String},created:function(){if(this.kendoForm)return this.kendoForm.registerField(this.$props.name,this.$props.validator)},methods:{onUnshift:function(e){this.kendoForm.onUnshift(this.$props.name,e)},onPush:function(e){this.kendoForm.onPush(this.$props.name,e)},onInsert:function(e){this.kendoForm.onInsert(this.$props.name,e)},onPop:function(){this.kendoForm.onPop(this.$props.name)},onRemove:function(e){this.kendoForm.onRemove(this.$props.name,e)},onReplace:function(e){this.kendoForm.onReplace(this.$props.name,e)},onMove:function(e){this.kendoForm.onMove(this.$props.name,e)}},setup:d?function(){return{v3:!!d}}:void 0,inject:{kendoForm:{default:null}},render:function(e){var t=a||e,n=this.$props,o=n.name,i=n.component,u=n.id;if(!this.kendoForm)return null;var s=this.kendoForm.values[o];if(i){var d=i?l.templateRendering.call(this,i,l.getListeners.call(this)):null;return l.getTemplate.call(this,{h:t,template:d,additionalProps:r({value:s,validationMessage:this.kendoForm.errors[o],touched:this.kendoForm.touchedByField[o],modified:this.kendoForm.modifiedByField[o],visited:this.kendoForm.visitedByField[o],valid:!(Boolean(this.kendoForm.errors[o])&&this.kendoForm.touchedByField[o]),name:o,id:u},this.$attrs),additionalListeners:{unshift:this.onUnshift,push:this.onPush,insert:this.onInsert,pop:this.onPop,remove:this.onRemove,replace:this.onReplace,move:this.onMove}})}}};t.FieldArrayVue2=c;var f=c;t.FieldArray=f},function(e,t,n){"use strict";var r=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},o=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.FieldWrapperVue2=t.FieldWrapper=void 0;var u=i(n(0)),s=u.h,a="3"===u.version[0],d=n(2),l=n(1),c={name:"KendoFieldWrapper",props:{dir:String},created:function(){l.validatePackage(d.packageMetadata)},computed:{fieldClassName:function(){return{"k-form-field":!0,"k-rtl":"rtl"===this.$props.dir}}},setup:a?function(){return{v3:!!a}}:void 0,render:function(e){var t=s||e,n=l.getDefaultSlots(this);return t("div",{class:this.fieldClassName},[n])}};t.FieldWrapperVue2=c;var f=c;t.FieldWrapper=f},function(e,t,n){"use strict";var r=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},o=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.FormElementVue2=t.FormElement=void 0;var u=i(n(0)),s=u.h,a="3"===u.version[0],d=n(2),l=n(1),c={name:"KendoFormElement",props:{horizontal:Boolean},created:function(){l.validatePackage(d.packageMetadata)},inject:{kendoForm:{default:null}},computed:{formElementClassName:function(){return{"k-form":!0,"k-form-horizontal":!0===this.$props.horizontal}}},methods:{handleSubmit:function(e){this.kendoForm&&this.kendoForm.onSubmit(e)}},setup:a?function(){return{v3:!!a}}:void 0,render:function(e){var t=s||e,n=l.getDefaultSlots(this);return t("form",{class:this.formElementClassName,onSubmit:this.handleSubmit,on:this.v3?void 0:{submit:this.handleSubmit}},[n])}};t.FormElementVue2=c;var f=c;t.FormElement=f}])}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue"),require("@progress/kendo-licensing")):"function"==typeof define&&define.amd?define(["vue","@progress/kendo-licensing"],t):"object"==typeof exports?exports.KendoVueForm=t(require("vue"),require("@progress/kendo-licensing")):e.KendoVueForm=t(e.Vue,e.KendoLicensing)}(window,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t),n.d(t,"getRef",(function(){return a})),n.d(t,"setRef",(function(){return d})),n.d(t,"classNames",(function(){return o})),n.d(t,"guid",(function(){return i})),n.d(t,"Keys",(function(){return u})),n.d(t,"noop",(function(){return E})),n.d(t,"isObject",(function(){return r})),n.d(t,"getListeners",(function(){return L})),n.d(t,"hasListener",(function(){return I})),n.d(t,"canUseDOM",(function(){return s})),n.d(t,"focusFirstFocusableChild",(function(){return l})),n.d(t,"clone",(function(){return $})),n.d(t,"Draggable",(function(){return B})),n.d(t,"cloneArray",(function(){return A})),n.d(t,"cloneValue",(function(){return V})),n.d(t,"cloneObject",(function(){return M})),n.d(t,"cloneDate",(function(){return S})),n.d(t,"getTemplate",(function(){return W})),n.d(t,"templateRendering",(function(){return U})),n.d(t,"templateDefinition",(function(){return K})),n.d(t,"getTabIndex",(function(){return X})),n.d(t,"getDefaultSlots",(function(){return j})),n.d(t,"isRtl",(function(){return Y})),n.d(t,"getDir",(function(){return q})),n.d(t,"getter",(function(){return x})),n.d(t,"setter",(function(){return R})),n.d(t,"validatePackage",(function(){return J})),n.d(t,"kendoThemeMaps",(function(){return Q}));var r=function(e){return"object"==typeof e},o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return!0!==e&&!!e})).map((function(e){return Array.isArray(e)?o.apply(void 0,e):r(e)?Object.keys(e).map((function(t,n){return e[n]||e[t]&&t||null})).filter((function(e){return null!==e})).join(" "):e})).filter((function(e){return!!e})).join(" ")},i=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n},u={backspace:8,tab:9,enter:13,shift:16,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,delete:46},s=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function a(e,t,n){return e.v3?e[t+"Ref"]:e.$refs[""+(n||t)]}function d(e,t,n){return e.v3?function(n){e[t+"Ref"]=n}:n||t}var l=function(e){if(e){var t=e.querySelectorAll('input, [tabindex]:not([tabindex="-1"])');t.length&&t[0].focus&&t[0].focus()}},c=n(0),f=function(e,t){return function(n){return t(e(n))}},h=function(e,t,n){return e.addEventListener&&e.addEventListener(t,n)},m=function(e,t,n){return e&&e.removeEventListener&&e.removeEventListener(t,n)},p=function(){},v=function(e){return e.preventDefault()},y=/touch/;function g(e){return e.type.match(y)?{pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,type:e.type,originalEvent:e,isTouch:!0}:{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,type:e.type,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,originalEvent:e}}var F=function(e){var t=this,n=e.press;void 0===n&&(n=p);var r=e.drag;void 0===r&&(r=p);var o=e.release;void 0===o&&(o=p);var i=e.mouseOnly;void 0===i&&(i=!1),this._pressHandler=f(g,n),this._dragHandler=f(g,r),this._releaseHandler=f(g,o),this._ignoreMouse=!1,this._mouseOnly=i,this._touchstart=function(e){1===e.touches.length&&t._pressHandler(e)},this._touchmove=function(e){1===e.touches.length&&t._dragHandler(e)},this._touchend=function(e){0===e.touches.length&&1===e.changedTouches.length&&(t._releaseHandler(e),t._ignoreMouse=!0,setTimeout(t._restoreMouse,2e3))},this._restoreMouse=function(){t._ignoreMouse=!1},this._mousedown=function(e){var n=e.which;n&&n>1||t._ignoreMouse||(h(t.document,"mousemove",t._mousemove),h(t.document,"mouseup",t._mouseup),t._pressHandler(e))},this._mousemove=function(e){t._dragHandler(e)},this._mouseup=function(e){m(t.document,"mousemove",t._mousemove),m(t.document,"mouseup",t._mouseup),t._releaseHandler(e)},this._pointerdown=function(e){e.isPrimary&&0===e.button&&(h(t.document,"pointermove",t._pointermove),h(t.document,"pointerup",t._pointerup),h(t.document,"pointercancel",t._pointerup),h(t.document,"contextmenu",v),t._pressHandler(e))},this._pointermove=function(e){e.isPrimary&&t._dragHandler(e)},this._pointerup=function(e){e.isPrimary&&(m(t.document,"pointermove",t._pointermove),m(t.document,"pointerup",t._pointerup),m(t.document,"pointercancel",t._pointerup),m(t.document,"contextmenu",v),t._releaseHandler(e))}},b={document:{configurable:!0}};F.supportPointerEvent=function(){return"undefined"!=typeof window&&window.PointerEvent},b.document.get=function(){return this._element?this._element.ownerDocument:document},F.prototype.bindTo=function(e){e!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=e,this._bindToCurrent())},F.prototype._bindToCurrent=function(){var e=this._element;this._usePointers()?h(e,"pointerdown",this._pointerdown):(h(e,"mousedown",this._mousedown),this._mouseOnly||(h(e,"touchstart",this._touchstart),h(e,"touchmove",this._touchmove),h(e,"touchend",this._touchend)))},F.prototype._unbindFromCurrent=function(){var e=this._element;if(this._usePointers())return m(e,"pointerdown",this._pointerdown),m(this.document,"pointermove",this._pointermove),m(this.document,"pointerup",this._pointerup),m(this.document,"contextmenu",v),void m(this.document,"pointercancel",this._pointerup);m(e,"mousedown",this._mousedown),this._mouseOnly||(m(e,"touchstart",this._touchstart),m(e,"touchmove",this._touchmove),m(e,"touchend",this._touchend))},F.prototype._usePointers=function(){return!this._mouseOnly&&F.supportPointerEvent()},F.prototype.update=function(e){var t=e.press;void 0===t&&(t=p);var n=e.drag;void 0===n&&(n=p);var r=e.release;void 0===r&&(r=p);var o=e.mouseOnly;void 0===o&&(o=!1),this._pressHandler=f(g,t),this._dragHandler=f(g,n),this._releaseHandler=f(g,r),this._mouseOnly=o},F.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},Object.defineProperties(F.prototype,b),F.default=F;var O,_=F;function j(e){var t=e.$slots.default;return e.v3&&t&&"function"==typeof t?t():t}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=c,w=(P.h,"3"===P.version[0]),B=(k(O={emits:{press:null,drag:null,release:null},inheritAttrs:!1,created:function(){this.element=null,this.draggable=new _({press:this.press,drag:this.drag,release:this.release})},setup:w?function(){return{v3:!!w}}:void 0,mounted:function(){this.$el&&(this.element=3===this.$el.nodeType?this.$el.nextElementSibling:this.$el,this.draggable.bindTo(this.element))},destroyed:w?void 0:function(){this.draggable.destroy()},unmounted:function(){this.draggable.destroy()},methods:{press:function(e){this.element&&this.$emit("press",e,this.element)},drag:function(e){this.element&&this.$emit("drag",e,this.element)},release:function(e){this.element&&this.$emit("release",e,this.element)}}},"setup",w?function(){return{v3:!!w}}:void 0),k(O,"render",(function(e){return j(this)})),O),S=function(e){return e?new Date(e.getTime()):null};function $(e){var t={};return M(e,t),t}function M(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t[n]=V(r,t[n])}}function V(e,t){if(Array.isArray(e))return A(e);if(e instanceof Date)return S(e);if(e&&r(e)){var n=t||{};return M(e,n),n}return e}function A(e){return e.map((function(e){return V(e,void 0)}))}var E=function(){},T=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,C={};function x(e){if(C[e])return C[e];var t=[];return e.replace(T,(function(e,n,r,o){t.push(void 0!==n?n:r||o)})),C[e]=function(e){for(var n=e,r=0;r<t.length&&n;r++)n=n[t[r]];return n},C[e]}C.undefined=function(){};var D={};function R(e){if(D[e])return D[e];var t=[];return e.replace(T,(function(e,n,r,o){t.push(void 0!==n?n:r||o)})),D[e]=function(e,n){for(var r=e,o=t.length-1,i=0;i<o&&r;i++)r=r[t[i]]=r[t[i]]||{};r[t[o]]=n},D[e]}function I(e){return this.v3?Object.keys(this.$attrs).map((function(e){return e.toLowerCase()})).some((function(t){return t.endsWith(e.toLowerCase())})):this.$listeners[e]}function L(){if(this.v3){var e={};for(var t in this.$attrs)t.startsWith("on")&&(e[t]=this.$attrs[t]);return e}return this.$listeners}D.undefined=function(e){return e};var H=function(){return(H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},N="3"===c.version[0],K={type:[String,Function,Object,Boolean],default:function(){}};function U(e,t){if(e||!1===e){var n=N?this.$slots[e]||(e.toLowerCase?this.$slots[e.toLowerCase()]:null):this.$scopedSlots[e]||(e.toLowerCase?this.$scopedSlots[e.toLowerCase()]:null);return"string"==typeof e&&n?{kt:!0,type:"slot",render:n,listeners:t}:"string"==typeof e||r(e)||"function"==typeof e&&e.component?{kt:!0,type:"component",render:e,listeners:t}:{kt:!0,type:"renderFunction",render:e,listeners:t}}}function W(e){var t,n,r,o=e.h,i=e.template,u=e.defaultRendering,s=e.defaultSlots,a=e.additionalProps,d=e.additionalListeners,l=e.swapDefaultSlots;if(!i||i&&!0===i.render)return u;if(N){var c=u?u.props:{};t=H(H({},G(d)),i.listeners),n=H(H(H({},c),a),t),r=H(H({},n),t)}else{var f=u&&u.componentOptions,h=f?u.componentOptions.listeners:{},m=f?u.componentOptions.propsData:{};t=H(H(H(H({},h),d),G(d)),i.listeners),r={props:n=H(H(H({},m),a),t),on:t}}if("slot"===i.type){var p=i.render({props:n,listeners:t,methods:t,defaultSlots:s});return p?p[0]:void 0}return"renderFunction"===i.type?l?i.render?i.render(o,u,s,n,t):void 0:i.render?i.render(o,u,n,t,s):void 0:o(i.render,r,N?function(){return[s]}:[s])}function G(e){if(!e)return e;for(var t={},n=Object.keys(e),r=0;r<n.length;r++){var o=n[r];t["on"+o.charAt(0).toUpperCase()+o.slice(1)]=e[o]}return t}var X=function(e,t,n){var r="string"==typeof e?parseInt(e,void 0):e;if(NaN!==r)return void 0!==r?r:t?n?void 0:-1:0};function Y(e){return Boolean(s&&e&&"rtl"===getComputedStyle(e).direction)}function q(e,t){if(!t&&s&&e){var n=window.getComputedStyle(e).direction;if(n)return n}return t}var z=n(3);function J(e){if(void 0!==z)z.validatePackage(e);else{var t="License activation failed for "+e.name+"\n";t+="The @progress/kendo-licensing script is not loaded.\n",t+="See "+e.licensingDocsUrl+" for more information.\n",console.warn(t)}}var Q={sizeMap:{small:"sm",medium:"md",large:"lg"},roundedMap:{small:"sm",medium:"md",large:"lg"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata=void 0,t.packageMetadata={name:"@progress/kendo-vue-form",productName:"Kendo UI for Vue",productCodes:["KENDOUIVUE","KENDOUICOMPLETE"],publishDate:1657616220,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"}},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FormElementVue2=t.FormElement=t.FieldWrapperVue2=t.FieldWrapper=t.FormVue2=t.Form=t.FieldVue2=t.Field=t.FieldArrayVue2=t.FieldArray=void 0;var r=n(5);Object.defineProperty(t,"Field",{enumerable:!0,get:function(){return r.Field}}),Object.defineProperty(t,"FieldVue2",{enumerable:!0,get:function(){return r.FieldVue2}});var o=n(6);Object.defineProperty(t,"Form",{enumerable:!0,get:function(){return o.Form}}),Object.defineProperty(t,"FormVue2",{enumerable:!0,get:function(){return o.FormVue2}});var i=n(7);Object.defineProperty(t,"FieldArray",{enumerable:!0,get:function(){return i.FieldArray}}),Object.defineProperty(t,"FieldArrayVue2",{enumerable:!0,get:function(){return i.FieldArrayVue2}});var u=n(8);Object.defineProperty(t,"FieldWrapper",{enumerable:!0,get:function(){return u.FieldWrapper}}),Object.defineProperty(t,"FieldWrapperVue2",{enumerable:!0,get:function(){return u.FieldWrapperVue2}});var s=n(9);Object.defineProperty(t,"FormElement",{enumerable:!0,get:function(){return s.FormElement}}),Object.defineProperty(t,"FormElementVue2",{enumerable:!0,get:function(){return s.FormElementVue2}})},function(e,t,n){"use strict";var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.FieldVue2=t.Field=void 0;var a=u(n(0)),d=a.h,l="3"===a.version[0],c=n(1),f={name:"KendoField",props:{component:[String,Number,Boolean,Object],validator:[Function,Array],name:String,changeOnInput:{type:Boolean,default:!0}},created:function(){if(this.kendoForm)return this.kendoForm.registerField(this.$props.name,this.$props.validator)},inject:{kendoForm:{default:null}},methods:{handleOnChange:function(e){var t=e?void 0!==e.value?e.value:e.target?e.target.value:e.target:e;this.kendoForm.onChange(this.$props.name,{value:t}),this.$emit("change",e)},handleOnInput:function(e){var t=e?void 0!==e.value?e.value:e.target?e.target.value:e.target:e;this.changeOnInput&&this.kendoForm.onChange(this.$props.name,{value:t}),this.$emit("input",e)},onNativeComponentChange:function(e){this.kendoForm.onChange(this.$props.name,{value:e.target.value})},handleOnBlur:function(){this.kendoForm.onBlur(this.$props.name)},handleOnFocus:function(){this.kendoForm.onFocus(this.$props.name)}},setup:l?function(){return{v3:!!l}}:void 0,render:function(e){var t=d||e,n=c.getDefaultSlots(this),o=this.$props,i=o.name,u=o.component,a=(o.validator,o.id);s(o,["name","component","validator","id"]);if(!this.kendoForm)return null;var l=this.kendoForm.values[i];if("string"==typeof u&&"input"===u)return t(u,r(r({attrs:this.$attrs},this.$attrs),{onChange:this.onNativeComponentChange,onBlur:this.handleOnBlur,onFocus:this.handleOnFocus,on:this.v3?void 0:{change:this.handleOnChange,blur:this.handleOnBlur,focus:this.handleOnFocus},domProps:this.v3?void 0:{value:l||""},name:i,value:l||""}));if(u){var f=u?u.kt?u:c.templateRendering.call(this,u,c.getListeners.call(this)):null;return c.getTemplate.call(this,{h:t,template:f,additionalProps:r({value:l,validationMessage:this.kendoForm.errors[i],touched:this.kendoForm.touchedByField[i],modified:this.kendoForm.modifiedByField[i],visited:this.kendoForm.visitedByField[i],valid:!(Boolean(this.kendoForm.errors[i])&&this.kendoForm.touchedByField[i]),name:i,id:a},this.$attrs),additionalListeners:{change:this.handleOnChange,input:this.handleOnInput,blur:this.handleOnBlur,focus:this.handleOnFocus},defaultSlots:n})}}};t.FieldVue2=f;var h=f;t.Field=h},function(e,t,n){"use strict";var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t},s=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],u=0,s=i.length;u<s;u++,o++)r[o]=i[u];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.FormVue2=t.Form=void 0;var a=n(1),d=n(2),l=u(n(0)),c=(l.h,"3"===l.version[0]),f=n(1),h={name:"KendoForm",inheritAttrs:!1,props:{renderForm:[Object,Function],initialValues:Object,validator:Function,ignoreModified:Boolean},emits:{submitclick:null,submit:null},created:function(){this._accumulatorTimeout=void 0,a.validatePackage(d.packageMetadata),this.form.values=a.clone(this.$props.initialValues)},mounted:function(){this.form.errors=this.getErrors(),this.form.allowSubmit=this.allowSubmit(),this.form.valid=this.isValid()},destroyed:c?void 0:function(){this.onDestroy()},unmounted:function(){this.onDestroy()},data:function(){return{validatorsByField:{},fields:[],unmounted:!1,form:{id:this.id,errors:{},values:{},modifiedByField:{},touchedByField:{},visitedByField:{},valid:!1,modified:!1,touched:!1,visited:!1,submitted:!1,valueGetter:this.valueGetter,allowSubmit:!1,onChange:this.onChange,onSubmit:this.onSubmit,onFormReset:this.resetForm,registerField:this.onFieldRegister,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}}},provide:function(){return{kendoForm:this.$data.form}},watch:{"form.values":function(){this.form.errors=this.getErrors(),this.form.allowSubmit=this.allowSubmit(),this.form.valid=this.isValid()},"form.touchedByField":function(e){this.form.touched=this.isFormTouched(e,this.fields),this.form.allowSubmit=this.allowSubmit()},"form.modifiedByField":function(e){this.form.modified=this.isFormModified(e,this.fields),this.form.allowSubmit=this.allowSubmit()},"form.visitedByField":function(e){this.form.visited=this.isFormVisited(e,this.fields)}},methods:{isValid:function(){return this.isFormValid(this.form.errors)},formErrors:function(){if(this.$props.validator)return this.$props.validator(this.form.values,this.valueGetter)},getErrors:function(){var e=this,t={},n=this.validatorsByField;return Object.keys(this.fields).forEach((function(r){if(t[r]="",n[r]){var o=[];n[r].forEach((function(e){Array.isArray(e)?o.push.apply(o,e):o.push(e)})),o.find((function(n){if(n){var o=n(e.valueGetter(r),e.valueGetter,{name:r});if(o)return t[r]=o,!0}return!1}))}})),this.formErrors()&&a.cloneObject(this.formErrors(),t),t},accumulatedForceUpdate:function(){var e=this;this._accumulatorTimeout&&clearTimeout(this._accumulatorTimeout),this._accumulatorTimeout=window.setTimeout((function(){e._accumulatorTimeout=void 0}),0)},resetForm:function(){this.form.values=a.clone(this.$props.initialValues),this.id=a.guid(),this.form.touchedByField={},this.form.visitedByField={},this.form.modifiedByField={},this.form.submitted=!1},onReset:function(){this.resetForm()},addField:function(e){this.fields[e]=!0},onSubmit:function(e){var t={},n=this.fields;e&&("function"==typeof e.preventDefault&&e.preventDefault(),"function"==typeof e.stopPropagation&&e.stopPropagation()),Object.keys(n).forEach((function(e){t[e]=!0})),this.form.visitedByField=r({},t),this.form.touchedByField=r({},t);var o=this.form.values,i=this.isValid(),u=this.isFormModified(this.form.modifiedByField,n);this.$emit("submitclick",{values:o,isValid:i,isModified:u,event:e}),i&&(this.$props.ignoreModified||u)&&(this.form.submitted=!0,this.$emit("submit",o,e))},onChange:function(e,t){var n,o=t.value;this.addField(e),this.form.modifiedByField[e]||(this.form.modifiedByField=r(r({},this.form.modifiedByField),((n={})[e]=!0,n))),this.valueSetter(e,o)},onFocus:function(e){var t;this.form.visitedByField[e]||(this.form.visitedByField=r(r({},this.form.visitedByField),((t={})[e]=!0,t)))},onBlur:function(e){var t;this.form.touchedByField[e]||(this.onFocus(e),this.form.touchedByField=r(r({},this.form.touchedByField),((t={})[e]=!0,t)))},onFieldRegister:function(e,t){var n,o=this;this.addField(e);var i=this.validatorsByField[e]||[],u=i.length;return this.validatorsByField=r(r({},this.validatorsByField),((n={})[e]=s(i,[t]),n)),this.accumulatedForceUpdate(),function(){var t;if(!o._unmounted){var n=s(o.validatorsByField[e]||[]),i=Boolean(n[u]);n[u]=void 0,o.validatorsByField=r(r({},o.validatorsByField),((t={})[e]=n,t)),i&&o.accumulatedForceUpdate()}}},isFormValid:function(e){return!Object.keys(e).some((function(t){return Boolean(e[t])}))},isFormModified:function(e,t){return Object.keys(t).some((function(t){return e[t]}))},isFormHasNotTouched:function(e,t){return Object.keys(t).some((function(t){return!e[t]}))},isFormTouched:function(e,t){return Object.keys(t).some((function(t){return e[t]}))},isFormVisited:function(e,t){return Object.keys(t).some((function(t){return e[t]}))},formHasNotTouched:function(){return this.isFormHasNotTouched(this.form.touchedByField,this.fields)},allowSubmit:function(){return this.formHasNotTouched()&&!this.isValid()||this.isValid()&&(this.$props.ignoreModified||this.isFormModified(this.form.modifiedByField,this.fields))},valueGetter:function(e){return this.form.values[e]},valueSetter:function(e,t){var n;this.form.values=r(r({},this.form.values),((n={})[e]=t,n))},onArrayAction:function(e){var t;this.addField(e),this.form.modifiedByField[e]||(this.form.modifiedByField=r(r({},this.form.modifiedByField),((t={})[e]=!0,t))),this.onBlur(e,!0)},onInsert:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[]);n.splice(t.index,0,t.value),this.valueSetter(e,n)},onUnshift:function(e,t){this.onInsert(e,{value:t.value,index:0})},onPush:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[],[t.value]);this.valueSetter(e,n)},onPop:function(e){this.onArrayAction(e);var t=s(this.valueGetter(e)||[]),n=t.pop();return this.valueSetter(e,t),n},onRemove:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[]),r=n.splice(t.index,1);return this.valueSetter(e,n),r},onReplace:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[]);n.splice(t.index,1,t.value),this.valueSetter(e,n)},onMove:function(e,t){this.onArrayAction(e);var n=s(this.valueGetter(e)||[]),r=n[t.prevIndex];n.splice(t.prevIndex,1),n.splice(t.nextIndex,0,r),this.valueSetter(e,n)},onDestroy:function(){this.unmounted=!0,this._accumulatorTimeout&&clearTimeout(this._accumulatorTimeout)}},setup:c?function(){return{v3:!!c}}:void 0,render:function(e){return f.getDefaultSlots(this)}};t.FormVue2=h;var m=h;t.Form=m},function(e,t,n){"use strict";var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},i=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},u=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&o(t,e,n);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.FieldArrayVue2=t.FieldArray=void 0;var s=u(n(0)),a=s.h,d="3"===s.version[0],l=n(1),c={name:"KendoFieldArray",props:{value:[String,Number,Boolean,Object,Array],component:[String,Number,Boolean,Object],validationMessage:String,touched:Boolean,modified:Boolean,validator:[Function,Array],visited:Boolean,valid:Boolean,name:String,id:String},created:function(){if(this.kendoForm)return this.kendoForm.registerField(this.$props.name,this.$props.validator)},methods:{onUnshift:function(e){this.kendoForm.onUnshift(this.$props.name,e)},onPush:function(e){this.kendoForm.onPush(this.$props.name,e)},onInsert:function(e){this.kendoForm.onInsert(this.$props.name,e)},onPop:function(){this.kendoForm.onPop(this.$props.name)},onRemove:function(e){this.kendoForm.onRemove(this.$props.name,e)},onReplace:function(e){this.kendoForm.onReplace(this.$props.name,e)},onMove:function(e){this.kendoForm.onMove(this.$props.name,e)}},setup:d?function(){return{v3:!!d}}:void 0,inject:{kendoForm:{default:null}},render:function(e){var t=a||e,n=this.$props,o=n.name,i=n.component,u=n.id;if(!this.kendoForm)return null;var s=this.kendoForm.values[o];if(i){var d=i?l.templateRendering.call(this,i,l.getListeners.call(this)):null;return l.getTemplate.call(this,{h:t,template:d,additionalProps:r({value:s,validationMessage:this.kendoForm.errors[o],touched:this.kendoForm.touchedByField[o],modified:this.kendoForm.modifiedByField[o],visited:this.kendoForm.visitedByField[o],valid:!(Boolean(this.kendoForm.errors[o])&&this.kendoForm.touchedByField[o]),name:o,id:u},this.$attrs),additionalListeners:{unshift:this.onUnshift,push:this.onPush,insert:this.onInsert,pop:this.onPop,remove:this.onRemove,replace:this.onReplace,move:this.onMove}})}}};t.FieldArrayVue2=c;var f=c;t.FieldArray=f},function(e,t,n){"use strict";var r=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},o=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.FieldWrapperVue2=t.FieldWrapper=void 0;var u=i(n(0)),s=u.h,a="3"===u.version[0],d=n(2),l=n(1),c={name:"KendoFieldWrapper",props:{dir:String},created:function(){l.validatePackage(d.packageMetadata)},computed:{fieldClassName:function(){return{"k-form-field":!0,"k-rtl":"rtl"===this.$props.dir}}},setup:a?function(){return{v3:!!a}}:void 0,render:function(e){var t=s||e,n=l.getDefaultSlots(this);return t("div",{class:this.fieldClassName},[n])}};t.FieldWrapperVue2=c;var f=c;t.FieldWrapper=f},function(e,t,n){"use strict";var r=Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},o=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},i=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.FormElementVue2=t.FormElement=void 0;var u=i(n(0)),s=u.h,a="3"===u.version[0],d=n(2),l=n(1),c={name:"KendoFormElement",props:{horizontal:Boolean},created:function(){l.validatePackage(d.packageMetadata)},inject:{kendoForm:{default:null}},computed:{formElementClassName:function(){return{"k-form":!0,"k-form-horizontal":!0===this.$props.horizontal}}},methods:{handleSubmit:function(e){this.kendoForm&&this.kendoForm.onSubmit(e)}},setup:a?function(){return{v3:!!a}}:void 0,render:function(e){var t=s||e,n=l.getDefaultSlots(this);return t("form",{class:this.formElementClassName,onSubmit:this.handleSubmit,on:this.v3?void 0:{submit:this.handleSubmit}},[n])}};t.FormElementVue2=c;var f=c;t.FormElement=f}])}));
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-form',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1657616220,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-vue-form',
|
|
9
9
|
productName: 'Kendo UI for Vue',
|
|
10
10
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1657616220,
|
|
12
12
|
version: '',
|
|
13
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-form",
|
|
3
3
|
"description": "Kendo UI for Vue Form package",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.3-dev.202207120901",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/telerik/kendo-vue.git"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"vue": "^2.6.12 || ^3.0.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@progress/kendo-vue-common": "3.4.
|
|
36
|
+
"@progress/kendo-vue-common": "3.4.3-dev.202207120901"
|
|
37
37
|
},
|
|
38
38
|
"@progress": {
|
|
39
39
|
"friendlyName": "Form",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"@progress/kendo-date-math": "^1.4.1",
|
|
50
50
|
"@progress/kendo-drawing": "^1.8.0",
|
|
51
51
|
"@progress/kendo-licensing": "^1.1.0",
|
|
52
|
-
"@progress/kendo-vue-buttons": "3.4.
|
|
53
|
-
"@progress/kendo-vue-data-tools": "3.4.
|
|
54
|
-
"@progress/kendo-vue-dateinputs": "3.4.
|
|
55
|
-
"@progress/kendo-vue-dropdowns": "3.4.
|
|
56
|
-
"@progress/kendo-vue-grid": "3.4.
|
|
57
|
-
"@progress/kendo-vue-inputs": "3.4.
|
|
58
|
-
"@progress/kendo-vue-intl": "3.4.
|
|
59
|
-
"@progress/kendo-vue-labels": "3.4.
|
|
60
|
-
"@progress/kendo-vue-layout": "3.4.
|
|
61
|
-
"@progress/kendo-vue-upload": "3.4.
|
|
52
|
+
"@progress/kendo-vue-buttons": "3.4.3-dev.202207120901",
|
|
53
|
+
"@progress/kendo-vue-data-tools": "3.4.3-dev.202207120901",
|
|
54
|
+
"@progress/kendo-vue-dateinputs": "3.4.3-dev.202207120901",
|
|
55
|
+
"@progress/kendo-vue-dropdowns": "3.4.3-dev.202207120901",
|
|
56
|
+
"@progress/kendo-vue-grid": "3.4.3-dev.202207120901",
|
|
57
|
+
"@progress/kendo-vue-inputs": "3.4.3-dev.202207120901",
|
|
58
|
+
"@progress/kendo-vue-intl": "3.4.3-dev.202207120901",
|
|
59
|
+
"@progress/kendo-vue-labels": "3.4.3-dev.202207120901",
|
|
60
|
+
"@progress/kendo-vue-layout": "3.4.3-dev.202207120901",
|
|
61
|
+
"@progress/kendo-vue-upload": "3.4.3-dev.202207120901"
|
|
62
62
|
}
|
|
63
63
|
}
|