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

frontello-ui-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frontello-ui-datepicker - npm Package Compare versions

Comparing version 1.1.2 to 1.2.0

88

datepicker.js

@@ -13,3 +13,2 @@ "use strict";

labelMonth: 'Month',
labelNoDate: 'No date',
labelClear: 'Clear',

@@ -44,2 +43,19 @@ labelToday: 'Today',

openPicker()
{
this.container.style.display = '';
if (this.getDate() == null) this.setDate('today');
}
closePicker()
{
this.container.style.display = 'none';
}
isOpen()
{
return this.container.style.display != 'none';
}
unsetDate()

@@ -210,3 +226,3 @@ {

if (this.date == null) {
this.fieldLabel.value = this.config.labelNoDate;
this.fieldLabel.value = '';

@@ -289,2 +305,3 @@ return;

this.container.style.userSelect = 'none';
this.container.style.display = 'none';
this.fieldLabel.after(this.container);

@@ -296,27 +313,68 @@

this._buildNav();
this._displayManagment();
}
_displayManagment()
{
// Nothing to do
this.fieldLabel.addEventListener('click', (event) => {
event.stopPropagation();
});
this.container.addEventListener('click', (event) => {
event.stopPropagation();
});
this.controls.addEventListener('click', (event) => {
event.stopPropagation();
});
// Open
this.fieldLabel.addEventListener('focus', (event) => {
this.openPicker();
});
this.fieldLabel.addEventListener('click', (event) => {
this.openPicker();
event.stopPropagation();
});
this.actionToday.addEventListener('click', (event) => {
this.openPicker();
});
// Close
this.fieldLabel.addEventListener('focusout', (event) => {
//this.closePicker();
// Selecting the date on click triggers a focusout...
});
this.actionClear.addEventListener('click', () => {
this.closePicker();
});
window.addEventListener('click', () => {
this.closePicker();
});
}
_buildControls()
{
let controls = document.createElement('nav');
controls.classList.add(this.config.classControls);
this.fieldLabel.after(controls);
this.controls = document.createElement('nav');
this.controls .classList.add(this.config.classControls);
this.fieldLabel.after(this.controls );
this.actionClear = null;
if (this.nulable) {
let clear = document.createElement('a');
clear.classList.add('clear');
clear.title = this.config.labelClear;
clear.addEventListener('click', (e) => {
this.actionClear = document.createElement('a');
this.actionClear.classList.add('clear');
this.actionClear.title = this.config.labelClear;
this.actionClear.addEventListener('click', (e) => {
this.unsetDate();
});
controls.append(clear);
this.controls .append(this.actionClear);
}
let today = document.createElement('a');
today.classList.add('today');
today.title = this.config.labelToday;
today.addEventListener('click', (e) => {
this.actionToday = document.createElement('a');
this.actionToday.classList.add('today');
this.actionToday.title = this.config.labelToday;
this.actionToday.addEventListener('click', (e) => {
this.setDate('today');
});
controls.append(today);
this.controls .append(this.actionToday);
}

@@ -323,0 +381,0 @@

2

package.json
{
"name": "frontello-ui-datepicker",
"version": "1.1.2",
"version": "1.2.0",
"description": "UI datepicker",

@@ -5,0 +5,0 @@ "main": "datepicker.js",

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