@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
3 lines • 2.16 kB
JavaScript
/* @license */
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("kendo.core.min.js"),require("kendo.html.button.min.js")):typeof define==`function`&&define.amd?define([`exports`,`kendo.core.min`,`kendo.html.button.min`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Checkpoint={}),e.kendo._globals.Core,e.kendo._globals.HtmlButton))})(this,function(e,t,n){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let r={id:`checkpoint`,name:`Checkpoint`,category:`web`,description:`The Checkpoint component.`,depends:[`core`,`html.button`]};(function(e,t){let n=window.kendo,r=n.ui.Widget,i=n.htmlEncode,a=`.kendoCheckpoint`,o=`action`,s=r.extend({init:function(e,t){let i=this;r.fn.init.call(i,e,t),i._render(),i._bindEvents(),n.notify(i)},options:{name:`Checkpoint`,state:null,displayMode:`hover`,template:null,messages:{startOver:`Start Over`,restore:`Restore Checkpoint`,redo:`Redo`,checkpointRestoredText:`Checkpoint Restored`}},events:[o],_render:function(){let e=this,t=e.options;e.element.addClass(`k-checkpoint`).toggleClass(`k-checkpoint-visible`,t.displayMode===`always`);let r=`<span class="k-checkpoint-line" aria-hidden="true"></span>`;if(t.template!==null){let n=t.template;e.element.html(r+n({})+r)}else{let a=t.state?t.messages[t.state]||t.state:``,o=t.state===`redo`?`<span class="k-checkpoint-stamp">${i(t.messages.checkpointRestoredText||`Checkpoint Restored`)}</span><span>·</span>`:``,s=n.html.renderButton(`<button class="k-checkpoint-button">${i(a)}</button>`,{fillMode:`flat`,size:`xsmall`});e.element.html(r+o+s+r)}},_bindEvents:function(){let e=this;e.element.on(`click.kendoCheckpoint`,`.k-checkpoint-button`,e._onClick.bind(e))},_onClick:function(){let e=this;e.trigger(o,{action:e.options.state})},setState:function(e){let t=this;t.element.off(a),t.options.state=e,t._render(),t._bindEvents()},destroy:function(){let e=this;e.element.off(a),r.fn.destroy.call(e)}});n.ui.plugin(s)})(window.kendo.jQuery);var i=kendo;e.__meta__=r,e.default=i});
//# sourceMappingURL=kendo.checkpoint.min.js.map