demo20230512/Scripts/kendo/2014.2.716/kendo.angular.min.js

16 lines
8.8 KiB
JavaScript
Raw Permalink Normal View History

2023-05-12 10:20:28 +08:00
/**
* Copyright 2014 Telerik AD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
!function(e,define){define(["./kendo.core.min"],e)}(function(){return function(e,t,n){"use strict";function i(i,a,o,s,l){var d,c,u=s.replace(/^kendo/,""),p=t.extend({},i.$eval(o.kOptions));return e.each(o,function(e,r){var a,o;k[e]||(a=e.match(/^k(On)?([A-Z].*)/),a&&(o=a[2].charAt(0).toLowerCase()+a[2].slice(1),a[1]&&"kOnLabel"!=e?p[o]=r:("kOnLabel"==e&&(o="onLabel"),p[o]=t.copy(i.$eval(r)),p[o]===n&&r.match(/^\w*$/)&&g.warn(s+"'s "+e+" attribute resolved to undefined. Maybe you meant to use a string literal like: '"+r+"'?"))))}),o.kDataSource&&(p.dataSource=_(i,a,o,u)),p.$angular=[i],(d=e(a)[s])?(c=d.call(a,v=p).data(s),r(c,i,o,s,l),i.$emit("kendoWidgetCreated",c),c):(window.console.error("Could not find: "+s),null)}function r(e,t,n,i,r){if(n[r]){var a=h(n[r]).assign;if(!a)throw Error(r+" attribute used but expression in it is not assignable: "+n[i]);a(t,e)}}function a(e){return/^kendo/i.test(e.prop("tagName"))}function o(e,t){function n(e,t){p.directive(e,["directiveFactory",function(n){return n.create(t,e)}])}var i,r=t?"Mobile":"";r+=e.fn.options.name,i="kendo"+r.charAt(0)+r.substr(1).toLowerCase(),r="kendo"+r,n(r,r),i!=r&&n(i,r)}function s(t){return t=e(t),kendo.widgetInstance(t,kendo.ui)||kendo.widgetInstance(t,kendo.mobile.ui)||kendo.widgetInstance(t,kendo.dataviz.ui)}function l(e,t,n,i){e.bind.call(e,t,n,i);var r=e._events[t];r.unshift(r.pop())}function d(e){/^\$(digest|apply)$/.test(e.$root.$$phase)||e.$digest()}function c(t,n){t.$destroy(),n&&e(n).removeData("$scope").removeData("$isolateScope").removeData("$isolateScopeNoTemplate").removeClass("ng-scope")}function u(n,i,r){var a,o,s;if(e.isArray(n))return t.forEach(n,function(e){u(e,i,r)});if("string"==typeof n){for(a=n.split("."),o=kendo;o&&a.length>0;)o=o[a.shift()];if(!o)return b.push([n,i,r]),!1;n=o.prototype}return s=n[i],n[i]=function(){var e=this,t=arguments;return r.apply({self:e,next:function(){return s.apply(e,arguments.length>0?arguments:t)}},t)},!0}var p,h,f,m,g,v,_,k,b;t&&(p=t.module("kendo.directives",[]),_=function(){var e={TreeView:"HierarchicalDataSource",Scheduler:"SchedulerDataSource",PanelBar:"$PLAIN",Menu:"$PLAIN"},t=function(e,t){return"$PLAIN"==t?e:kendo.data[t].create(e)};return function(n,i,r,a){var o=e[a]||"DataSource",l=t(n.$eval(r.kDataSource),o);return n.$watch(r.kDataSource,function(e,n){var r,a;e!==n&&(r=t(e,o),a=s(i),a&&"function"==typeof a.setDataSource&&a.setDataSource(r))}),l}}(),k={kDataSource:!0,kOptions:!0,kRebind:!0,kNgModel:!0,kNgDelay:!0},p.factory("directiveFactory",["$timeout","$parse","$compile","$log",function(t,r,o,s){var c,u;return f=t,h=r,m=o,g=s,c=0,u=function(t,r){return{restrict:"ACE",require:["?ngModel","^?form"],scope:!1,transclude:!0,controller:["$scope","$attrs","$element","$transclude",function(e,t,n,i){a(n)&&!function(){var e,i,r,a,o=n[0];for(t.$kendoOrigElement=o.cloneNode(!0),e=Array.prototype.slice.call(o.attributes),i=0;e.length>i;++i)r=e[i].nodeName,/^(k|ng)-/.test(r)||/^(style|class|id)$/.test(r)||(a=("k-"+r).replace(/-(.)/g,function(e,t){return t.toUpperCase()}),a in t||(t[a]=e[i].nodeValue),o.removeAttribute(r))}(),i(e,function(e){n.append(e)})}],link:function(a,o,s,u){var p,v=u[0],_=u[1];e(o)[0].removeAttribute("data-"+t.replace(/([A-Z])/g,"-$1")),++c,p=s.kNgDelay,f(function k(){function u(){function e(e){return/checkbox|radio/i.test(e.attr("type"))?e.prop("checked"):e.val()}function t(){return w?e(o):y.value()}var i,r,c,u,p,m,k,b,w=/^(input|select|textarea)$/i.test(o[0].tagName);x&&x(),x=a.$on("$destroy",function(){y&&(y.element&&y.destroy(),y=null)});e:if(v){if(!y.value)break e;if(v.$render=function(){var e=v.$viewValue;e===n&&(e=v.$modelValue),setTimeout(function(){y.value(e)},0)},w&&o.on("change",function(){i=!0}),r=function(e){return function(){i=!1,f(function(){var n;i||(e&&_&&(n=_.$pristine),v.$setViewValue(t()),e&&(v.$setPristine(),n&&_.$setPristine()))})}},l(y,"change",r(!1)),l(y,"dataBound",r(!0)),c=t(),c!=v.$viewValue&&(v.$isEmpty(v.$viewValue)?null!=c&&""!==c&&c!=v.$viewValue&&v.$setViewValue(c):y.value(v.$viewValue)),v.$setPristine(),_){for(u=o;u.controller("form");)p=u.controller("