gl-w-frontend
Advanced tools
Comparing version 2.1.3 to 2.1.4
@@ -9,2 +9,3 @@ export * from './scripts/core/services/array/core-services-array.service'; | ||
export * from './scripts/core/services/input/core-services-input.service'; | ||
export * from './scripts/core/services/internationalization/core-services-internationalization.service'; | ||
export * from './scripts/core/services/string/core-services-string.service'; | ||
@@ -22,2 +23,3 @@ export * from './scripts/core/services/url/core-services-url.service'; | ||
export * from './scripts/core/services/input/core-services-input.interface'; | ||
export * from './scripts/core/services/internationalization/core-services-internationalization.interface'; | ||
export * from './scripts/core/services/menu/core-services-menu.interfaces'; | ||
@@ -24,0 +26,0 @@ export * from './scripts/core/services/string/core-services-string-interface'; |
@@ -9,2 +9,3 @@ export * from './scripts/core/services/array/core-services-array.service'; | ||
export * from './scripts/core/services/input/core-services-input.service'; | ||
export * from './scripts/core/services/internationalization/core-services-internationalization.service'; | ||
export * from './scripts/core/services/string/core-services-string.service'; | ||
@@ -16,2 +17,15 @@ export * from './scripts/core/services/url/core-services-url.service'; | ||
export * from './scripts/statics/fonts/statics.font.static'; | ||
export * from './scripts/core/services/browser/core-services-browser.interface'; | ||
export * from './scripts/core/services/combobox/core-services-combobox.interface'; | ||
export * from './scripts/core/services/date/core-services-date.interface'; | ||
export * from './scripts/core/services/date/core-services-date.interface'; | ||
export * from './scripts/core/services/elements/core-services-elements.interface'; | ||
export * from './scripts/core/services/input/core-services-input.interface'; | ||
export * from './scripts/core/services/internationalization/core-services-internationalization.interface'; | ||
export * from './scripts/core/services/menu/core-services-menu.interfaces'; | ||
export * from './scripts/core/services/string/core-services-string-interface'; | ||
export * from './scripts/services/export/excel/services-export-excel.interface'; | ||
export * from './scripts/statics/alignment/statics.alignment.interface'; | ||
export * from './scripts/statics/colors/statics.color.interface'; | ||
export * from './scripts/statics/fonts/statics.font.interface'; | ||
//# sourceMappingURL=bundle.js.map |
@@ -1,1 +0,1 @@ | ||
export*from"./scripts/core/services/array/core-services-array.service";export*from"./scripts/core/services/attachment/core-services-attachment.service";export*from"./scripts/core/services/browser/core-services-browser.service";export*from"./scripts/core/services/combobox/core-services-combobox.service";export*from"./scripts/core/services/date/core-services-date.service";export*from"./scripts/core/services/elements/core-services-elements.service";export*from"./scripts/core/services/image/core-services-image.service";export*from"./scripts/core/services/input/core-services-input.service";export*from"./scripts/core/services/string/core-services-string.service";export*from"./scripts/core/services/url/core-services-url.service";export*from"./scripts/services/export/excel/services-export-excel.service";export*from"./scripts/statics/alignment/statics.alignment.static";export*from"./scripts/statics/colors/statics.color.static";export*from"./scripts/statics/fonts/statics.font.static"; | ||
export*from"./scripts/core/services/array/core-services-array.service";export*from"./scripts/core/services/attachment/core-services-attachment.service";export*from"./scripts/core/services/browser/core-services-browser.service";export*from"./scripts/core/services/combobox/core-services-combobox.service";export*from"./scripts/core/services/date/core-services-date.service";export*from"./scripts/core/services/elements/core-services-elements.service";export*from"./scripts/core/services/image/core-services-image.service";export*from"./scripts/core/services/input/core-services-input.service";export*from"./scripts/core/services/internationalization/core-services-internationalization.service";export*from"./scripts/core/services/string/core-services-string.service";export*from"./scripts/core/services/url/core-services-url.service";export*from"./scripts/services/export/excel/services-export-excel.service";export*from"./scripts/statics/alignment/statics.alignment.static";export*from"./scripts/statics/colors/statics.color.static";export*from"./scripts/statics/fonts/statics.font.static";export*from"./scripts/core/services/browser/core-services-browser.interface";export*from"./scripts/core/services/combobox/core-services-combobox.interface";export*from"./scripts/core/services/date/core-services-date.interface";export*from"./scripts/core/services/date/core-services-date.interface";export*from"./scripts/core/services/elements/core-services-elements.interface";export*from"./scripts/core/services/input/core-services-input.interface";export*from"./scripts/core/services/internationalization/core-services-internationalization.interface";export*from"./scripts/core/services/menu/core-services-menu.interfaces";export*from"./scripts/core/services/string/core-services-string-interface";export*from"./scripts/services/export/excel/services-export-excel.interface";export*from"./scripts/statics/alignment/statics.alignment.interface";export*from"./scripts/statics/colors/statics.color.interface";export*from"./scripts/statics/fonts/statics.font.interface"; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-attachment.interface.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-browser.interface.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-combobox.interface.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-date.interface.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-elements.interface.js.map |
@@ -28,5 +28,4 @@ import { DateValidation } from '../date/core-services-date.service'; | ||
clearError(field) { | ||
var _a; | ||
if (typeof (field) === 'object') { | ||
(_a = field) === null || _a === void 0 ? void 0 : _a.classList.remove('required-fill'); | ||
field === null || field === void 0 ? void 0 : field.classList.remove('required-fill'); | ||
} | ||
@@ -33,0 +32,0 @@ else { |
@@ -1,1 +0,1 @@ | ||
import{DateValidation}from"../date/core-services-date.service";class Remove{childElements(elementClassId){if(typeof elementClassId==="string"){const element=document.querySelector(elementClassId);if(element!=null){while(element.firstChild){element.removeChild(element.firstChild)}}}else{while(elementClassId.firstChild){elementClassId.removeChild(elementClassId.firstChild)}}}}export const ElementRemove=new Remove;class Selector{element(className){return document.querySelector(className)}}export const ElementSelector=new Selector;class Highlight{clearError(field){var _a;if(typeof field==="object"){(_a=field)===null||_a===void 0?void 0:_a.classList.remove("required-fill")}else{if(field!=null){const currentField=document.querySelector(field);if(currentField!=null){currentField.classList.remove("required-fill")}}}}error(fieldHighlighted){if(fieldHighlighted!=null){fieldHighlighted.classList.add("required-fill");fieldHighlighted.focus()}}invalidDate(date,input){if(DateValidation.date(date)){input.classList.remove("error-highlight")}else{input.classList.add("error-highlight")}}setError(field){if(field!=null){field.classList.add("required-fill");field.focus()}}}export const ElementHighlight=new Highlight; | ||
import{DateValidation}from"../date/core-services-date.service";class Remove{childElements(elementClassId){if(typeof elementClassId==="string"){const element=document.querySelector(elementClassId);if(element!=null){while(element.firstChild){element.removeChild(element.firstChild)}}}else{while(elementClassId.firstChild){elementClassId.removeChild(elementClassId.firstChild)}}}}export const ElementRemove=new Remove;class Selector{element(className){return document.querySelector(className)}}export const ElementSelector=new Selector;class Highlight{clearError(field){if(typeof field==="object"){field===null||field===void 0?void 0:field.classList.remove("required-fill")}else{if(field!=null){const currentField=document.querySelector(field);if(currentField!=null){currentField.classList.remove("required-fill")}}}}error(fieldHighlighted){if(fieldHighlighted!=null){fieldHighlighted.classList.add("required-fill");fieldHighlighted.focus()}}invalidDate(date,input){if(DateValidation.date(date)){input.classList.remove("error-highlight")}else{input.classList.add("error-highlight")}}setError(field){if(field!=null){field.classList.add("required-fill");field.focus()}}}export const ElementHighlight=new Highlight; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-image.interface.js.map |
class Resize { | ||
base64(data) { | ||
var _a, _b; | ||
const base64 = data.image; | ||
@@ -27,6 +26,6 @@ const quality = data.quality == null ? 1.0 : data.quality; | ||
canvasCopy.height = img.height; | ||
(_a = copyContext) === null || _a === void 0 ? void 0 : _a.drawImage(img, 0, 0); | ||
copyContext === null || copyContext === void 0 ? void 0 : copyContext.drawImage(img, 0, 0); | ||
canvas.width = img.width * ratio; | ||
canvas.height = img.height * ratio; | ||
(_b = ctx) === null || _b === void 0 ? void 0 : _b.drawImage(canvasCopy, 0, 0, canvasCopy.width, canvasCopy.height, 0, 0, canvas.width, canvas.height); | ||
ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(canvasCopy, 0, 0, canvasCopy.width, canvasCopy.height, 0, 0, canvas.width, canvas.height); | ||
return canvas.toDataURL('image/jpeg', quality); | ||
@@ -33,0 +32,0 @@ } |
@@ -1,1 +0,1 @@ | ||
class Resize{base64(data){var _a,_b;const base64=data.image;const quality=data.quality==null?1:data.quality;let maxWidth=data.maxWidth;let maxHeight=data.maxHeight;if(typeof maxWidth==="undefined")maxWidth=1024;if(typeof maxHeight==="undefined")maxHeight=1024;const canvas=document.createElement("canvas");const ctx=canvas.getContext("2d");const canvasCopy=document.createElement("canvas");const copyContext=canvasCopy.getContext("2d");const img=new Image;img.src=base64;let ratio=1;if(img.width>maxWidth){ratio=maxWidth/img.width}else if(img.height>maxHeight){ratio=maxHeight/img.height}canvasCopy.width=img.width;canvasCopy.height=img.height;(_a=copyContext)===null||_a===void 0?void 0:_a.drawImage(img,0,0);canvas.width=img.width*ratio;canvas.height=img.height*ratio;(_b=ctx)===null||_b===void 0?void 0:_b.drawImage(canvasCopy,0,0,canvasCopy.width,canvasCopy.height,0,0,canvas.width,canvas.height);return canvas.toDataURL("image/jpeg",quality)}}export const ImageResize=new Resize; | ||
class Resize{base64(data){const base64=data.image;const quality=data.quality==null?1:data.quality;let maxWidth=data.maxWidth;let maxHeight=data.maxHeight;if(typeof maxWidth==="undefined")maxWidth=1024;if(typeof maxHeight==="undefined")maxHeight=1024;const canvas=document.createElement("canvas");const ctx=canvas.getContext("2d");const canvasCopy=document.createElement("canvas");const copyContext=canvasCopy.getContext("2d");const img=new Image;img.src=base64;let ratio=1;if(img.width>maxWidth){ratio=maxWidth/img.width}else if(img.height>maxHeight){ratio=maxHeight/img.height}canvasCopy.width=img.width;canvasCopy.height=img.height;copyContext===null||copyContext===void 0?void 0:copyContext.drawImage(img,0,0);canvas.width=img.width*ratio;canvas.height=img.height*ratio;ctx===null||ctx===void 0?void 0:ctx.drawImage(canvasCopy,0,0,canvasCopy.width,canvasCopy.height,0,0,canvas.width,canvas.height);return canvas.toDataURL("image/jpeg",quality)}}export const ImageResize=new Resize; |
export interface IInputMaskOptions { | ||
prefix: string; | ||
prefix?: string; | ||
suffix?: string; | ||
@@ -10,2 +10,3 @@ allowMinus: boolean; | ||
} | ||
export declare type ICurrencyTypes = 'million-currency' | 'currency'; | ||
export declare type TCurrencyTypes = 'million-currency' | 'currency'; | ||
export declare type TPercentageTypes = 'percentage'; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-input.interface.js.map |
@@ -1,4 +0,8 @@ | ||
import { ICurrencyTypes } from './core-services-input.interface'; | ||
import { TCurrencyTypes } from './core-services-input.interface'; | ||
import { TDecimalSeparators } from '../string/core-services-string-interface'; | ||
declare class Mask { | ||
currency(field: HTMLInputElement, type?: ICurrencyTypes, currencySymbol?: string): string; | ||
currency(field: HTMLInputElement, type?: TCurrencyTypes, currencySymbol?: string): string; | ||
percentage(field: HTMLInputElement, allowMinus?: boolean, decimalSeparator?: TDecimalSeparators, rightAlign?: boolean, step?: number): string; | ||
numeric(field: HTMLInputElement, allowMinus?: boolean, decimalSeparator?: TDecimalSeparators, rightAlign?: boolean, step?: number): string; | ||
integer(field: HTMLInputElement, allowMinus?: boolean, rightAlign?: boolean, step?: number): string; | ||
remove(field: HTMLInputElement): void; | ||
@@ -5,0 +9,0 @@ } |
@@ -18,2 +18,47 @@ import Inputmask from 'inputmask'; | ||
} | ||
percentage(field, allowMinus = true, decimalSeparator = ',', rightAlign = true, step = 5) { | ||
const symbol = '%'; | ||
const mask = `0,00${symbol}`; | ||
const groupSeparator = decimalSeparator === ',' ? '.' : ','; | ||
Inputmask({ | ||
alias: 'numeric', | ||
suffix: `${symbol} `, | ||
numericInput: true, | ||
allowMinus, | ||
rightAlign, | ||
radixPoint: decimalSeparator, | ||
groupSeparator, | ||
step, | ||
placeholder: mask | ||
}).mask(field); | ||
return mask; | ||
} | ||
numeric(field, allowMinus = true, decimalSeparator = ',', rightAlign = true, step = 1) { | ||
const mask = `0,00`; | ||
const groupSeparator = decimalSeparator === ',' ? '.' : ','; | ||
Inputmask({ | ||
alias: 'numeric', | ||
numericInput: true, | ||
allowMinus, | ||
rightAlign, | ||
radixPoint: decimalSeparator, | ||
groupSeparator, | ||
step, | ||
placeholder: mask | ||
}).mask(field); | ||
return mask; | ||
} | ||
integer(field, allowMinus = true, rightAlign = false, step = 1) { | ||
const mask = `0`; | ||
Inputmask({ | ||
alias: 'integer', | ||
numericInput: true, | ||
inputmode: 'numeric', | ||
allowMinus, | ||
rightAlign, | ||
step, | ||
placeholder: mask | ||
}).mask(field); | ||
return mask; | ||
} | ||
remove(field) { | ||
@@ -20,0 +65,0 @@ Inputmask.remove(field); |
@@ -1,1 +0,1 @@ | ||
import Inputmask from"inputmask";class Mask{currency(field,type="currency",currencySymbol="R$"){let options;let mask;if(type==="million-currency"){mask=`${currencySymbol} 0,00mn`;options={prefix:`${currencySymbol} `,suffix:"mn",allowMinus:true}}else{mask=`${currencySymbol} 0,00`;options={prefix:`${currencySymbol} `,numericInput:true,allowMinus:true,rightAlign:false,radixPoint:",",groupSeparator:"."}}const im=new Inputmask("currency",options);im.mask(field);return mask}remove(field){Inputmask.remove(field)}}export const InputMask=new Mask; | ||
import Inputmask from"inputmask";class Mask{currency(field,type="currency",currencySymbol="R$"){let options;let mask;if(type==="million-currency"){mask=`${currencySymbol} 0,00mn`;options={prefix:`${currencySymbol} `,suffix:"mn",allowMinus:true}}else{mask=`${currencySymbol} 0,00`;options={prefix:`${currencySymbol} `,numericInput:true,allowMinus:true,rightAlign:false,radixPoint:",",groupSeparator:"."}}const im=new Inputmask("currency",options);im.mask(field);return mask}percentage(field,allowMinus=true,decimalSeparator=",",rightAlign=true,step=5){const symbol="%";const mask=`0,00${symbol}`;const groupSeparator=decimalSeparator===","?".":",";Inputmask({alias:"numeric",suffix:`${symbol} `,numericInput:true,allowMinus:allowMinus,rightAlign:rightAlign,radixPoint:decimalSeparator,groupSeparator:groupSeparator,step:step,placeholder:mask}).mask(field);return mask}numeric(field,allowMinus=true,decimalSeparator=",",rightAlign=true,step=1){const mask=`0,00`;const groupSeparator=decimalSeparator===","?".":",";Inputmask({alias:"numeric",numericInput:true,allowMinus:allowMinus,rightAlign:rightAlign,radixPoint:decimalSeparator,groupSeparator:groupSeparator,step:step,placeholder:mask}).mask(field);return mask}integer(field,allowMinus=true,rightAlign=false,step=1){const mask=`0`;Inputmask({alias:"integer",numericInput:true,inputmode:"numeric",allowMinus:allowMinus,rightAlign:rightAlign,step:step,placeholder:mask}).mask(field);return mask}remove(field){Inputmask.remove(field)}}export const InputMask=new Mask; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-menu.interfaces.js.map |
@@ -1,1 +0,3 @@ | ||
export declare type ICurrencyNames = 'euro' | 'dolar' | 'real' | 'peso' | 'peso-ar' | 'pounds-sterling' | 'canadian-dollars' | 'yuan' | 'rupee' | 'yen'; | ||
export declare type TCurrencyNames = 'euro' | 'dolar' | 'real' | 'peso' | 'peso-ar' | 'pounds-sterling' | 'canadian-dollars' | 'yuan' | 'rupee' | 'yen'; | ||
export declare type TCurrencySymbolTypes = 'Ar$' | 'R$' | '€' | 'US$'; | ||
export declare type TDecimalSeparators = '.' | ','; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=core-services-string-interface.js.map |
@@ -1,2 +0,2 @@ | ||
import { ICurrencyNames } from './core-services-string-interface'; | ||
import { TCurrencyNames, TCurrencySymbolTypes, TDecimalSeparators } from './core-services-string-interface'; | ||
declare class Clean { | ||
@@ -12,5 +12,9 @@ trim(text: string): string; | ||
declare class Converter { | ||
currencyToNumber(num: number, decimal?: string, currency?: string): number; | ||
currencyNameToSymbol(currency: ICurrencyNames): string; | ||
formatNumber(num: number, decimal?: string): string; | ||
percentageToNumber(num: string, decimal?: TDecimalSeparators): number; | ||
numberToPercentage(num: number, includeSymbol?: boolean, separator?: TDecimalSeparators): string; | ||
currencyToNumber(num: number, decimal?: TDecimalSeparators, currency?: TCurrencySymbolTypes): number; | ||
stringCurrencyToNumber(num: string, decimal: "." | "," | undefined, currency: TCurrencySymbolTypes): number; | ||
currencyNameToSymbol(currency: TCurrencyNames): string; | ||
decimalNumberToString(num: number, decimalOutput?: TDecimalSeparators): string; | ||
formatNumber(num: number, decimal?: TDecimalSeparators): string; | ||
numberToString(number: number): string; | ||
@@ -17,0 +21,0 @@ stringToBoolean(value: string): boolean; |
@@ -58,2 +58,14 @@ import { UrlDecode } from '../url/core-services-url.service'; | ||
class Converter { | ||
percentageToNumber(num, decimal = ',') { | ||
return parseFloat(num | ||
.replace(/\./g, '') | ||
.replace(decimal, '.') | ||
.replace('% ', '')) / 100.0; | ||
} | ||
numberToPercentage(num, includeSymbol = true, separator = ',') { | ||
const parsedNumber = num * 100.0; | ||
const parsedString = parsedNumber.toString().replace('.', separator); | ||
const symbol = includeSymbol ? '%' : ''; | ||
return `${parsedString}${symbol}`; | ||
} | ||
currencyToNumber(num, decimal = ',', currency) { | ||
@@ -77,2 +89,9 @@ if (currency != null) { | ||
} | ||
stringCurrencyToNumber(num, decimal = ',', currency) { | ||
return parseFloat(num | ||
.replace(/\./g, '') | ||
.replace(',', '.') | ||
.replace(' ', '') | ||
.replace(currency, '')); | ||
} | ||
currencyNameToSymbol(currency) { | ||
@@ -93,2 +112,8 @@ switch (currency) { | ||
} | ||
decimalNumberToString(num, decimalOutput = '.') { | ||
const value = Math.round((num + Number.EPSILON) * 100.0) / 100.0; | ||
return value | ||
.toString() | ||
.replace('.', decimalOutput); | ||
} | ||
formatNumber(num, decimal = '.') { | ||
@@ -95,0 +120,0 @@ const separator = decimal === '.' ? '$1.' : '$1,'; |
@@ -1,1 +0,1 @@ | ||
import{UrlDecode}from"../url/core-services-url.service";class Clean{trim(text){if(text==null){return""}else{const between=/^\s*|\s*$/g;const middle=/\s\s+/g;return text.replace(between,"").replace(middle," ")}}trimLeft(text){if(text==null){return""}else{const between=/^\s*/g;return text.replace(between,"")}}trimRight(text){if(text==null){return""}else{const between=/\s*$/g;return text.replace(between,"")}}trimBetween(text){if(text==null){return""}else{const between=/^\s*|\s*$/g;return text.replace(between,"")}}trimMiddle(text){if(text==null){return""}else{const middle=/\s\s+/g;return text.replace(middle," ")}}cleanText(string){string=this.trim(string);return UrlDecode.decodeHtmlText(StringConverter.stringUnicode(string).trim())}}export const StringClean=new Clean;class Converter{currencyToNumber(num,decimal=",",currency){if(currency!=null){return parseFloat(num.toString().replace(/\./g,"").replace(",",".").replace(" ","").replace(currency,""))}else{return parseFloat(num.toString().replace(/\./g,"").replace(",",".").replace("Ar$ ","").replace("R$ ","").replace("€ ","").replace("US$ ",""))}}currencyNameToSymbol(currency){switch(currency){case"euro":return"€";case"dolar":return"US$";case"peso":return"$";case"peso-ar":return"Ar$";case"real":return"R$";case"pounds-sterling":return"£";case"canadian-dollars":return"$";case"yuan":return"¥";case"rupee":return"₹";case"yen":return"¥";default:return"R$"}}formatNumber(num,decimal="."){const separator=decimal==="."?"$1.":"$1,";return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,separator)}numberToString(number){const maxLength=number.toString().length;if(maxLength<3){if(number<10){return"0"+number}else{return number.toString()}}else if(maxLength<4){if(number<10){return"00"+number}else if(number<100){return"0"+number}else{return number.toString()}}else if(maxLength<5){if(number<10){return"000"+number}else if(number<100){return"00"+number}else if(number<1e3){return"0"+number}else{return number.toString()}}else if(maxLength<6){if(number<10){return"0000"+number}else if(number<100){return"000"+number}else if(number<1e3){return"00"+number}else if(number<1e4){return"0"+number}else{return number.toString()}}else{return number.toString()}}stringToBoolean(value){switch(value){case"true":return true;case"false":return false;case"null":case null:return false;default:return true}}stringUnicode(string){try{return string.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}catch(e){return UrlDecode.decodeHtmlText(string)}}titleCase(string){const splitStr=string.toLowerCase().split(" ");for(let i=0;i<splitStr.length;i++){splitStr[i]=splitStr[i].charAt(0).toUpperCase()+splitStr[i].substring(1)}return splitStr.join(" ")}}export const StringConverter=new Converter; | ||
import{UrlDecode}from"../url/core-services-url.service";class Clean{trim(text){if(text==null){return""}else{const between=/^\s*|\s*$/g;const middle=/\s\s+/g;return text.replace(between,"").replace(middle," ")}}trimLeft(text){if(text==null){return""}else{const between=/^\s*/g;return text.replace(between,"")}}trimRight(text){if(text==null){return""}else{const between=/\s*$/g;return text.replace(between,"")}}trimBetween(text){if(text==null){return""}else{const between=/^\s*|\s*$/g;return text.replace(between,"")}}trimMiddle(text){if(text==null){return""}else{const middle=/\s\s+/g;return text.replace(middle," ")}}cleanText(string){string=this.trim(string);return UrlDecode.decodeHtmlText(StringConverter.stringUnicode(string).trim())}}export const StringClean=new Clean;class Converter{percentageToNumber(num,decimal=","){return parseFloat(num.replace(/\./g,"").replace(decimal,".").replace("% ",""))/100}numberToPercentage(num,includeSymbol=true,separator=","){const parsedNumber=num*100;const parsedString=parsedNumber.toString().replace(".",separator);const symbol=includeSymbol?"%":"";return`${parsedString}${symbol}`}currencyToNumber(num,decimal=",",currency){if(currency!=null){return parseFloat(num.toString().replace(/\./g,"").replace(",",".").replace(" ","").replace(currency,""))}else{return parseFloat(num.toString().replace(/\./g,"").replace(",",".").replace("Ar$ ","").replace("R$ ","").replace("€ ","").replace("US$ ",""))}}stringCurrencyToNumber(num,decimal=",",currency){return parseFloat(num.replace(/\./g,"").replace(",",".").replace(" ","").replace(currency,""))}currencyNameToSymbol(currency){switch(currency){case"euro":return"€";case"dolar":return"US$";case"peso":return"$";case"peso-ar":return"Ar$";case"real":return"R$";case"pounds-sterling":return"£";case"canadian-dollars":return"$";case"yuan":return"¥";case"rupee":return"₹";case"yen":return"¥";default:return"R$"}}decimalNumberToString(num,decimalOutput="."){const value=Math.round((num+Number.EPSILON)*100)/100;return value.toString().replace(".",decimalOutput)}formatNumber(num,decimal="."){const separator=decimal==="."?"$1.":"$1,";return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,separator)}numberToString(number){const maxLength=number.toString().length;if(maxLength<3){if(number<10){return"0"+number}else{return number.toString()}}else if(maxLength<4){if(number<10){return"00"+number}else if(number<100){return"0"+number}else{return number.toString()}}else if(maxLength<5){if(number<10){return"000"+number}else if(number<100){return"00"+number}else if(number<1e3){return"0"+number}else{return number.toString()}}else if(maxLength<6){if(number<10){return"0000"+number}else if(number<100){return"000"+number}else if(number<1e3){return"00"+number}else if(number<1e4){return"0"+number}else{return number.toString()}}else{return number.toString()}}stringToBoolean(value){switch(value){case"true":return true;case"false":return false;case"null":case null:return false;default:return true}}stringUnicode(string){try{return string.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}catch(e){return UrlDecode.decodeHtmlText(string)}}titleCase(string){const splitStr=string.toLowerCase().split(" ");for(let i=0;i<splitStr.length;i++){splitStr[i]=splitStr[i].charAt(0).toUpperCase()+splitStr[i].substring(1)}return splitStr.join(" ")}}export const StringConverter=new Converter; |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=services-export-excel.interface.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=statics.alignment.interface.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=statics.color.interface.js.map |
@@ -0,1 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=statics.font.interface.js.map |
{ | ||
"name": "gl-w-frontend", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "Common code for using among web front-end development such as ES6+ and TypeScript", | ||
@@ -56,19 +56,19 @@ "main": "lib/bundle.js", | ||
"inputmask": "^5.0.5", | ||
"moment": "^2.29.0", | ||
"moment": "^2.29.1", | ||
"moment-range": "^4.0.2", | ||
"rxjs": "^6.6.2", | ||
"rxjs": "^6.6.3", | ||
"screenfull": "^5.0.2", | ||
"xlsx": "^0.16.7" | ||
"xlsx": "^0.16.8" | ||
}, | ||
"devDependencies": { | ||
"@types/inputmask": "^4.0.1", | ||
"@types/node": "^14.0.11", | ||
"@typescript-eslint/eslint-plugin": "^3.1.0", | ||
"@typescript-eslint/eslint-plugin-tslint": "^3.1.0", | ||
"@typescript-eslint/parser": "^3.1.0", | ||
"eslint": "^7.1.0", | ||
"shx": "^0.3.2", | ||
"tslint": "^6.1.2", | ||
"typescript": "~3.7.5" | ||
"@types/inputmask": "^4.0.2", | ||
"@types/node": "^14.14.7", | ||
"@typescript-eslint/eslint-plugin": "^4.8.1", | ||
"@typescript-eslint/eslint-plugin-tslint": "^4.8.1", | ||
"@typescript-eslint/parser": "^4.8.1", | ||
"eslint": "^7.13.0", | ||
"shx": "^0.3.3", | ||
"tslint": "^6.1.3", | ||
"typescript": "^4.0.5" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
323809
145
3643
Updatedmoment@^2.29.1
Updatedrxjs@^6.6.3
Updatedxlsx@^0.16.8