Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gl-w-frontend

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-w-frontend - npm Package Compare versions

Comparing version 1.3.5 to 1.3.6

lib/esm/scripts/core/services/date/core-services-date.interface.d.ts

60

lib/esm/index.d.ts

@@ -0,1 +1,2 @@

/// <reference types="moment-range" />
declare const Array: {

@@ -62,5 +63,62 @@ removeArrayDuplicateLegacy: (array: any[]) => any[];

};
declare const Date: {
customDate: (date: import("moment").MomentInput, format: string) => string;
currentDate: (outputFormat?: string) => string;
dayMonthYear: (date: import("moment").MomentInput, format?: string) => import("./scripts/core/services/date/core-services-date.interface").IDayMonthYear;
localDate: (year: number, month: number, day: number, local?: import("./scripts/core/services/date/core-services-date.interface").IDateLocal) => string;
dateFromIso: (date: import("moment").MomentInput, format?: string) => string;
ganttDate: (date: import("moment").MomentInput) => Date;
isoDateCustom: (date: import("moment").MomentInput, dateFormat: string, outputFormat: string) => string;
isoDate: (date: import("moment").MomentInput, format?: string) => string;
isoDateWithoutTime: (date: import("moment").MomentInput) => string;
dateMilliseconds: (date: import("moment").MomentInput, dateFormat: string, outputFormat: string) => number;
dateToMillisecondsNoTime: (date: import("moment").MomentInput) => number;
millisecondsToDate: (date: import("moment").MomentInput, outputFormat: string) => string;
daysToMilliseconds: (days: number) => number;
durationInDays: (start: number, end: number, countFirstDay: boolean) => number;
durationInMilliseconds: (start: number, end: number) => number;
monthName: (month: number, language?: string) => string;
weeksOfMonth: (year: number, month: number) => import("./scripts/core/services/date/core-services-date.interface").IWeeksOfMonth[];
daysOfMonth: (weeksRange: import("./scripts/core/services/date/core-services-date.interface").IWeeksOfMonth[]) => import("./scripts/core/services/date/core-services-date.interface").IDaysOfMonth[][];
weekOfYear: (date: string, format: string) => number;
isDateBefore: (startDate: string, endDate: string, type?: import("moment").unitOfTime.StartOf) => boolean;
};
declare const DateGet: {
customDate: (date: import("moment").MomentInput, format: string) => string;
currentDate: (outputFormat?: string) => string;
dayMonthYear: (date: import("moment").MomentInput, format?: string) => import("./scripts/core/services/date/core-services-date.interface").IDayMonthYear;
localDate: (year: number, month: number, day: number, local?: import("./scripts/core/services/date/core-services-date.interface").IDateLocal) => string;
dateFromIso: (date: import("moment").MomentInput, format?: string) => string;
ganttDate: (date: import("moment").MomentInput) => Date;
isoDateCustom: (date: import("moment").MomentInput, dateFormat: string, outputFormat: string) => string;
isoDate: (date: import("moment").MomentInput, format?: string) => string;
isoDateWithoutTime: (date: import("moment").MomentInput) => string;
dateMilliseconds: (date: import("moment").MomentInput, dateFormat: string, outputFormat: string) => number;
dateToMillisecondsNoTime: (date: import("moment").MomentInput) => number;
millisecondsToDate: (date: import("moment").MomentInput, outputFormat: string) => string;
daysToMilliseconds: (days: number) => number;
durationInDays: (start: number, end: number, countFirstDay: boolean) => number;
durationInMilliseconds: (start: number, end: number) => number;
monthName: (month: number, language?: string) => string;
weeksOfMonth: (year: number, month: number) => import("./scripts/core/services/date/core-services-date.interface").IWeeksOfMonth[];
daysOfMonth: (weeksRange: import("./scripts/core/services/date/core-services-date.interface").IWeeksOfMonth[]) => import("./scripts/core/services/date/core-services-date.interface").IDaysOfMonth[][];
weekOfYear: (date: string, format: string) => number;
};
declare const DateComparable: {
isDateBefore: (startDate: string, endDate: string, type?: import("moment").unitOfTime.StartOf) => boolean;
};
declare const DateValidation: {
validateDate: (date: import("moment").MomentInput) => boolean;
};
declare const DatePicker: {
setDatePicker: (datePicker: HTMLInputElement, dateFormat: string) => void;
monthYearDatePicker: (datePicker: HTMLInputElement, dateFormat: string, setValueCallback: any) => void;
dateFromDatePicker: (date: import("moment").MomentInput, format?: string, outputFormat?: string) => string;
localDateForDatePicker: (date: import("moment").MomentInput, outputFormat?: string) => any;
currentDateForDatePicker: (dateFormat?: string, outputFormat?: string) => any;
dateForDatePicker: (month: number, day: number, year: number) => string;
};
declare const Elements: {
removeChildElements: (elementClassId: string | HTMLElement) => void;
};
export { Array, ArraySort, ArrayRemove, Attachment, AttachmentValidate, AttachmentConvert, AttachmentParse, Browser, BrowserVersion, BrowserFullscreen, ComboBox, ComboBoxCore, ComboBoxData, ComboBoxDom, Elements };
export { Array, ArraySort, ArrayRemove, Attachment, AttachmentValidate, AttachmentConvert, AttachmentParse, Browser, BrowserVersion, BrowserFullscreen, ComboBox, ComboBoxCore, ComboBoxData, ComboBoxDom, Date, DateGet, DateComparable, DateValidation, DatePicker, Elements };

@@ -6,3 +6,5 @@ /* tslint:disable:variable-name */

import { initialize, loadData, dataByValue, disableInput } from './scripts/core/services/combobox/core-services-combobox.service';
import { customDate, currentDate, dayMonthYear, localDate, dateFromIso, ganttDate, isoDateCustom, isoDate, isoDateWithoutTime, dateMilliseconds, dateToMillisecondsNoTime, millisecondsToDate, daysToMilliseconds, durationInDays, durationInMilliseconds, monthName, weeksOfMonth, daysOfMonth, weekOfYear, isDateBefore, validateDate, setDatePicker, monthYearDatePicker, dateFromDatePicker, localDateForDatePicker, currentDateForDatePicker, dateForDatePicker } from './scripts/core/services/date/core-services-date.service';
import { removeChildElements } from './scripts/core/services/elements/core-services-elements.service';
import { numberToString } from './scripts/core/services/string/core-services-string.service';
// region Array

@@ -30,6 +32,22 @@ var Array = { removeArrayDuplicateLegacy: removeArrayDuplicateLegacy, sortByKey: sortByKey };

// endregion
// region Date
var Date = { customDate: customDate, currentDate: currentDate, dayMonthYear: dayMonthYear, localDate: localDate, dateFromIso: dateFromIso, ganttDate: ganttDate, isoDateCustom: isoDateCustom, isoDate: isoDate, isoDateWithoutTime: isoDateWithoutTime,
dateMilliseconds: dateMilliseconds, dateToMillisecondsNoTime: dateToMillisecondsNoTime, millisecondsToDate: millisecondsToDate, daysToMilliseconds: daysToMilliseconds, durationInDays: durationInDays, durationInMilliseconds: durationInMilliseconds,
monthName: monthName, weeksOfMonth: weeksOfMonth, daysOfMonth: daysOfMonth, weekOfYear: weekOfYear, isDateBefore: isDateBefore };
var DateGet = { customDate: customDate, currentDate: currentDate, dayMonthYear: dayMonthYear, localDate: localDate, dateFromIso: dateFromIso, ganttDate: ganttDate, isoDateCustom: isoDateCustom, isoDate: isoDate, isoDateWithoutTime: isoDateWithoutTime,
dateMilliseconds: dateMilliseconds, dateToMillisecondsNoTime: dateToMillisecondsNoTime, millisecondsToDate: millisecondsToDate, daysToMilliseconds: daysToMilliseconds, durationInDays: durationInDays, durationInMilliseconds: durationInMilliseconds,
monthName: monthName, weeksOfMonth: weeksOfMonth, daysOfMonth: daysOfMonth, weekOfYear: weekOfYear };
var DateComparable = { isDateBefore: isDateBefore };
var DateValidation = { validateDate: validateDate };
var DatePicker = { setDatePicker: setDatePicker, monthYearDatePicker: monthYearDatePicker, dateFromDatePicker: dateFromDatePicker, localDateForDatePicker: localDateForDatePicker,
currentDateForDatePicker: currentDateForDatePicker, dateForDatePicker: dateForDatePicker
};
// endregion
// region Elements
var Elements = { removeChildElements: removeChildElements };
// endregion
export { Array, ArraySort, ArrayRemove, Attachment, AttachmentValidate, AttachmentConvert, AttachmentParse, Browser, BrowserVersion, BrowserFullscreen, ComboBox, ComboBoxCore, ComboBoxData, ComboBoxDom, Elements };
// region String
var String = { numberToString: numberToString };
// end region
export { Array, ArraySort, ArrayRemove, Attachment, AttachmentValidate, AttachmentConvert, AttachmentParse, Browser, BrowserVersion, BrowserFullscreen, ComboBox, ComboBoxCore, ComboBoxData, ComboBoxDom, Date, DateGet, DateComparable, DateValidation, DatePicker, Elements };
//# sourceMappingURL=index.js.map

@@ -0,1 +1,12 @@

var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
/**

@@ -28,2 +39,3 @@ * Convert

export var validateFile = function (input, accepts) {
var e_1, _a;
var fileName = input.value;

@@ -35,8 +47,17 @@ var idxDot = fileName.lastIndexOf('.') + 1;

}
for (var _i = 0, accepts_1 = accepts; _i < accepts_1.length; _i++) {
var extension = accepts_1[_i];
if (extFile === extension) {
return true;
try {
for (var accepts_1 = __values(accepts), accepts_1_1 = accepts_1.next(); !accepts_1_1.done; accepts_1_1 = accepts_1.next()) {
var extension = accepts_1_1.value;
if (extFile === extension) {
return true;
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (accepts_1_1 && !accepts_1_1.done && (_a = accepts_1.return)) _a.call(accepts_1);
}
finally { if (e_1) throw e_1.error; }
}
return false;

@@ -43,0 +64,0 @@ };

@@ -0,1 +1,2 @@

/// <reference types="moment-range" />
declare const Array: {

@@ -62,5 +63,62 @@ removeArrayDuplicateLegacy: (array: any[]) => any[];

};
declare const Date: {
customDate: (date: import("moment").MomentInput, format: string) => string;
currentDate: (outputFormat?: string) => string;
dayMonthYear: (date: import("moment").MomentInput, format?: string) => import("./scripts/core/services/date/core-services-date.interface").IDayMonthYear;
localDate: (year: number, month: number, day: number, local?: import("./scripts/core/services/date/core-services-date.interface").IDateLocal) => string;
dateFromIso: (date: import("moment").MomentInput, format?: string) => string;
ganttDate: (date: import("moment").MomentInput) => Date;
isoDateCustom: (date: import("moment").MomentInput, dateFormat: string, outputFormat: string) => string;
isoDate: (date: import("moment").MomentInput, format?: string) => string;
isoDateWithoutTime: (date: import("moment").MomentInput) => string;
dateMilliseconds: (date: import("moment").MomentInput, dateFormat: string, outputFormat: string) => number;
dateToMillisecondsNoTime: (date: import("moment").MomentInput) => number;
millisecondsToDate: (date: import("moment").MomentInput, outputFormat: string) => string;
daysToMilliseconds: (days: number) => number;
durationInDays: (start: number, end: number, countFirstDay: boolean) => number;
durationInMilliseconds: (start: number, end: number) => number;
monthName: (month: number, language?: string) => string;
weeksOfMonth: (year: number, month: number) => import("./scripts/core/services/date/core-services-date.interface").IWeeksOfMonth[];
daysOfMonth: (weeksRange: import("./scripts/core/services/date/core-services-date.interface").IWeeksOfMonth[]) => import("./scripts/core/services/date/core-services-date.interface").IDaysOfMonth[][];
weekOfYear: (date: string, format: string) => number;
isDateBefore: (startDate: string, endDate: string, type?: import("moment").unitOfTime.StartOf) => boolean;
};
declare const DateGet: {
customDate: (date: import("moment").MomentInput, format: string) => string;
currentDate: (outputFormat?: string) => string;
dayMonthYear: (date: import("moment").MomentInput, format?: string) => import("./scripts/core/services/date/core-services-date.interface").IDayMonthYear;
localDate: (year: number, month: number, day: number, local?: import("./scripts/core/services/date/core-services-date.interface").IDateLocal) => string;
dateFromIso: (date: import("moment").MomentInput, format?: string) => string;
ganttDate: (date: import("moment").MomentInput) => Date;
isoDateCustom: (date: import("moment").MomentInput, dateFormat: string, outputFormat: string) => string;
isoDate: (date: import("moment").MomentInput, format?: string) => string;
isoDateWithoutTime: (date: import("moment").MomentInput) => string;
dateMilliseconds: (date: import("moment").MomentInput, dateFormat: string, outputFormat: string) => number;
dateToMillisecondsNoTime: (date: import("moment").MomentInput) => number;
millisecondsToDate: (date: import("moment").MomentInput, outputFormat: string) => string;
daysToMilliseconds: (days: number) => number;
durationInDays: (start: number, end: number, countFirstDay: boolean) => number;
durationInMilliseconds: (start: number, end: number) => number;
monthName: (month: number, language?: string) => string;
weeksOfMonth: (year: number, month: number) => import("./scripts/core/services/date/core-services-date.interface").IWeeksOfMonth[];
daysOfMonth: (weeksRange: import("./scripts/core/services/date/core-services-date.interface").IWeeksOfMonth[]) => import("./scripts/core/services/date/core-services-date.interface").IDaysOfMonth[][];
weekOfYear: (date: string, format: string) => number;
};
declare const DateComparable: {
isDateBefore: (startDate: string, endDate: string, type?: import("moment").unitOfTime.StartOf) => boolean;
};
declare const DateValidation: {
validateDate: (date: import("moment").MomentInput) => boolean;
};
declare const DatePicker: {
setDatePicker: (datePicker: HTMLInputElement, dateFormat: string) => void;
monthYearDatePicker: (datePicker: HTMLInputElement, dateFormat: string, setValueCallback: any) => void;
dateFromDatePicker: (date: import("moment").MomentInput, format?: string, outputFormat?: string) => string;
localDateForDatePicker: (date: import("moment").MomentInput, outputFormat?: string) => any;
currentDateForDatePicker: (dateFormat?: string, outputFormat?: string) => any;
dateForDatePicker: (month: number, day: number, year: number) => string;
};
declare const Elements: {
removeChildElements: (elementClassId: string | HTMLElement) => void;
};
export { Array, ArraySort, ArrayRemove, Attachment, AttachmentValidate, AttachmentConvert, AttachmentParse, Browser, BrowserVersion, BrowserFullscreen, ComboBox, ComboBoxCore, ComboBoxData, ComboBoxDom, Elements };
export { Array, ArraySort, ArrayRemove, Attachment, AttachmentValidate, AttachmentConvert, AttachmentParse, Browser, BrowserVersion, BrowserFullscreen, ComboBox, ComboBoxCore, ComboBoxData, ComboBoxDom, Date, DateGet, DateComparable, DateValidation, DatePicker, Elements };

2

lib/index.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});var core_services_attachment_service_1=require("./scripts/core/services/attachment/core-services-attachment.service");var core_services_array_service_1=require("./scripts/core/services/array/core-services-array.service");var core_services_browser_service_1=require("./scripts/core/services/browser/core-services-browser.service");var core_services_combobox_service_1=require("./scripts/core/services/combobox/core-services-combobox.service");var core_services_elements_service_1=require("./scripts/core/services/elements/core-services-elements.service");var Array={removeArrayDuplicateLegacy:core_services_array_service_1.removeArrayDuplicateLegacy,sortByKey:core_services_array_service_1.sortByKey};exports.Array=Array;var ArraySort={sortByKey:core_services_array_service_1.sortByKey};exports.ArraySort=ArraySort;var ArrayRemove={removeArrayDuplicateLegacy:core_services_array_service_1.removeArrayDuplicateLegacy};exports.ArrayRemove=ArrayRemove;var Attachment={validateFile:core_services_attachment_service_1.validateFile,validateFileSize:core_services_attachment_service_1.validateFileSize,textFileToUrlImage:core_services_attachment_service_1.textFileToUrlImage,parseAcceptFiles:core_services_attachment_service_1.parseAcceptFiles};exports.Attachment=Attachment;var AttachmentValidate={validateFile:core_services_attachment_service_1.validateFile,validateFileSize:core_services_attachment_service_1.validateFileSize,fileMaxSize:core_services_attachment_service_1.fileMaxSize};exports.AttachmentValidate=AttachmentValidate;var AttachmentConvert={textFileToUrlImage:core_services_attachment_service_1.textFileToUrlImage};exports.AttachmentConvert=AttachmentConvert;var AttachmentParse={parseAcceptFiles:core_services_attachment_service_1.parseAcceptFiles};exports.AttachmentParse=AttachmentParse;var Browser={isIE:core_services_browser_service_1.isIE,isBeforeIE11:core_services_browser_service_1.isBeforeIE11,disableFullscreenListener:core_services_browser_service_1.disableFullscreenListener,fullscreenListener:core_services_browser_service_1.fullscreenListener,toggleFullScreen:core_services_browser_service_1.toggleFullScreen,hasFullscreen:core_services_browser_service_1.hasFullscreen};exports.Browser=Browser;var BrowserVersion={isIE:core_services_browser_service_1.isIE,isBeforeIE11:core_services_browser_service_1.isBeforeIE11};exports.BrowserVersion=BrowserVersion;var BrowserFullscreen={disableFullscreenListener:core_services_browser_service_1.disableFullscreenListener,fullscreenListener:core_services_browser_service_1.fullscreenListener,toggleFullScreen:core_services_browser_service_1.toggleFullScreen,hasFullscreen:core_services_browser_service_1.hasFullscreen};exports.BrowserFullscreen=BrowserFullscreen;var ComboBox={initialize:core_services_combobox_service_1.initialize,loadData:core_services_combobox_service_1.loadData,dataByValue:core_services_combobox_service_1.dataByValue,disableInput:core_services_combobox_service_1.disableInput};exports.ComboBox=ComboBox;var ComboBoxCore={initialize:core_services_combobox_service_1.initialize,loadData:core_services_combobox_service_1.loadData};exports.ComboBoxCore=ComboBoxCore;var ComboBoxData={dataByValue:core_services_combobox_service_1.dataByValue};exports.ComboBoxData=ComboBoxData;var ComboBoxDom={disableInput:core_services_combobox_service_1.disableInput};exports.ComboBoxDom=ComboBoxDom;var Elements={removeChildElements:core_services_elements_service_1.removeChildElements};exports.Elements=Elements;
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var core_services_attachment_service_1=require("./scripts/core/services/attachment/core-services-attachment.service");var core_services_array_service_1=require("./scripts/core/services/array/core-services-array.service");var core_services_browser_service_1=require("./scripts/core/services/browser/core-services-browser.service");var core_services_combobox_service_1=require("./scripts/core/services/combobox/core-services-combobox.service");var core_services_date_service_1=require("./scripts/core/services/date/core-services-date.service");var core_services_elements_service_1=require("./scripts/core/services/elements/core-services-elements.service");var core_services_string_service_1=require("./scripts/core/services/string/core-services-string.service");var Array={removeArrayDuplicateLegacy:core_services_array_service_1.removeArrayDuplicateLegacy,sortByKey:core_services_array_service_1.sortByKey};exports.Array=Array;var ArraySort={sortByKey:core_services_array_service_1.sortByKey};exports.ArraySort=ArraySort;var ArrayRemove={removeArrayDuplicateLegacy:core_services_array_service_1.removeArrayDuplicateLegacy};exports.ArrayRemove=ArrayRemove;var Attachment={validateFile:core_services_attachment_service_1.validateFile,validateFileSize:core_services_attachment_service_1.validateFileSize,textFileToUrlImage:core_services_attachment_service_1.textFileToUrlImage,parseAcceptFiles:core_services_attachment_service_1.parseAcceptFiles};exports.Attachment=Attachment;var AttachmentValidate={validateFile:core_services_attachment_service_1.validateFile,validateFileSize:core_services_attachment_service_1.validateFileSize,fileMaxSize:core_services_attachment_service_1.fileMaxSize};exports.AttachmentValidate=AttachmentValidate;var AttachmentConvert={textFileToUrlImage:core_services_attachment_service_1.textFileToUrlImage};exports.AttachmentConvert=AttachmentConvert;var AttachmentParse={parseAcceptFiles:core_services_attachment_service_1.parseAcceptFiles};exports.AttachmentParse=AttachmentParse;var Browser={isIE:core_services_browser_service_1.isIE,isBeforeIE11:core_services_browser_service_1.isBeforeIE11,disableFullscreenListener:core_services_browser_service_1.disableFullscreenListener,fullscreenListener:core_services_browser_service_1.fullscreenListener,toggleFullScreen:core_services_browser_service_1.toggleFullScreen,hasFullscreen:core_services_browser_service_1.hasFullscreen};exports.Browser=Browser;var BrowserVersion={isIE:core_services_browser_service_1.isIE,isBeforeIE11:core_services_browser_service_1.isBeforeIE11};exports.BrowserVersion=BrowserVersion;var BrowserFullscreen={disableFullscreenListener:core_services_browser_service_1.disableFullscreenListener,fullscreenListener:core_services_browser_service_1.fullscreenListener,toggleFullScreen:core_services_browser_service_1.toggleFullScreen,hasFullscreen:core_services_browser_service_1.hasFullscreen};exports.BrowserFullscreen=BrowserFullscreen;var ComboBox={initialize:core_services_combobox_service_1.initialize,loadData:core_services_combobox_service_1.loadData,dataByValue:core_services_combobox_service_1.dataByValue,disableInput:core_services_combobox_service_1.disableInput};exports.ComboBox=ComboBox;var ComboBoxCore={initialize:core_services_combobox_service_1.initialize,loadData:core_services_combobox_service_1.loadData};exports.ComboBoxCore=ComboBoxCore;var ComboBoxData={dataByValue:core_services_combobox_service_1.dataByValue};exports.ComboBoxData=ComboBoxData;var ComboBoxDom={disableInput:core_services_combobox_service_1.disableInput};exports.ComboBoxDom=ComboBoxDom;var Date={customDate:core_services_date_service_1.customDate,currentDate:core_services_date_service_1.currentDate,dayMonthYear:core_services_date_service_1.dayMonthYear,localDate:core_services_date_service_1.localDate,dateFromIso:core_services_date_service_1.dateFromIso,ganttDate:core_services_date_service_1.ganttDate,isoDateCustom:core_services_date_service_1.isoDateCustom,isoDate:core_services_date_service_1.isoDate,isoDateWithoutTime:core_services_date_service_1.isoDateWithoutTime,dateMilliseconds:core_services_date_service_1.dateMilliseconds,dateToMillisecondsNoTime:core_services_date_service_1.dateToMillisecondsNoTime,millisecondsToDate:core_services_date_service_1.millisecondsToDate,daysToMilliseconds:core_services_date_service_1.daysToMilliseconds,durationInDays:core_services_date_service_1.durationInDays,durationInMilliseconds:core_services_date_service_1.durationInMilliseconds,monthName:core_services_date_service_1.monthName,weeksOfMonth:core_services_date_service_1.weeksOfMonth,daysOfMonth:core_services_date_service_1.daysOfMonth,weekOfYear:core_services_date_service_1.weekOfYear,isDateBefore:core_services_date_service_1.isDateBefore};exports.Date=Date;var DateGet={customDate:core_services_date_service_1.customDate,currentDate:core_services_date_service_1.currentDate,dayMonthYear:core_services_date_service_1.dayMonthYear,localDate:core_services_date_service_1.localDate,dateFromIso:core_services_date_service_1.dateFromIso,ganttDate:core_services_date_service_1.ganttDate,isoDateCustom:core_services_date_service_1.isoDateCustom,isoDate:core_services_date_service_1.isoDate,isoDateWithoutTime:core_services_date_service_1.isoDateWithoutTime,dateMilliseconds:core_services_date_service_1.dateMilliseconds,dateToMillisecondsNoTime:core_services_date_service_1.dateToMillisecondsNoTime,millisecondsToDate:core_services_date_service_1.millisecondsToDate,daysToMilliseconds:core_services_date_service_1.daysToMilliseconds,durationInDays:core_services_date_service_1.durationInDays,durationInMilliseconds:core_services_date_service_1.durationInMilliseconds,monthName:core_services_date_service_1.monthName,weeksOfMonth:core_services_date_service_1.weeksOfMonth,daysOfMonth:core_services_date_service_1.daysOfMonth,weekOfYear:core_services_date_service_1.weekOfYear};exports.DateGet=DateGet;var DateComparable={isDateBefore:core_services_date_service_1.isDateBefore};exports.DateComparable=DateComparable;var DateValidation={validateDate:core_services_date_service_1.validateDate};exports.DateValidation=DateValidation;var DatePicker={setDatePicker:core_services_date_service_1.setDatePicker,monthYearDatePicker:core_services_date_service_1.monthYearDatePicker,dateFromDatePicker:core_services_date_service_1.dateFromDatePicker,localDateForDatePicker:core_services_date_service_1.localDateForDatePicker,currentDateForDatePicker:core_services_date_service_1.currentDateForDatePicker,dateForDatePicker:core_services_date_service_1.dateForDatePicker};exports.DatePicker=DatePicker;var Elements={removeChildElements:core_services_elements_service_1.removeChildElements};exports.Elements=Elements;var String={numberToString:core_services_string_service_1.numberToString};

@@ -1,26 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Remove items
*/
exports.removeArrayDuplicateLegacy = function (array) {
var unique = array.filter(function (item, index) {
return array.indexOf(item) === index;
});
return unique.sort();
};
/**
* Sort Arrays
*/
exports.sortByKey = function (array, key, asc) {
return new Promise(function (resolve) {
var _asc = asc ? 1 : -1;
var sorted = array.sort(function (a, b) {
var x = a[key];
var y = b[key];
return (x === y) ? 0 : ((x > y) ? _asc : -1 * _asc);
});
resolve(sorted);
});
};
//# sourceMappingURL=core-services-array.service.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.removeArrayDuplicateLegacy=function(array){var unique=array.filter(function(item,index){return array.indexOf(item)===index});return unique.sort()};exports.sortByKey=function(array,key,asc){return new Promise(function(resolve){var _asc=asc?1:-1;var sorted=array.sort(function(a,b){var x=a[key];var y=b[key];return x===y?0:x>y?_asc:-1*_asc});resolve(sorted)})};

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.textFileToUrlImage=function(file){return new Promise(function(resolve){var fileReader=new FileReader;fileReader.addEventListener("load",function(e){resolve(e.target.result)});fileReader.readAsDataURL(file)})};exports.parseAcceptFiles=function(accepts){return accepts.replace(/image\//g,"").replace(/x-/g,"").replace(/\+xml/g,"").replace(/ /g,"").split(",")};exports.validateFile=function(input,accepts){var fileName=input.value;var idxDot=fileName.lastIndexOf(".")+1;var extFile=fileName.substr(idxDot,fileName.length).toLowerCase();if(accepts.length===1&&accepts[0]==="*"){return true}for(var _i=0,accepts_1=accepts;_i<accepts_1.length;_i++){var extension=accepts_1[_i];if(extFile===extension){return true}}return false};exports.validateFileSize=function(input){if(input!=null&&input.files!=null){var fileSize=input.files[0].size/1024;var maxSize=exports.fileMaxSize(input);return fileSize<=maxSize}else{console.error("Input is null.");return false}};exports.fileMaxSize=function(input){var fileName=input.attributes["data-maxsize"].nodeValue;if(fileName){return parseInt(fileName,10)}else{return 1024*45}};
"use strict";var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(exports,"__esModule",{value:true});exports.textFileToUrlImage=function(file){return new Promise(function(resolve){var fileReader=new FileReader;fileReader.addEventListener("load",function(e){resolve(e.target.result)});fileReader.readAsDataURL(file)})};exports.parseAcceptFiles=function(accepts){return accepts.replace(/image\//g,"").replace(/x-/g,"").replace(/\+xml/g,"").replace(/ /g,"").split(",")};exports.validateFile=function(input,accepts){var e_1,_a;var fileName=input.value;var idxDot=fileName.lastIndexOf(".")+1;var extFile=fileName.substr(idxDot,fileName.length).toLowerCase();if(accepts.length===1&&accepts[0]==="*"){return true}try{for(var accepts_1=__values(accepts),accepts_1_1=accepts_1.next();!accepts_1_1.done;accepts_1_1=accepts_1.next()){var extension=accepts_1_1.value;if(extFile===extension){return true}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(accepts_1_1&&!accepts_1_1.done&&(_a=accepts_1.return))_a.call(accepts_1)}finally{if(e_1)throw e_1.error}}return false};exports.validateFileSize=function(input){if(input!=null&&input.files!=null){var fileSize=input.files[0].size/1024;var maxSize=exports.fileMaxSize(input);return fileSize<=maxSize}else{console.error("Input is null.");return false}};exports.fileMaxSize=function(input){var fileName=input.attributes["data-maxsize"].nodeValue;if(fileName){return parseInt(fileName,10)}else{return 1024*45}};

@@ -1,3 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=core-services-browser.interfaces.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});

@@ -1,86 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var screenfull = require("screenfull");
/**
* Ffullscreen
*/
exports.fullscreenListener = function (menuButton, alt, src, showLog) {
if (showLog === void 0) { showLog = false; }
if (screenfull.isEnabled) {
// @ts-ignore
screenfull.on('change', function () {
// @ts-ignore
if (screenfull.isFullscreen) {
menuButton.src = src.exit;
menuButton.alt = alt.exit;
}
else {
menuButton.src = src.enter;
menuButton.alt = alt.enter;
}
if (showLog) {
// @ts-ignore
var label = screenfull.isFullscreen ? 'enabled' : 'disabled';
console.log("Fullscreen " + label);
}
});
}
else {
console.log('This browser does not support fullscreen api');
}
};
exports.disableFullscreenListener = function () {
// @ts-ignore
screenfull.off('change', function () {
console.log('Fullscreen listener has been disabled');
});
};
exports.toggleFullScreen = function (menuButton, alt, src, showLog) {
if (showLog === void 0) { showLog = false; }
return new Promise(function (resolve, reject) {
if (screenfull.isEnabled) {
if (screenfull.isFullscreen) {
screenfull.exit().then(function () {
menuButton.src = src.enter;
menuButton.alt = alt.enter;
}).catch(function (error) {
console.log(error);
reject(error);
});
}
else {
screenfull.request().then(function () {
menuButton.src = src.exit;
menuButton.alt = alt.exit;
}).catch(function (error) {
console.log(error);
reject(error);
});
}
if (showLog) {
// @ts-ignore
var label = screenfull.isFullscreen ? 'enabled' : 'disabled';
console.log("Fullscreen " + label);
}
resolve({ src: menuButton.src, alt: menuButton.alt });
}
else {
resolve({ src: null, alt: null });
}
});
};
exports.hasFullscreen = function () {
return screenfull.isEnabled;
};
/**
* Version
*/
exports.isIE = function () {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
return msie > 0 || !!navigator.userAgent.match(/Trident.*rv:11\./);
};
exports.isBeforeIE11 = function () {
return navigator.appVersion.indexOf('MSIE 10') !== -1;
};
//# sourceMappingURL=core-services-browser.service.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var screenfull=require("screenfull");exports.fullscreenListener=function(menuButton,alt,src,showLog){if(showLog===void 0){showLog=false}if(screenfull.isEnabled){screenfull.on("change",function(){if(screenfull.isFullscreen){menuButton.src=src.exit;menuButton.alt=alt.exit}else{menuButton.src=src.enter;menuButton.alt=alt.enter}if(showLog){var label=screenfull.isFullscreen?"enabled":"disabled";console.log("Fullscreen "+label)}})}else{console.log("This browser does not support fullscreen api")}};exports.disableFullscreenListener=function(){screenfull.off("change",function(){console.log("Fullscreen listener has been disabled")})};exports.toggleFullScreen=function(menuButton,alt,src,showLog){if(showLog===void 0){showLog=false}return new Promise(function(resolve,reject){if(screenfull.isEnabled){if(screenfull.isFullscreen){screenfull.exit().then(function(){menuButton.src=src.enter;menuButton.alt=alt.enter}).catch(function(error){console.log(error);reject(error)})}else{screenfull.request().then(function(){menuButton.src=src.exit;menuButton.alt=alt.exit}).catch(function(error){console.log(error);reject(error)})}if(showLog){var label=screenfull.isFullscreen?"enabled":"disabled";console.log("Fullscreen "+label)}resolve({src:menuButton.src,alt:menuButton.alt})}else{resolve({src:null,alt:null})}})};exports.hasFullscreen=function(){return screenfull.isEnabled};exports.isIE=function(){var ua=window.navigator.userAgent;var msie=ua.indexOf("MSIE ");return msie>0||!!navigator.userAgent.match(/Trident.*rv:11\./)};exports.isBeforeIE11=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1};

@@ -1,3 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=core-services-combobox.interface.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});

@@ -1,234 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var $ = require("jquery");
require("node_modules/jquery-ui-dist/jquery-ui.min");
var core_services_elements_service_1 = require("../elements/core-services-elements.service");
/**
* This function is using Jquery and Jquery-ui and typescript is not available
* To this function work is necessary the following imports, respectively:
* import * as $ from 'jquery'; or import $ = require('jquery');
* import '../../../../../node_modules/jquery-ui-dist/jquery-ui.min';
*/
exports.initialize = function (combobox, callback, invalidCallback) {
$.widget('custom.combobox', {
_create: function () {
// @ts-ignore
this.wrapper = $('<span>')
.addClass('custom-combobox')
.insertAfter(this.element);
this.element.hide();
this._createAutocomplete();
this._createShowAllButton();
// @ts-ignore
this.input.attr('placeholder', this.element.attr('placeholder'));
// @ts-ignore
this.input.focus().blur();
},
_createAutocomplete: function () {
var selected = this.element.children(':selected');
var value = selected.val() ? selected.text() : '';
// @ts-ignore
this.input = $('<input>')
// @ts-ignore
.appendTo(this.wrapper)
.val(value)
.attr('title', '')
.addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left " + this.element.attr('class'))
.autocomplete({
delay: 0,
minLength: 0,
// @ts-ignore
maxShowItems: 5,
source: $.proxy(this, '_source')
})
.tooltip({
classes: { 'ui-tooltip': 'ui-state-highlight' }
});
// noinspection JSDeprecatedSymbols
// @ts-ignore
this.input.focus().blur();
// @ts-ignore
// noinspection SpellCheckingInspection
this._on(this.input, {
autocompleteselect: function (event, ui) {
ui.item.option.selected = true;
// Get the value: ui.item.option.value
// Get the text: ui.item.value
callback(ui.item.option.value, ui.item.value);
this._trigger('select', event, {
item: ui.item.option
});
},
disable: function () {
this._disable();
},
enable: function () {
this._enable();
},
autocompletechange: '_removeIfInvalid'
});
},
_createShowAllButton: function () {
// @ts-ignore
var input = this.input;
var wasOpen = false;
$('<a>')
.attr('tabIndex', -1)
.attr('title', 'Mostrar todos os itens')
.tooltip()
// @ts-ignore
.appendTo(this.wrapper)
.button({
icons: {
primary: 'ui-icon-triangle-1-s'
},
text: false
})
.removeClass('ui-corner-all')
.on('mousedown', function () {
wasOpen = input.autocomplete('widget').is(':visible');
})
.on('click', function () {
wasOpen = input.autocomplete('widget').is(':visible');
input.trigger('focus');
// Close if already visible
if (wasOpen) {
return;
}
// Pass empty string as value to search for, displaying all results
input.autocomplete('search', '');
});
},
_source: function (request, response) {
// noinspection TypeScriptValidateJSTypes
var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), 'i');
// noinspection TypeScriptValidateJSTypes
response(this.element.children('option').map(function () {
// @ts-ignore
var text = $(this).text();
// @ts-ignore
if (this.value && (!request.term || matcher.test(text))) {
return {
label: text,
value: text,
// @ts-ignore
option: this
};
}
else {
return null;
}
}));
},
_removeIfInvalid: function (event, ui) {
// Selected an item, nothing to do
if (ui.item) {
return;
}
// Search for a match (case-insensitive)
// @ts-ignore
var value = this.input.val();
var valueLowerCase = value.toLowerCase();
var valid = false;
this.element.children('option').each(function () {
if ($(this).text().toLowerCase() === valueLowerCase) {
// @ts-ignore
this.selected = valid = true;
return false;
}
});
// Found a match, nothing to do
if (valid) {
// Get the value: this.element.val()
// Get the text: this.input.val()
// @ts-ignore
callback(this.element.val(), this.input.val());
return;
}
// Remove invalid value
// noinspection TypeScriptValidateJSTypes
// @ts-ignore
this.input
.val('')
.attr('title', "O valor " + value + " n\u00E3o existe para este item!")
.tooltip('open');
this.element.val('');
// @ts-ignore
this._delay(function () {
// @ts-ignore
this.input.tooltip('close').attr('title', '');
}, 2500);
// @ts-ignore
this.input.autocomplete('instance').term = '';
// @ts-ignore
invalidCallback(this.element.val(), this.input.val());
},
_destroy: function () {
// @ts-ignore
this.wrapper.remove();
this.element.show();
}
});
// @ts-ignore
$(combobox).combobox();
};
exports.loadData = function (combobox, data, keepValue) {
return new Promise(function (resolve) {
var parent = combobox.parentNode;
if (parent != null) {
var comboboxInput = parent.querySelector('input.custom-combobox-input');
core_services_elements_service_1.removeChildElements(combobox);
if (!keepValue) {
combobox.value = '';
comboboxInput.value = '';
}
var emptyOption = document.createElement('option');
emptyOption.value = '';
combobox.appendChild(emptyOption);
data.forEach(function (d) {
var option = document.createElement('option');
option.value = d.value;
option.innerText = d.text;
combobox.appendChild(option);
});
resolve(combobox);
}
else {
console.error('Parent of current combobox is null');
resolve(null);
}
});
};
exports.dataByValue = function (arrayData, value) {
var tempActionPlan = arrayData.filter(function (x) { return x.value === value; });
if (value == null || tempActionPlan.length === 0) {
return '';
}
else {
return tempActionPlan[0].text;
}
};
exports.disableInput = function (combobox, disable) {
var parent = combobox.parentNode;
var input = parent.querySelector('input');
if (input == null) {
console.error("Input not found on current combobox group: " + parent);
}
else {
if (disable) {
input.disabled = true; // this disables just the popup menu (widget),
input.classList.add('ui-autocomplete-disabled');
input.classList.add('ui-state-disabled');
input.setAttribute('tabIndex', '-1');
input.setAttribute('aria-disabled', 'true');
}
else {
input.disabled = false;
input.classList.remove('ui-state-disabled');
input.classList.remove('ui-autocomplete-disabled');
input.removeAttribute('tabIndex');
input.setAttribute('aria-disabled', 'false');
}
}
};
//# sourceMappingURL=core-services-combobox.service.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var $=require("jquery");require("node_modules/jquery-ui-dist/jquery-ui.min");var core_services_elements_service_1=require("../elements/core-services-elements.service");exports.initialize=function(combobox,callback,invalidCallback){$.widget("custom.combobox",{_create:function(){this.wrapper=$("<span>").addClass("custom-combobox").insertAfter(this.element);this.element.hide();this._createAutocomplete();this._createShowAllButton();this.input.attr("placeholder",this.element.attr("placeholder"));this.input.focus().blur()},_createAutocomplete:function(){var selected=this.element.children(":selected");var value=selected.val()?selected.text():"";this.input=$("<input>").appendTo(this.wrapper).val(value).attr("title","").addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left "+this.element.attr("class")).autocomplete({delay:0,minLength:0,maxShowItems:5,source:$.proxy(this,"_source")}).tooltip({classes:{"ui-tooltip":"ui-state-highlight"}});this.input.focus().blur();this._on(this.input,{autocompleteselect:function(event,ui){ui.item.option.selected=true;callback(ui.item.option.value,ui.item.value);this._trigger("select",event,{item:ui.item.option})},disable:function(){this._disable()},enable:function(){this._enable()},autocompletechange:"_removeIfInvalid"})},_createShowAllButton:function(){var input=this.input;var wasOpen=false;$("<a>").attr("tabIndex",-1).attr("title","Mostrar todos os itens").tooltip().appendTo(this.wrapper).button({icons:{primary:"ui-icon-triangle-1-s"},text:false}).removeClass("ui-corner-all").on("mousedown",function(){wasOpen=input.autocomplete("widget").is(":visible")}).on("click",function(){wasOpen=input.autocomplete("widget").is(":visible");input.trigger("focus");if(wasOpen){return}input.autocomplete("search","")})},_source:function(request,response){var matcher=new RegExp($.ui.autocomplete.escapeRegex(request.term),"i");response(this.element.children("option").map(function(){var text=$(this).text();if(this.value&&(!request.term||matcher.test(text))){return{label:text,value:text,option:this}}else{return null}}))},_removeIfInvalid:function(event,ui){if(ui.item){return}var value=this.input.val();var valueLowerCase=value.toLowerCase();var valid=false;this.element.children("option").each(function(){if($(this).text().toLowerCase()===valueLowerCase){this.selected=valid=true;return false}});if(valid){callback(this.element.val(),this.input.val());return}this.input.val("").attr("title","O valor "+value+" não existe para este item!").tooltip("open");this.element.val("");this._delay(function(){this.input.tooltip("close").attr("title","")},2500);this.input.autocomplete("instance").term="";invalidCallback(this.element.val(),this.input.val())},_destroy:function(){this.wrapper.remove();this.element.show()}});$(combobox).combobox()};exports.loadData=function(combobox,data,keepValue){return new Promise(function(resolve){var parent=combobox.parentNode;if(parent!=null){var comboboxInput=parent.querySelector("input.custom-combobox-input");core_services_elements_service_1.removeChildElements(combobox);if(!keepValue){combobox.value="";comboboxInput.value=""}var emptyOption=document.createElement("option");emptyOption.value="";combobox.appendChild(emptyOption);data.forEach(function(d){var option=document.createElement("option");option.value=d.value;option.innerText=d.text;combobox.appendChild(option)});resolve(combobox)}else{console.error("Parent of current combobox is null");resolve(null)}})};exports.dataByValue=function(arrayData,value){var tempActionPlan=arrayData.filter(function(x){return x.value===value});if(value==null||tempActionPlan.length===0){return""}else{return tempActionPlan[0].text}};exports.disableInput=function(combobox,disable){var parent=combobox.parentNode;var input=parent.querySelector("input");if(input==null){console.error("Input not found on current combobox group: "+parent)}else{if(disable){input.disabled=true;input.classList.add("ui-autocomplete-disabled");input.classList.add("ui-state-disabled");input.setAttribute("tabIndex","-1");input.setAttribute("aria-disabled","true")}else{input.disabled=false;input.classList.remove("ui-state-disabled");input.classList.remove("ui-autocomplete-disabled");input.removeAttribute("tabIndex");input.setAttribute("aria-disabled","false")}}};

@@ -1,21 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Remove
*/
exports.removeChildElements = function (elementClassId) {
if (typeof elementClassId === 'string') {
var element = document.querySelector(elementClassId);
if (element != null) {
while (element.firstChild) {
element.removeChild(element.firstChild);
}
}
}
else {
while (elementClassId.firstChild) {
elementClassId.removeChild(elementClassId.firstChild);
}
}
};
//# sourceMappingURL=core-services-elements.service.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.removeChildElements=function(elementClassId){if(typeof elementClassId==="string"){var element=document.querySelector(elementClassId);if(element!=null){while(element.firstChild){element.removeChild(element.firstChild)}}}else{while(elementClassId.firstChild){elementClassId.removeChild(elementClassId.firstChild)}}};

@@ -1,3 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=core-services-menu.interfaces.js.map
"use strict";Object.defineProperty(exports,"__esModule",{value:true});
{
"name": "gl-w-frontend",
"version": "1.3.5",
"version": "1.3.6",
"description": "Common code for using among web front-end development such as pure JavaScript, ES6+ and TypeScript",

@@ -39,2 +39,4 @@ "main": "lib/",

"jquery-ui-dist": "^1.12.1",
"moment": "^2.26.0",
"moment-range": "^4.0.2",
"screenfull": "^5.0.2"

@@ -41,0 +43,0 @@ },

# gl-w-frontend #
[![version](https://img.shields.io/badge/version-1.3.5-green.svg)](https://www.npmjs.com/package/gl-w-frontend)
[![version](https://img.shields.io/badge/version-1.3.6-green.svg)](https://www.npmjs.com/package/gl-w-frontend)

@@ -44,3 +44,5 @@ ### What is this repository for? ###

* ComboBox / Autocomplete
* Date / Time
* Dom Elements
* String

@@ -54,1 +56,3 @@ Other features is going to be included frequently.

* [jquery](https://github.com/jquery/jquery/graphs/contributors)
* [moment](https://github.com/moment/moment)
* [moment-range](https://github.com/rotaready/moment-range)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc