UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

58 lines (56 loc) 1.85 kB
const require_chunk = require('./chunk-BE-pF4vm.js'); let _progress_kendo_ooxml = require("@progress/kendo-ooxml"); //#region ../src/kendo.ooxml.js const __meta__ = { id: "ooxml", name: "XLSX generation", category: "framework", advanced: true, mixin: true, depends: ["core"] }; (function($) { _progress_kendo_ooxml.IntlService.register({ toString: kendo.toString }); let convertedWorkbook = kendo.ConvertClass(_progress_kendo_ooxml.Workbook); var toDataURL = convertedWorkbook.prototype.toDataURL; Object.assign(convertedWorkbook.prototype, { toDataURL: function() { var result = toDataURL.call(this); if (typeof result !== "string") { throw new Error("The toDataURL method can be used only with jsZip 2. Either include jsZip 2 or use the toDataURLAsync method."); } return result; }, toDataURLAsync: function() { var deferred = $.Deferred(); var result = toDataURL.call(this); if (typeof result === "string") { result = deferred.resolve(result); } else if (result && result.then) { result.then(function(dataURI) { deferred.resolve(dataURI); }, function() { deferred.reject(); }); } return deferred.promise(); } }); window.kendo.ooxml = window.kendo.ooxml || {}; window.kendo.ooxml.IntlService = _progress_kendo_ooxml.IntlService; window.kendo.ooxml.Workbook = convertedWorkbook; window.kendo.ooxml.Worksheet = kendo.ConvertClass(_progress_kendo_ooxml.Worksheet); window.kendo.ooxml.createZip = function() { if (typeof JSZip === "undefined") { throw new Error("JSZip not found. Check http://docs.telerik.com/kendo-ui/framework/excel/introduction#requirements for more details."); } return new JSZip(); }; })(window.kendo.jQuery); //#endregion Object.defineProperty(exports, '__meta__', { enumerable: true, get: function () { return __meta__; } });