devexpress-utils
Advanced tools
| export declare class ChunkedText { | ||
| protected maxChunkSize: number; | ||
| protected chunks: string[]; | ||
| protected chunkIndex: number; | ||
| protected chunk: string; | ||
| protected chunkLength: number; | ||
| protected posInChunk: number; | ||
| protected _currPos: number; | ||
| protected _textLength: number; | ||
| get currChar(): string; | ||
| get currPos(): number; | ||
| get textLength(): number; | ||
| constructor(text: string, maxChunkSize?: number); | ||
| resetToStart(): void; | ||
| resetToEnd(): void; | ||
| addText(text: string): void; | ||
| getText(): string; | ||
| moveToNextChar(): boolean; | ||
| moveToPrevChar(): boolean; | ||
| setPositionTo(position: number): void; | ||
| private setChunk; | ||
| private pushText; | ||
| } | ||
| //# sourceMappingURL=chunked-text.d.ts.map |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ChunkedText = void 0; | ||
| var ChunkedText = (function () { | ||
| function ChunkedText(text, maxChunkSize) { | ||
| if (maxChunkSize === void 0) { maxChunkSize = 2000; } | ||
| this.maxChunkSize = maxChunkSize; | ||
| this.chunks = []; | ||
| this._textLength = 0; | ||
| this.pushText(text); | ||
| this.resetToStart(); | ||
| } | ||
| Object.defineProperty(ChunkedText.prototype, "currChar", { | ||
| get: function () { | ||
| return this.chunk[this.posInChunk]; | ||
| }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(ChunkedText.prototype, "currPos", { | ||
| get: function () { | ||
| return this._currPos; | ||
| }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| Object.defineProperty(ChunkedText.prototype, "textLength", { | ||
| get: function () { | ||
| return this._textLength; | ||
| }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| ChunkedText.prototype.resetToStart = function () { | ||
| this.setChunk(0); | ||
| this.posInChunk = -1; | ||
| this._currPos = -1; | ||
| }; | ||
| ChunkedText.prototype.resetToEnd = function () { | ||
| this.setChunk(this.chunks.length - 1); | ||
| this.posInChunk = this.chunkLength - 1; | ||
| this._currPos = this._textLength; | ||
| }; | ||
| ChunkedText.prototype.addText = function (text) { | ||
| this.pushText(text); | ||
| if (this._currPos === -1) { | ||
| this.chunk = this.chunks[0]; | ||
| this.chunkLength = this.chunk.length; | ||
| } | ||
| else | ||
| this.setPositionTo(this._currPos); | ||
| }; | ||
| ChunkedText.prototype.getText = function () { | ||
| return this.chunks.join(''); | ||
| }; | ||
| ChunkedText.prototype.moveToNextChar = function () { | ||
| this.posInChunk++; | ||
| this._currPos++; | ||
| if (this.posInChunk < this.chunkLength) | ||
| return true; | ||
| if (this.setChunk(this.chunkIndex + 1)) { | ||
| this.posInChunk = 0; | ||
| return true; | ||
| } | ||
| else { | ||
| this.posInChunk = this.chunkLength; | ||
| this._currPos = this._textLength; | ||
| return false; | ||
| } | ||
| }; | ||
| ChunkedText.prototype.moveToPrevChar = function () { | ||
| this.posInChunk--; | ||
| this._currPos--; | ||
| if (this.posInChunk >= 0) | ||
| return true; | ||
| if (this.setChunk(this.chunkIndex - 1)) { | ||
| this.posInChunk = this.chunkLength - 1; | ||
| return true; | ||
| } | ||
| else { | ||
| this.posInChunk = -1; | ||
| this._currPos = -1; | ||
| return false; | ||
| } | ||
| }; | ||
| ChunkedText.prototype.setPositionTo = function (position) { | ||
| var restLength = position; | ||
| this.chunkIndex = 0; | ||
| for (var ind = 0; true; ind++) { | ||
| if (this.setChunk(ind)) { | ||
| if (restLength > this.chunkLength) | ||
| restLength -= this.chunk.length; | ||
| else { | ||
| this.posInChunk = restLength; | ||
| this._currPos = position; | ||
| return; | ||
| } | ||
| } | ||
| else { | ||
| this.posInChunk = this.chunkLength; | ||
| this._currPos = this._textLength; | ||
| return; | ||
| } | ||
| } | ||
| }; | ||
| ChunkedText.prototype.setChunk = function (index) { | ||
| var prevChunkVal = this.chunk; | ||
| this.chunk = this.chunks[index]; | ||
| if (!this.chunk) { | ||
| this.chunk = prevChunkVal; | ||
| return false; | ||
| } | ||
| this.chunkIndex = index; | ||
| this.chunkLength = this.chunk.length; | ||
| return true; | ||
| }; | ||
| ChunkedText.prototype.pushText = function (text) { | ||
| if (!text.length) | ||
| return; | ||
| var textPos = 0; | ||
| while (textPos < text.length) { | ||
| if (textPos === 0) { | ||
| var lastChunk = this.chunks.pop(); | ||
| if (lastChunk) { | ||
| if (lastChunk.length < this.maxChunkSize) { | ||
| var restLen = this.maxChunkSize - lastChunk.length; | ||
| this.chunks.push(lastChunk + text.substr(textPos, restLen)); | ||
| textPos += restLen; | ||
| continue; | ||
| } | ||
| else | ||
| this.chunks.push(lastChunk); | ||
| } | ||
| } | ||
| this.chunks.push(text.substr(textPos, this.maxChunkSize)); | ||
| textPos += this.maxChunkSize; | ||
| } | ||
| this._textLength += text.length; | ||
| }; | ||
| return ChunkedText; | ||
| }()); | ||
| exports.ChunkedText = ChunkedText; |
| export declare class Constants { | ||
| static MIN_SAFE_INTEGER: number; | ||
| static MAX_SAFE_INTEGER: number; | ||
| static MAX_BYTE: number; | ||
| } | ||
| export declare class Int32Constants { | ||
| static MIN_VALUE: number; | ||
| static MAX_VALUE: number; | ||
| } | ||
| //# sourceMappingURL=constants.d.ts.map |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Int32Constants = exports.Constants = void 0; | ||
| var Constants = (function () { | ||
| function Constants() { | ||
| } | ||
| Constants.MIN_SAFE_INTEGER = -(Math.pow(2, 53) - 1); | ||
| Constants.MAX_SAFE_INTEGER = (Math.pow(2, 53) - 1); | ||
| Constants.MAX_BYTE = Math.pow(2, 8) - 1; | ||
| return Constants; | ||
| }()); | ||
| exports.Constants = Constants; | ||
| var Int32Constants = (function () { | ||
| function Int32Constants() { | ||
| } | ||
| Int32Constants.MIN_VALUE = -2147483648; | ||
| Int32Constants.MAX_VALUE = 2147483647; | ||
| return Int32Constants; | ||
| }()); | ||
| exports.Int32Constants = Int32Constants; |
| import { ICloneable } from './types'; | ||
| export declare class Flag implements ICloneable<Flag> { | ||
| private value; | ||
| constructor(initValue?: number); | ||
| get(enumVal: number): boolean; | ||
| set(enumVal: number, newValue: boolean): this; | ||
| add(value: number): void; | ||
| anyOf(...flags: number[]): boolean; | ||
| getValue(): number; | ||
| clone(): Flag; | ||
| } | ||
| //# sourceMappingURL=flag.d.ts.map |
+45
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Flag = void 0; | ||
| var Flag = (function () { | ||
| function Flag(initValue) { | ||
| if (initValue === void 0) { initValue = 0; } | ||
| this.value = initValue; | ||
| } | ||
| Flag.prototype.get = function (enumVal) { | ||
| return (this.value & enumVal) === enumVal; | ||
| }; | ||
| Flag.prototype.set = function (enumVal, newValue) { | ||
| var currVal = (this.value & enumVal) === enumVal; | ||
| if (currVal !== newValue) { | ||
| if (newValue) | ||
| this.value |= enumVal; | ||
| else | ||
| this.value ^= enumVal; | ||
| } | ||
| return this; | ||
| }; | ||
| Flag.prototype.add = function (value) { | ||
| this.value |= value; | ||
| }; | ||
| Flag.prototype.anyOf = function () { | ||
| var flags = []; | ||
| for (var _i = 0; _i < arguments.length; _i++) { | ||
| flags[_i] = arguments[_i]; | ||
| } | ||
| for (var _a = 0, flags_1 = flags; _a < flags_1.length; _a++) { | ||
| var flag = flags_1[_a]; | ||
| if (this.value & flag) | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
| Flag.prototype.getValue = function () { | ||
| return this.value; | ||
| }; | ||
| Flag.prototype.clone = function () { | ||
| return new Flag(this.value); | ||
| }; | ||
| return Flag; | ||
| }()); | ||
| exports.Flag = Flag; |
| export declare class MinMax<T> { | ||
| min: T; | ||
| max: T; | ||
| constructor(min: T, max: T); | ||
| } | ||
| export declare class MinMaxNumber extends MinMax<number> { | ||
| get length(): number; | ||
| } | ||
| export declare class ExtendedMin<T> { | ||
| minElement: T; | ||
| minValue: number; | ||
| constructor(minElement: T, minValue: number); | ||
| } | ||
| export declare class ExtendedMax<T> { | ||
| maxElement: T; | ||
| maxValue: number; | ||
| constructor(maxElement: T, maxValue: number); | ||
| } | ||
| export declare class ExtendedMinMax<T> { | ||
| minElement: T; | ||
| maxElement: T; | ||
| minValue: number; | ||
| maxValue: number; | ||
| constructor(minElement: T, minValue: number, maxElement: T, maxValue: number); | ||
| } | ||
| //# sourceMappingURL=min-max.d.ts.map |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ExtendedMinMax = exports.ExtendedMax = exports.ExtendedMin = exports.MinMaxNumber = exports.MinMax = void 0; | ||
| var tslib_1 = require("tslib"); | ||
| var MinMax = (function () { | ||
| function MinMax(min, max) { | ||
| this.min = min; | ||
| this.max = max; | ||
| } | ||
| return MinMax; | ||
| }()); | ||
| exports.MinMax = MinMax; | ||
| var MinMaxNumber = (function (_super) { | ||
| tslib_1.__extends(MinMaxNumber, _super); | ||
| function MinMaxNumber() { | ||
| return _super !== null && _super.apply(this, arguments) || this; | ||
| } | ||
| Object.defineProperty(MinMaxNumber.prototype, "length", { | ||
| get: function () { | ||
| return this.max - this.min; | ||
| }, | ||
| enumerable: false, | ||
| configurable: true | ||
| }); | ||
| return MinMaxNumber; | ||
| }(MinMax)); | ||
| exports.MinMaxNumber = MinMaxNumber; | ||
| var ExtendedMin = (function () { | ||
| function ExtendedMin(minElement, minValue) { | ||
| this.minElement = minElement; | ||
| this.minValue = minValue; | ||
| } | ||
| return ExtendedMin; | ||
| }()); | ||
| exports.ExtendedMin = ExtendedMin; | ||
| var ExtendedMax = (function () { | ||
| function ExtendedMax(maxElement, maxValue) { | ||
| this.maxElement = maxElement; | ||
| this.maxValue = maxValue; | ||
| } | ||
| return ExtendedMax; | ||
| }()); | ||
| exports.ExtendedMax = ExtendedMax; | ||
| var ExtendedMinMax = (function () { | ||
| function ExtendedMinMax(minElement, minValue, maxElement, maxValue) { | ||
| this.minElement = minElement; | ||
| this.minValue = minValue; | ||
| this.maxElement = maxElement; | ||
| this.maxValue = maxValue; | ||
| } | ||
| return ExtendedMinMax; | ||
| }()); | ||
| exports.ExtendedMinMax = ExtendedMinMax; |
| export declare type EqualFunc<T> = (a: T, b: T) => boolean; | ||
| export declare type CmpFunc<T> = (a: T, b: T) => number; | ||
| export declare type SimpleConverter<T = number> = (value: T) => T; | ||
| export interface ICloneable<T> { | ||
| clone(): T; | ||
| } | ||
| export interface ISupportCopyFrom<T> { | ||
| copyFrom(obj: T): void; | ||
| } | ||
| export interface IDisposable { | ||
| dispose(): any; | ||
| } | ||
| export interface IEquatable<T> { | ||
| equals(obj: T): boolean; | ||
| } | ||
| export interface ISupportConverting<T> { | ||
| applyConverter(converter: SimpleConverter<T>): this; | ||
| } | ||
| //# sourceMappingURL=types.d.ts.map |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); |
| export declare enum Base64MimeType { | ||
| Unknown = 0, | ||
| OpenXml = 1, | ||
| Rtf = 2, | ||
| PlainText = 3, | ||
| Docm = 4 | ||
| } | ||
| export declare const OpenXmlMimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; | ||
| export declare const RtfMimeType = "application/rtf"; | ||
| export declare const PlainTextMimeType = "text/plain"; | ||
| export declare const DocmMimeType = "application/vnd.ms-word.document.macroEnabled.12"; | ||
| export declare class Base64Utils { | ||
| private static mimeTypesMap; | ||
| static dataUrl: RegExp; | ||
| static normalizeToDataUrl(base64: string, mimeType: string): string; | ||
| static prependByDataUrl(base64: string, mimeType?: string): string; | ||
| static checkPrependDataUrl(base64: string): boolean; | ||
| static deleteDataUrlPrefix(base64DataUrl: string): string; | ||
| static getUint8Array(base64: string): Uint8Array; | ||
| static fromArrayBuffer(buffer: ArrayBuffer): string; | ||
| static getFileFromBase64(base64: string, blobOptions?: BlobPropertyBag): File; | ||
| static getMimeTypeAsString(base64: string): string | null; | ||
| static getKnownMimeType(base64: string): Base64MimeType; | ||
| static fromBlobAsArrayBuffer(blob: Blob, callback: (base64: string) => void): void; | ||
| static fromBlobAsDataUrl(blob: Blob, callback: (base64: string) => void): void; | ||
| } | ||
| //# sourceMappingURL=base64.d.ts.map |
| "use strict"; | ||
| var _a; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Base64Utils = exports.DocmMimeType = exports.PlainTextMimeType = exports.RtfMimeType = exports.OpenXmlMimeType = exports.Base64MimeType = void 0; | ||
| var Base64MimeType; | ||
| (function (Base64MimeType) { | ||
| Base64MimeType[Base64MimeType["Unknown"] = 0] = "Unknown"; | ||
| Base64MimeType[Base64MimeType["OpenXml"] = 1] = "OpenXml"; | ||
| Base64MimeType[Base64MimeType["Rtf"] = 2] = "Rtf"; | ||
| Base64MimeType[Base64MimeType["PlainText"] = 3] = "PlainText"; | ||
| Base64MimeType[Base64MimeType["Docm"] = 4] = "Docm"; | ||
| })(Base64MimeType = exports.Base64MimeType || (exports.Base64MimeType = {})); | ||
| exports.OpenXmlMimeType = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; | ||
| exports.RtfMimeType = 'application/rtf'; | ||
| exports.PlainTextMimeType = 'text/plain'; | ||
| exports.DocmMimeType = 'application/vnd.ms-word.document.macroEnabled.12'; | ||
| var Base64Utils = (function () { | ||
| function Base64Utils() { | ||
| } | ||
| Base64Utils.normalizeToDataUrl = function (base64, mimeType) { | ||
| if (!Base64Utils.checkPrependDataUrl(base64)) | ||
| base64 = Base64Utils.prependByDataUrl(base64, mimeType); | ||
| return base64; | ||
| }; | ||
| Base64Utils.prependByDataUrl = function (base64, mimeType) { | ||
| if (mimeType === void 0) { mimeType = 'image/png'; } | ||
| return "data:" + mimeType + ";base64," + base64; | ||
| }; | ||
| Base64Utils.checkPrependDataUrl = function (base64) { | ||
| return Base64Utils.dataUrl.test(base64); | ||
| }; | ||
| Base64Utils.deleteDataUrlPrefix = function (base64DataUrl) { | ||
| return base64DataUrl.replace(Base64Utils.dataUrl, ''); | ||
| }; | ||
| Base64Utils.getUint8Array = function (base64) { | ||
| base64 = atob(base64); | ||
| var n = base64.length; | ||
| var arr = new Uint8Array(n); | ||
| while (n--) | ||
| arr[n] = base64.charCodeAt(n); | ||
| return arr; | ||
| }; | ||
| Base64Utils.fromArrayBuffer = function (buffer) { | ||
| var binary = []; | ||
| var bytes = new Uint8Array(buffer); | ||
| var len = bytes.byteLength; | ||
| for (var i = 0; i < len; i++) | ||
| binary.push(String.fromCharCode(bytes[i])); | ||
| return window.btoa(binary.join('')); | ||
| }; | ||
| Base64Utils.getFileFromBase64 = function (base64, blobOptions) { | ||
| if (blobOptions === void 0) { blobOptions = { type: 'text' }; } | ||
| var data = Base64Utils.getUint8Array(base64); | ||
| return (new Blob([data], blobOptions)); | ||
| }; | ||
| Base64Utils.getMimeTypeAsString = function (base64) { | ||
| var match = base64.match(Base64Utils.dataUrl); | ||
| return match ? match[1] : null; | ||
| }; | ||
| Base64Utils.getKnownMimeType = function (base64) { | ||
| var _a; | ||
| var match = base64.match(Base64Utils.dataUrl); | ||
| return match ? ((_a = Base64Utils.mimeTypesMap[match[1]]) !== null && _a !== void 0 ? _a : Base64MimeType.Unknown) : Base64MimeType.Unknown; | ||
| }; | ||
| Base64Utils.fromBlobAsArrayBuffer = function (blob, callback) { | ||
| var reader = new FileReader(); | ||
| reader.onloadend = function () { return callback(Base64Utils.fromArrayBuffer(reader.result)); }; | ||
| reader.readAsArrayBuffer(blob); | ||
| }; | ||
| Base64Utils.fromBlobAsDataUrl = function (blob, callback) { | ||
| var reader = new FileReader(); | ||
| reader.onloadend = function () { return callback(reader.result); }; | ||
| reader.readAsDataURL(blob); | ||
| }; | ||
| Base64Utils.mimeTypesMap = (_a = {}, | ||
| _a[exports.OpenXmlMimeType] = Base64MimeType.OpenXml, | ||
| _a[exports.RtfMimeType] = Base64MimeType.Rtf, | ||
| _a[exports.PlainTextMimeType] = Base64MimeType.PlainText, | ||
| _a[exports.DocmMimeType] = Base64MimeType.Docm, | ||
| _a); | ||
| Base64Utils.dataUrl = /^data:(.*?)(;(.*?))??(;base64)?,/; | ||
| return Base64Utils; | ||
| }()); | ||
| exports.Base64Utils = Base64Utils; |
| export declare class StringUtils { | ||
| static stringCompare(a: string, b: string): number; | ||
| static stringHashCode(str: string): number; | ||
| static endsAt(str: string, template: string): boolean; | ||
| static startsAt(str: string, template: string): boolean; | ||
| static stringInLowerCase(str: string): boolean; | ||
| static stringInUpperCase(str: string): boolean; | ||
| static inStringAtLeastOneSymbolInUpperCase(str: string): boolean; | ||
| static getSymbolFromEnd(text: string, posFromEnd: number): string; | ||
| static stringTrim(str: string, trimChars?: string[]): string; | ||
| static stringTrimStart(str: string, trimChars?: string[]): string; | ||
| static stringTrimEnd(str: string, trimChars?: string[]): string; | ||
| static getDecimalSeparator(): string; | ||
| static strCompare(a: string, b: string, ignoreCase?: boolean): number; | ||
| static repeat(str: string, count: number): string; | ||
| static isNullOrEmpty(str: string): boolean; | ||
| static padLeft(str: string, totalWidth: number, paddingChar: string): string; | ||
| } | ||
| //# sourceMappingURL=string.d.ts.map |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.StringUtils = void 0; | ||
| var StringUtils = (function () { | ||
| function StringUtils() { | ||
| } | ||
| StringUtils.stringCompare = function (a, b) { | ||
| return ((a === b) ? 0 : ((a > b) ? 1 : -1)); | ||
| }; | ||
| StringUtils.stringHashCode = function (str) { | ||
| var hash = 0; | ||
| if (str.length === 0) | ||
| return hash; | ||
| var strLen = str.length; | ||
| for (var i = 0; i < strLen; i++) { | ||
| hash = ((hash << 5) - hash) + str.charCodeAt(i); | ||
| hash |= 0; | ||
| } | ||
| return hash; | ||
| }; | ||
| StringUtils.endsAt = function (str, template) { | ||
| var strInd = str.length - 1; | ||
| var tmplInd = template.length - 1; | ||
| var strStartInd = strInd - tmplInd; | ||
| if (strStartInd < 0) | ||
| return false; | ||
| for (; strInd >= strStartInd; strInd--, tmplInd--) { | ||
| if (str[strInd] !== template[tmplInd]) | ||
| return false; | ||
| } | ||
| return true; | ||
| }; | ||
| StringUtils.startsAt = function (str, template) { | ||
| return str.substr(0, template.length) === template; | ||
| }; | ||
| StringUtils.stringInLowerCase = function (str) { | ||
| return str.toLowerCase() === str; | ||
| }; | ||
| StringUtils.stringInUpperCase = function (str) { | ||
| return str.toUpperCase() === str; | ||
| }; | ||
| StringUtils.inStringAtLeastOneSymbolInUpperCase = function (str) { | ||
| for (var i = 0, char = void 0; char = str[i]; i++) { | ||
| if (StringUtils.stringInUpperCase(char) && !StringUtils.stringInLowerCase(char)) | ||
| return true; | ||
| } | ||
| return false; | ||
| }; | ||
| StringUtils.getSymbolFromEnd = function (text, posFromEnd) { | ||
| return text[text.length - posFromEnd]; | ||
| }; | ||
| StringUtils.stringTrim = function (str, trimChars) { | ||
| if (trimChars === void 0) { trimChars = ['\\s']; } | ||
| var joinedChars = trimChars.join(''); | ||
| return str.replace(new RegExp("(^[" + joinedChars + "]*)|([" + joinedChars + "]*$)", 'g'), ''); | ||
| }; | ||
| StringUtils.stringTrimStart = function (str, trimChars) { | ||
| if (trimChars === void 0) { trimChars = ['\\s']; } | ||
| var joinedChars = trimChars.join(''); | ||
| return str.replace(new RegExp("^[" + joinedChars + "]*", 'g'), ''); | ||
| }; | ||
| StringUtils.stringTrimEnd = function (str, trimChars) { | ||
| if (trimChars === void 0) { trimChars = ['\\s']; } | ||
| var joinedChars = trimChars.join(''); | ||
| return str.replace(new RegExp("[" + joinedChars + "]*$", 'g'), ''); | ||
| }; | ||
| StringUtils.getDecimalSeparator = function () { | ||
| return (1.1).toLocaleString().substr(1, 1); | ||
| }; | ||
| StringUtils.strCompare = function (a, b, ignoreCase) { | ||
| if (ignoreCase === void 0) { ignoreCase = false; } | ||
| if (ignoreCase) { | ||
| a = a.toLowerCase(); | ||
| b = b.toLowerCase(); | ||
| } | ||
| return ((a === b) ? 0 : ((a > b) ? 1 : -1)); | ||
| }; | ||
| StringUtils.repeat = function (str, count) { | ||
| return new Array(count <= 0 ? 0 : count + 1).join(str); | ||
| }; | ||
| StringUtils.isNullOrEmpty = function (str) { | ||
| return !str || !str.length; | ||
| }; | ||
| StringUtils.padLeft = function (str, totalWidth, paddingChar) { | ||
| return StringUtils.repeat(paddingChar, Math.max(0, totalWidth - str.length)) + str; | ||
| }; | ||
| return StringUtils; | ||
| }()); | ||
| exports.StringUtils = StringUtils; |
+12
-15
| /*! | ||
| * DevExpress Utils (dx.utils) | ||
| * Version: 1.0.1-alpha | ||
| * Build date: Fri Aug 28 2020 | ||
| * Version: 1.0.1-alpha-001 | ||
| * Build date: Mon Aug 31 2020 | ||
| * | ||
@@ -396,9 +396,8 @@ * Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED | ||
| } | ||
| Base64Utils.normalize = function (base64, mimeType) { | ||
| if (mimeType === void 0) { mimeType = 'image/png'; } | ||
| Base64Utils.normalizeToDataUrl = function (base64, mimeType) { | ||
| if (!Base64Utils.checkPrependDataUrl(base64)) | ||
| base64 = Base64Utils.prepend(base64, mimeType); | ||
| base64 = Base64Utils.prependByDataUrl(base64, mimeType); | ||
| return base64; | ||
| }; | ||
| Base64Utils.prepend = function (base64, mimeType) { | ||
| Base64Utils.prependByDataUrl = function (base64, mimeType) { | ||
| if (mimeType === void 0) { mimeType = 'image/png'; } | ||
@@ -410,6 +409,6 @@ return "data:" + mimeType + ";base64," + base64; | ||
| }; | ||
| Base64Utils.getBase64WithoutUrl = function (base64url) { | ||
| return base64url.replace(Base64Utils.dataUrl, ''); | ||
| Base64Utils.deleteDataUrlPrefix = function (base64DataUrl) { | ||
| return base64DataUrl.replace(Base64Utils.dataUrl, ''); | ||
| }; | ||
| Base64Utils.getArray = function (base64) { | ||
| Base64Utils.getUint8Array = function (base64) { | ||
| base64 = atob(base64); | ||
@@ -430,5 +429,5 @@ var n = base64.length; | ||
| }; | ||
| Base64Utils.getFile = function (base64, blobOptions) { | ||
| Base64Utils.getFileFromBase64 = function (base64, blobOptions) { | ||
| if (blobOptions === void 0) { blobOptions = { type: 'text' }; } | ||
| var data = Base64Utils.getArray(base64); | ||
| var data = Base64Utils.getUint8Array(base64); | ||
| return (new Blob([data], blobOptions)); | ||
@@ -441,7 +440,5 @@ }; | ||
| Base64Utils.getKnownMimeType = function (base64) { | ||
| var _a; | ||
| var match = base64.match(Base64Utils.dataUrl); | ||
| if (!match) | ||
| return Base64MimeType.Unknown; | ||
| var type = Base64Utils.mimeTypesMap[match[1]]; | ||
| return type === undefined ? Base64MimeType.Unknown : type; | ||
| return match ? ((_a = Base64Utils.mimeTypesMap[match[1]]) !== null && _a !== void 0 ? _a : Base64MimeType.Unknown) : Base64MimeType.Unknown; | ||
| }; | ||
@@ -448,0 +445,0 @@ Base64Utils.fromBlobAsArrayBuffer = function (blob, callback) { |
| /*! | ||
| * DevExpress Utils (dx.utils.min) | ||
| * Version: 1.0.1-alpha | ||
| * Build date: Fri Aug 28 2020 | ||
| * Version: 1.0.1-alpha-001 | ||
| * Build date: Mon Aug 31 2020 | ||
| * | ||
@@ -9,3 +9,3 @@ * Copyright (c) 2012 - 2020 Developer Express Inc. ALL RIGHTS RESERVED | ||
| */ | ||
| var DevExpress="object"==typeof DevExpress?DevExpress:{};DevExpress.WebUtils=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=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(2).__exportStar(n(3),t)},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return u})),n.d(t,"__decorate",(function(){return a})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return f})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return p})),n.d(t,"__createBinding",(function(){return s})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return y})),n.d(t,"__read",(function(){return m})),n.d(t,"__spread",(function(){return v})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return h})),n.d(t,"__asyncGenerator",(function(){return _})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return g})),n.d(t,"__importStar",(function(){return x})),n.d(t,"__importDefault",(function(){return j})),n.d(t,"__classPrivateFieldGet",(function(){return T})),n.d(t,"__classPrivateFieldSet",(function(){return S})); | ||
| var DevExpress="object"==typeof DevExpress?DevExpress:{};DevExpress.WebUtils=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=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(2).__exportStar(n(3),t)},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return i})),n.d(t,"__rest",(function(){return a})),n.d(t,"__decorate",(function(){return u})),n.d(t,"__param",(function(){return c})),n.d(t,"__metadata",(function(){return f})),n.d(t,"__awaiter",(function(){return l})),n.d(t,"__generator",(function(){return p})),n.d(t,"__createBinding",(function(){return s})),n.d(t,"__exportStar",(function(){return d})),n.d(t,"__values",(function(){return y})),n.d(t,"__read",(function(){return m})),n.d(t,"__spread",(function(){return v})),n.d(t,"__spreadArrays",(function(){return b})),n.d(t,"__await",(function(){return _})),n.d(t,"__asyncGenerator",(function(){return h})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return O})),n.d(t,"__makeTemplateObject",(function(){return g})),n.d(t,"__importStar",(function(){return x})),n.d(t,"__importDefault",(function(){return T})),n.d(t,"__classPrivateFieldGet",(function(){return j})),n.d(t,"__classPrivateFieldSet",(function(){return S})); | ||
| /*! ***************************************************************************** | ||
@@ -25,2 +25,2 @@ Copyright (c) Microsoft Corporation. | ||
| ***************************************************************************** */ | ||
| var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=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)};function u(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}function a(e,t,n,r){var o,i=arguments.length,u=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(u=(i<3?o(u):i>3?o(t,n,u):o(t,n))||u);return i>3&&u&&Object.defineProperty(t,n,u),u}function c(e,t){return function(n,r){t(n,r,e)}}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,a)}c((r=r.apply(e,t||[])).next())}))}function p(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=t.call(e,u)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var s=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]};function d(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||s(t,e,n)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function b(){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,a=i.length;u<a;u++,o++)r[o]=i[u];return r}function h(e){return this instanceof h?(this.v=e,this):new h(e)}function _(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},u("next"),u("throw"),u("return"),r[Symbol.asyncIterator]=function(){return this},r;function u(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=o[e](t)).value instanceof h?Promise.resolve(n.value.v).then(c,f):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function c(e){a("next",e)}function f(e){a("throw",e)}function l(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:h(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=y(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function g(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return P(t,e),t}function j(e){return e&&e.__esModule?e:{default:e}}function T(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Base64Utils=t.DocmMimeType=t.PlainTextMimeType=t.RtfMimeType=t.OpenXmlMimeType=t.Base64MimeType=void 0,function(e){e[e.Unknown=0]="Unknown",e[e.OpenXml=1]="OpenXml",e[e.Rtf=2]="Rtf",e[e.PlainText=3]="PlainText",e[e.Docm=4]="Docm"}(o=t.Base64MimeType||(t.Base64MimeType={})),t.OpenXmlMimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document",t.RtfMimeType="application/rtf",t.PlainTextMimeType="text/plain",t.DocmMimeType="application/vnd.ms-word.document.macroEnabled.12";var i=function(){function e(){}return e.normalize=function(t,n){return void 0===n&&(n="image/png"),e.checkPrependDataUrl(t)||(t=e.prepend(t,n)),t},e.prepend=function(e,t){return void 0===t&&(t="image/png"),"data:"+t+";base64,"+e},e.checkPrependDataUrl=function(t){return e.dataUrl.test(t)},e.getBase64WithoutUrl=function(t){return t.replace(e.dataUrl,"")},e.getArray=function(e){for(var t=(e=atob(e)).length,n=new Uint8Array(t);t--;)n[t]=e.charCodeAt(t);return n},e.fromArrayBuffer=function(e){for(var t=[],n=new Uint8Array(e),r=n.byteLength,o=0;o<r;o++)t.push(String.fromCharCode(n[o]));return window.btoa(t.join(""))},e.getFile=function(t,n){void 0===n&&(n={type:"text"});var r=e.getArray(t);return new Blob([r],n)},e.getMimeTypeAsString=function(t){var n=t.match(e.dataUrl);return n?n[1]:null},e.getKnownMimeType=function(t){var n=t.match(e.dataUrl);if(!n)return o.Unknown;var r=e.mimeTypesMap[n[1]];return void 0===r?o.Unknown:r},e.fromBlobAsArrayBuffer=function(t,n){var r=new FileReader;r.onloadend=function(){return n(e.fromArrayBuffer(r.result))},r.readAsArrayBuffer(t)},e.fromBlobAsDataUrl=function(e,t){var n=new FileReader;n.onloadend=function(){return t(n.result)},n.readAsDataURL(e)},e.mimeTypesMap=((r={})[t.OpenXmlMimeType]=o.OpenXml,r[t.RtfMimeType]=o.Rtf,r[t.PlainTextMimeType]=o.PlainText,r[t.DocmMimeType]=o.Docm,r),e.dataUrl=/^data:(.*?)(;(.*?))??(;base64)?,/,e}();t.Base64Utils=i}]); | ||
| var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=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)};function a(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}function u(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function c(e,t){return function(n,r){t(n,r,e)}}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function u(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}c((r=r.apply(e,t||[])).next())}))}function p(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var s=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]};function d(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||s(t,e,n)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function b(){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],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r}function _(e){return this instanceof _?(this.v=e,this):new _(e)}function h(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||u(e,t)}))})}function u(e,t){try{(n=o[e](t)).value instanceof _?Promise.resolve(n.value.v).then(c,f):l(i[0][2],n)}catch(e){l(i[0][3],e)}var n}function c(e){u("next",e)}function f(e){u("throw",e)}function l(e,t){e(t),i.shift(),i.length&&u(i[0][0],i[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:_(e[r](t)),done:"return"===r}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=y(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}function g(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&s(t,e,n);return P(t,e),t}function T(e){return e&&e.__esModule?e:{default:e}}function j(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),t.Base64Utils=t.DocmMimeType=t.PlainTextMimeType=t.RtfMimeType=t.OpenXmlMimeType=t.Base64MimeType=void 0,function(e){e[e.Unknown=0]="Unknown",e[e.OpenXml=1]="OpenXml",e[e.Rtf=2]="Rtf",e[e.PlainText=3]="PlainText",e[e.Docm=4]="Docm"}(o=t.Base64MimeType||(t.Base64MimeType={})),t.OpenXmlMimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document",t.RtfMimeType="application/rtf",t.PlainTextMimeType="text/plain",t.DocmMimeType="application/vnd.ms-word.document.macroEnabled.12";var i=function(){function e(){}return e.normalizeToDataUrl=function(t,n){return e.checkPrependDataUrl(t)||(t=e.prependByDataUrl(t,n)),t},e.prependByDataUrl=function(e,t){return void 0===t&&(t="image/png"),"data:"+t+";base64,"+e},e.checkPrependDataUrl=function(t){return e.dataUrl.test(t)},e.deleteDataUrlPrefix=function(t){return t.replace(e.dataUrl,"")},e.getUint8Array=function(e){for(var t=(e=atob(e)).length,n=new Uint8Array(t);t--;)n[t]=e.charCodeAt(t);return n},e.fromArrayBuffer=function(e){for(var t=[],n=new Uint8Array(e),r=n.byteLength,o=0;o<r;o++)t.push(String.fromCharCode(n[o]));return window.btoa(t.join(""))},e.getFileFromBase64=function(t,n){void 0===n&&(n={type:"text"});var r=e.getUint8Array(t);return new Blob([r],n)},e.getMimeTypeAsString=function(t){var n=t.match(e.dataUrl);return n?n[1]:null},e.getKnownMimeType=function(t){var n,r=t.match(e.dataUrl);return r&&null!==(n=e.mimeTypesMap[r[1]])&&void 0!==n?n:o.Unknown},e.fromBlobAsArrayBuffer=function(t,n){var r=new FileReader;r.onloadend=function(){return n(e.fromArrayBuffer(r.result))},r.readAsArrayBuffer(t)},e.fromBlobAsDataUrl=function(e,t){var n=new FileReader;n.onloadend=function(){return t(n.result)},n.readAsDataURL(e)},e.mimeTypesMap=((r={})[t.OpenXmlMimeType]=o.OpenXml,r[t.RtfMimeType]=o.Rtf,r[t.PlainTextMimeType]=o.PlainText,r[t.DocmMimeType]=o.Docm,r),e.dataUrl=/^data:(.*?)(;(.*?))??(;base64)?,/,e}();t.Base64Utils=i}]); |
@@ -9,3 +9,5 @@ "use strict"; | ||
| Object.defineProperty(StringOnpItertor.prototype, "length", { | ||
| get: function () { return this.str.length; }, | ||
| get: function () { | ||
| return this.str.length; | ||
| }, | ||
| enumerable: false, | ||
@@ -12,0 +14,0 @@ configurable: true |
+1
-1
| { | ||
| "name": "devexpress-utils", | ||
| "version": "1.0.1-alpha", | ||
| "version": "1.0.1-alpha-001", | ||
| "description": "DevExpress utils", | ||
@@ -5,0 +5,0 @@ "author": "DevExpress Inc.", |
| export declare enum Base64MimeType { | ||
| Unknown = 0, | ||
| OpenXml = 1, | ||
| Rtf = 2, | ||
| PlainText = 3, | ||
| Docm = 4 | ||
| } | ||
| export declare const OpenXmlMimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; | ||
| export declare const RtfMimeType = "application/rtf"; | ||
| export declare const PlainTextMimeType = "text/plain"; | ||
| export declare const DocmMimeType = "application/vnd.ms-word.document.macroEnabled.12"; | ||
| export declare class Base64Utils { | ||
| private static mimeTypesMap; | ||
| static dataUrl: RegExp; | ||
| static normalize(base64: string, mimeType?: string): string; | ||
| static prepend(base64: string, mimeType?: string): string; | ||
| static checkPrependDataUrl(base64: string): boolean; | ||
| static getBase64WithoutUrl(base64url: string): string; | ||
| static getArray(base64: string): Uint8Array; | ||
| static fromArrayBuffer(buffer: ArrayBuffer): string; | ||
| static getFile(base64: string, blobOptions?: BlobPropertyBag): File; | ||
| static getMimeTypeAsString(base64: string): string | null; | ||
| static getKnownMimeType(base64: string): Base64MimeType; | ||
| static fromBlobAsArrayBuffer(blob: Blob, callback: (base64: string) => void): void; | ||
| static fromBlobAsDataUrl(blob: Blob, callback: (base64: string) => void): void; | ||
| } | ||
| //# sourceMappingURL=base64utils.d.ts.map |
| "use strict"; | ||
| var _a; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.Base64Utils = exports.DocmMimeType = exports.PlainTextMimeType = exports.RtfMimeType = exports.OpenXmlMimeType = exports.Base64MimeType = void 0; | ||
| var Base64MimeType; | ||
| (function (Base64MimeType) { | ||
| Base64MimeType[Base64MimeType["Unknown"] = 0] = "Unknown"; | ||
| Base64MimeType[Base64MimeType["OpenXml"] = 1] = "OpenXml"; | ||
| Base64MimeType[Base64MimeType["Rtf"] = 2] = "Rtf"; | ||
| Base64MimeType[Base64MimeType["PlainText"] = 3] = "PlainText"; | ||
| Base64MimeType[Base64MimeType["Docm"] = 4] = "Docm"; | ||
| })(Base64MimeType = exports.Base64MimeType || (exports.Base64MimeType = {})); | ||
| exports.OpenXmlMimeType = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; | ||
| exports.RtfMimeType = 'application/rtf'; | ||
| exports.PlainTextMimeType = 'text/plain'; | ||
| exports.DocmMimeType = 'application/vnd.ms-word.document.macroEnabled.12'; | ||
| var Base64Utils = (function () { | ||
| function Base64Utils() { | ||
| } | ||
| Base64Utils.normalize = function (base64, mimeType) { | ||
| if (mimeType === void 0) { mimeType = 'image/png'; } | ||
| if (!Base64Utils.checkPrependDataUrl(base64)) | ||
| base64 = Base64Utils.prepend(base64, mimeType); | ||
| return base64; | ||
| }; | ||
| Base64Utils.prepend = function (base64, mimeType) { | ||
| if (mimeType === void 0) { mimeType = 'image/png'; } | ||
| return "data:" + mimeType + ";base64," + base64; | ||
| }; | ||
| Base64Utils.checkPrependDataUrl = function (base64) { | ||
| return Base64Utils.dataUrl.test(base64); | ||
| }; | ||
| Base64Utils.getBase64WithoutUrl = function (base64url) { | ||
| return base64url.replace(Base64Utils.dataUrl, ''); | ||
| }; | ||
| Base64Utils.getArray = function (base64) { | ||
| base64 = atob(base64); | ||
| var n = base64.length; | ||
| var arr = new Uint8Array(n); | ||
| while (n--) | ||
| arr[n] = base64.charCodeAt(n); | ||
| return arr; | ||
| }; | ||
| Base64Utils.fromArrayBuffer = function (buffer) { | ||
| var binary = []; | ||
| var bytes = new Uint8Array(buffer); | ||
| var len = bytes.byteLength; | ||
| for (var i = 0; i < len; i++) | ||
| binary.push(String.fromCharCode(bytes[i])); | ||
| return window.btoa(binary.join('')); | ||
| }; | ||
| Base64Utils.getFile = function (base64, blobOptions) { | ||
| if (blobOptions === void 0) { blobOptions = { type: 'text' }; } | ||
| var data = Base64Utils.getArray(base64); | ||
| return (new Blob([data], blobOptions)); | ||
| }; | ||
| Base64Utils.getMimeTypeAsString = function (base64) { | ||
| var match = base64.match(Base64Utils.dataUrl); | ||
| return match ? match[1] : null; | ||
| }; | ||
| Base64Utils.getKnownMimeType = function (base64) { | ||
| var match = base64.match(Base64Utils.dataUrl); | ||
| if (!match) | ||
| return Base64MimeType.Unknown; | ||
| var type = Base64Utils.mimeTypesMap[match[1]]; | ||
| return type === undefined ? Base64MimeType.Unknown : type; | ||
| }; | ||
| Base64Utils.fromBlobAsArrayBuffer = function (blob, callback) { | ||
| var reader = new FileReader(); | ||
| reader.onloadend = function () { return callback(Base64Utils.fromArrayBuffer(reader.result)); }; | ||
| reader.readAsArrayBuffer(blob); | ||
| }; | ||
| Base64Utils.fromBlobAsDataUrl = function (blob, callback) { | ||
| var reader = new FileReader(); | ||
| reader.onloadend = function () { return callback(reader.result); }; | ||
| reader.readAsDataURL(blob); | ||
| }; | ||
| Base64Utils.mimeTypesMap = (_a = {}, | ||
| _a[exports.OpenXmlMimeType] = Base64MimeType.OpenXml, | ||
| _a[exports.RtfMimeType] = Base64MimeType.Rtf, | ||
| _a[exports.PlainTextMimeType] = Base64MimeType.PlainText, | ||
| _a[exports.DocmMimeType] = Base64MimeType.Docm, | ||
| _a); | ||
| Base64Utils.dataUrl = /^data:(.*?)(;(.*?))??(;base64)?,/; | ||
| return Base64Utils; | ||
| }()); | ||
| exports.Base64Utils = Base64Utils; |
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
67904
30.35%24
100%1410
47.03%