UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

88 lines (87 loc) 2.91 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { Base, markType } from "./type"; import { stringIsNullOrEmpty, stringEndsWith, stringStartsWith } from "./string"; /** * @hidden */ export let ImageLoadParam = /*@__PURE__*/ (() => { class ImageLoadParam extends Base { constructor() { super(); this._prefix = null; this._suffix = null; this._value = null; this.value = ""; this.suffix = ""; this.prefix = ""; } get prefix() { return this._prefix; } set prefix(a) { this._prefix = a; } get suffix() { return this._suffix; } set suffix(a) { this._suffix = a; } get value() { return this._value; } set value(a) { this._value = a; } static a(a, b, c) { let d = new ImageLoadParam(); if (stringIsNullOrEmpty(a)) { return d; } if (stringIsNullOrEmpty(b) || stringIsNullOrEmpty(c)) { d.value = a; return d; } let e = a.indexOf(b); if (e != -1) { let f = a.indexOf(c, e + 1); if (f != -1) { let g = f - e - 1; d.value = a.substr(e + 1, g); d.suffix = a.substr(f + 1); d.prefix = a.substr(0, e); } } else { d.value = a; } return d; } b(a) { let b = ""; if (!stringIsNullOrEmpty(this.prefix)) { b = this.prefix; } if (!stringIsNullOrEmpty(a)) { if (!stringIsNullOrEmpty(this.prefix) && !stringEndsWith(this.prefix, "/")) { b += "/"; } b += a; } if (!stringIsNullOrEmpty(this.suffix)) { if (!stringEndsWith(b, ".") && !stringStartsWith(this.suffix, ".")) { b += "."; } b += this.suffix; } return b; } } ImageLoadParam.$t = markType(ImageLoadParam, 'ImageLoadParam'); return ImageLoadParam; })();