UNPKG

kendo-ui-core

Version:

Kendo UI is everything you need to build sites and apps with HTML5 & JavaScript. Kendo UI Core is the free and open-source version of Kendo UI that provides access to the web's best UI widgets and key framework features, essential for developing great exp

17 lines 2.91 kB
/*! * Copyright 2026 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved. * * 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,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`./kendo.core.js`),require(`./kendo.floatinglabel.js`)):typeof define==`function`&&define.amd?define([`exports`,`./kendo.core.js`,`./kendo.floatinglabel.js`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Label={}),e.kendo._globals.Core,e.kendo._globals.Floatinglabel))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let r={id:`label`,name:`Label`,category:`framework`,description:`Abstraction of label rendering for inputs`,depends:[`core`,`floatinglabel`],hidden:!0},i=window.kendo,a=i.jQuery,o=i.ui.Widget,s=i.isFunction;var c=o.extend({options:{name:`Label`,widget:null},init:function(e,t){var n=this;e||=a(`<label></label>`),o.fn.init.call(n,e,t),t=a.extend(!0,{},t),n.widget=t.widget,t.floating&&n._floatingLabel(),n._label()},destroy:function(){this.floatingLabel&&this.floatingLabel.destroy(),o.fn.destroy.call(this)},_unwrapFloating:function(){var e=this;e.floatingLabel&&(e.floatingLabel.destroy(),e.widget.wrapper.unwrap(e._floatingLabelContainer))},setOptions:function(e){var t=this,n=!1;(typeof e==`string`||a.isPlainObject(e)&&e.floating===!1)&&(n=!0),e=a.isPlainObject(e)?e:{content:e},o.fn.setOptions.call(t,e),n&&t.floatingLabel?(t._unwrapFloating(),t.floatingLabel.destroy(),delete t.floatingLabel):e.floating===!0&&!t.floatingLabel&&(t.element.remove(),t._floatingLabel()),t._label()},_label:function(){var e=this,t=e.widget.element,n=e.options,r=t.attr(`id`),a=n.content,o=n.floating||!1;s(a)&&(a=a.call(e)),a||=``,r||(r=n.name+`_`+i.guid(),t.attr(`id`,r)),e.element.addClass(o?`k-floating-label`:`k-label k-input-label`).attr(`for`,r).text(a)[o?`insertAfter`:`insertBefore`](e.options.beforeElm||e.widget.wrapper),e.floatingLabel&&e.floatingLabel.refresh()},_floatingLabel:function(){var e=this,t=a.extend({},e.options),n;delete t.name,n=t.floating||!1,n&&(e._floatingLabelContainer=e.widget.wrapper.wrap(`<span></span>`).parent(),e.floatingLabel=new i.ui.FloatingLabel(e._floatingLabelContainer,a.extend({},t)))}});i.ui.plugin(c),e.__meta__=r,e.default=i}); //# sourceMappingURL=kendo.label.min.js.map