stimulus-flatpickr
Advanced tools
Comparing version 0.4.0 to 0.4.1-beta.1
@@ -1,2 +0,2 @@ | ||
var t,e=require("stimulus"),a=(t=require("flatpickr"))&&"object"==typeof t&&"default"in t?t.default:t,n={string:["altFormat","altInputClass","ariaDateFormat","dateFormat","defaultDate","mode","nextArrow","prevArrow"],boolean:["altInput","allowInput","clickOpens","disableMobile","enableTime","enableSeconds","inline","noCalendar","shorthandCurrentMonth","static","time_24hr","weekNumbers","wrap"],date:["maxDate","minDate"],array:["disable","enable"],number:["defaultHour","defaultMinute","hourIncrement","minuteIncrement"]},o=["change","open","close","monthChange","yearChange","ready","valueUpdate","dayCreate"],r=["input","calendarContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","days"],i=/\%[a-zA-Z]/,p=function(t){if(i.test(t)){var e=t;return Object.keys(c).forEach(function(t){e=e.replace(RegExp(t,"g"),c[t])}),e}return t},c={"%Y":"Y","%y":"y","%C":"Y","%m":"m","%-m":"n","%_m":"n","%B":"F","%^B":"F","%b":"M","%^b":"M","%h":"M","%^h":"M","%d":"d","%-d":"j","%e":"j","%H":"H","%k":"H","%I":"h","%l":"h","%P":"K","%p":"K","%M":"i","%S":"S","%A":"l","%a":"D","%w":"w"},s=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={altInputTarget:{configurable:!0}};return e.prototype.initialize=function(){this.config={}},e.prototype.connect=function(){this.initializeEvents(),this.initializeOptions(),this.initializeDateFormats(),this.fp=a(this.element,Object.assign({},this.config)),this.initializeElements()},e.prototype.disconnect=function(){this.fp.destroy()},e.prototype.initializeEvents=function(){var t=this;o.forEach(function(e){var a,n="on"+((a=e).charAt(0).toUpperCase()+a.slice(1));t.config[n]=t[e].bind(t)})},e.prototype.initializeOptions=function(){var t=this;Object.keys(n).forEach(function(e){n[e].forEach(function(a){var n=a.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();t.data.has(n)&&(t.config[a]=t[e](n))})})},e.prototype.initializeDateFormats=function(){this.data.has("date-format")&&(this.config.dateFormat=p(this.data.get("date-format"))),this.data.has("alt-format")&&(this.config.altFormat=p(this.data.get("alt-format"))),this.data.has("aria-date-format")&&(this.config.ariaDateFormat=p(this.data.get("aria-date-format")))},e.prototype.initializeElements=function(){var t=this;r.forEach(function(e){t[e+"Target"]=t.fp[e]})},i.altInputTarget.get=function(){return this.element.querySelector(".flatpickr-input")?this.element.querySelector(".flatpickr-input"):this.element},e.prototype.change=function(){},e.prototype.open=function(){},e.prototype.close=function(){},e.prototype.monthChange=function(){},e.prototype.yearChange=function(){},e.prototype.ready=function(){},e.prototype.valueUpdate=function(){},e.prototype.dayCreate=function(){},e.prototype.string=function(t){return this.data.get(t)},e.prototype.date=function(t){return this.data.get(t)},e.prototype.boolean=function(t){return"true"===this.data.get(t)},e.prototype.array=function(t){return JSON.parse(this.data.get(t))},e.prototype.number=function(t){return parseInt(this.data.get(t))},Object.defineProperties(e.prototype,i),e}(e.Controller);module.exports=s; | ||
var t,e=require("stimulus"),n=(t=require("flatpickr"))&&"object"==typeof t&&"default"in t?t.default:t,a={string:["altFormat","altInputClass","ariaDateFormat","conjunction","dateFormat","defaultDate","mode","nextArrow","position","prevArrow"],boolean:["allowInput","altInput","animate","clickOpens","closeOnSelect","disableMobile","enableSeconds","enableTime","inline","noCalendar","shorthandCurrentMonth","static","time_24hr","weekNumbers","wrap"],date:["maxDate","minDate","maxTime","minTime","now"],array:["disable","enable"],number:["defaultHour","defaultMinute","defaultSeconds","hourIncrement","minuteIncrement","showMonths"]},o=["change","open","close","monthChange","yearChange","ready","valueUpdate","dayCreate"],i=["input","calendarContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","days"],r=/\%[a-zA-Z]/,p=function(t){if(r.test(t)){var e=t;return Object.keys(c).forEach(function(t){e=e.replace(RegExp(t,"g"),c[t])}),e}return t},c={"%Y":"Y","%y":"y","%C":"Y","%m":"m","%-m":"n","%_m":"n","%B":"F","%^B":"F","%b":"M","%^b":"M","%h":"M","%^h":"M","%d":"d","%-d":"j","%e":"j","%H":"H","%k":"H","%I":"h","%l":"h","%P":"K","%p":"K","%M":"i","%S":"S","%A":"l","%a":"D","%w":"w"},s=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={altInputTarget:{configurable:!0}};return e.prototype.initialize=function(){this.config={}},e.prototype.connect=function(){this.initializeEvents(),this.initializeOptions(),this.initializeDateFormats(),this.fp=n(this.element,Object.assign({},this.config)),this.initializeElements()},e.prototype.disconnect=function(){this.fp.destroy()},e.prototype.initializeEvents=function(){var t=this;o.forEach(function(e){var n,a="on"+((n=e).charAt(0).toUpperCase()+n.slice(1));t.config[a]=t[e].bind(t)})},e.prototype.initializeOptions=function(){var t=this;Object.keys(a).forEach(function(e){a[e].forEach(function(n){var a=n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();t.data.has(a)&&(t.config[n]=t[e](a))})})},e.prototype.initializeDateFormats=function(){this.data.has("date-format")&&(this.config.dateFormat=p(this.data.get("date-format"))),this.data.has("alt-format")&&(this.config.altFormat=p(this.data.get("alt-format"))),this.data.has("aria-date-format")&&(this.config.ariaDateFormat=p(this.data.get("aria-date-format")))},e.prototype.initializeElements=function(){var t=this;i.forEach(function(e){t[e+"Target"]=t.fp[e]})},r.altInputTarget.get=function(){return this.element.querySelector(".flatpickr-input")?this.element.querySelector(".flatpickr-input"):this.element},e.prototype.change=function(){},e.prototype.open=function(){},e.prototype.close=function(){},e.prototype.monthChange=function(){},e.prototype.yearChange=function(){},e.prototype.ready=function(){},e.prototype.valueUpdate=function(){},e.prototype.dayCreate=function(){},e.prototype.string=function(t){return this.data.get(t)},e.prototype.date=function(t){return this.data.get(t)},e.prototype.boolean=function(t){return"true"===this.data.get(t)},e.prototype.array=function(t){return JSON.parse(this.data.get(t))},e.prototype.number=function(t){return parseInt(this.data.get(t))},Object.defineProperties(e.prototype,r),e}(e.Controller);module.exports=s; | ||
//# sourceMappingURL=stimulus-flatpickr.js.map |
@@ -1,2 +0,2 @@ | ||
import{Controller as t}from"stimulus";import e from"flatpickr";var a={string:["altFormat","altInputClass","ariaDateFormat","dateFormat","defaultDate","mode","nextArrow","prevArrow"],boolean:["altInput","allowInput","clickOpens","disableMobile","enableTime","enableSeconds","inline","noCalendar","shorthandCurrentMonth","static","time_24hr","weekNumbers","wrap"],date:["maxDate","minDate"],array:["disable","enable"],number:["defaultHour","defaultMinute","hourIncrement","minuteIncrement"]},n=["change","open","close","monthChange","yearChange","ready","valueUpdate","dayCreate"],o=["input","calendarContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","days"],r=/\%[a-zA-Z]/,i=function(t){if(r.test(t)){var e=t;return Object.keys(p).forEach(function(t){e=e.replace(RegExp(t,"g"),p[t])}),e}return t},p={"%Y":"Y","%y":"y","%C":"Y","%m":"m","%-m":"n","%_m":"n","%B":"F","%^B":"F","%b":"M","%^b":"M","%h":"M","%^h":"M","%d":"d","%-d":"j","%e":"j","%H":"H","%k":"H","%I":"h","%l":"h","%P":"K","%p":"K","%M":"i","%S":"S","%A":"l","%a":"D","%w":"w"};export default function(t){function r(){t.apply(this,arguments)}t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.prototype)).constructor=r;var p={altInputTarget:{configurable:!0}};return r.prototype.initialize=function(){this.config={}},r.prototype.connect=function(){this.initializeEvents(),this.initializeOptions(),this.initializeDateFormats(),this.fp=e(this.element,Object.assign({},this.config)),this.initializeElements()},r.prototype.disconnect=function(){this.fp.destroy()},r.prototype.initializeEvents=function(){var t=this;n.forEach(function(e){var a,n="on"+((a=e).charAt(0).toUpperCase()+a.slice(1));t.config[n]=t[e].bind(t)})},r.prototype.initializeOptions=function(){var t=this;Object.keys(a).forEach(function(e){a[e].forEach(function(a){var n=a.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();t.data.has(n)&&(t.config[a]=t[e](n))})})},r.prototype.initializeDateFormats=function(){this.data.has("date-format")&&(this.config.dateFormat=i(this.data.get("date-format"))),this.data.has("alt-format")&&(this.config.altFormat=i(this.data.get("alt-format"))),this.data.has("aria-date-format")&&(this.config.ariaDateFormat=i(this.data.get("aria-date-format")))},r.prototype.initializeElements=function(){var t=this;o.forEach(function(e){t[e+"Target"]=t.fp[e]})},p.altInputTarget.get=function(){return this.element.querySelector(".flatpickr-input")?this.element.querySelector(".flatpickr-input"):this.element},r.prototype.change=function(){},r.prototype.open=function(){},r.prototype.close=function(){},r.prototype.monthChange=function(){},r.prototype.yearChange=function(){},r.prototype.ready=function(){},r.prototype.valueUpdate=function(){},r.prototype.dayCreate=function(){},r.prototype.string=function(t){return this.data.get(t)},r.prototype.date=function(t){return this.data.get(t)},r.prototype.boolean=function(t){return"true"===this.data.get(t)},r.prototype.array=function(t){return JSON.parse(this.data.get(t))},r.prototype.number=function(t){return parseInt(this.data.get(t))},Object.defineProperties(r.prototype,p),r}(t); | ||
import{Controller as t}from"stimulus";import e from"flatpickr";var n={string:["altFormat","altInputClass","ariaDateFormat","conjunction","dateFormat","defaultDate","mode","nextArrow","position","prevArrow"],boolean:["allowInput","altInput","animate","clickOpens","closeOnSelect","disableMobile","enableSeconds","enableTime","inline","noCalendar","shorthandCurrentMonth","static","time_24hr","weekNumbers","wrap"],date:["maxDate","minDate","maxTime","minTime","now"],array:["disable","enable"],number:["defaultHour","defaultMinute","defaultSeconds","hourIncrement","minuteIncrement","showMonths"]},a=["change","open","close","monthChange","yearChange","ready","valueUpdate","dayCreate"],o=["input","calendarContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","days"],i=/\%[a-zA-Z]/,r=function(t){if(i.test(t)){var e=t;return Object.keys(p).forEach(function(t){e=e.replace(RegExp(t,"g"),p[t])}),e}return t},p={"%Y":"Y","%y":"y","%C":"Y","%m":"m","%-m":"n","%_m":"n","%B":"F","%^B":"F","%b":"M","%^b":"M","%h":"M","%^h":"M","%d":"d","%-d":"j","%e":"j","%H":"H","%k":"H","%I":"h","%l":"h","%P":"K","%p":"K","%M":"i","%S":"S","%A":"l","%a":"D","%w":"w"};export default function(t){function i(){t.apply(this,arguments)}t&&(i.__proto__=t),(i.prototype=Object.create(t&&t.prototype)).constructor=i;var p={altInputTarget:{configurable:!0}};return i.prototype.initialize=function(){this.config={}},i.prototype.connect=function(){this.initializeEvents(),this.initializeOptions(),this.initializeDateFormats(),this.fp=e(this.element,Object.assign({},this.config)),this.initializeElements()},i.prototype.disconnect=function(){this.fp.destroy()},i.prototype.initializeEvents=function(){var t=this;a.forEach(function(e){var n,a="on"+((n=e).charAt(0).toUpperCase()+n.slice(1));t.config[a]=t[e].bind(t)})},i.prototype.initializeOptions=function(){var t=this;Object.keys(n).forEach(function(e){n[e].forEach(function(n){var a=n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();t.data.has(a)&&(t.config[n]=t[e](a))})})},i.prototype.initializeDateFormats=function(){this.data.has("date-format")&&(this.config.dateFormat=r(this.data.get("date-format"))),this.data.has("alt-format")&&(this.config.altFormat=r(this.data.get("alt-format"))),this.data.has("aria-date-format")&&(this.config.ariaDateFormat=r(this.data.get("aria-date-format")))},i.prototype.initializeElements=function(){var t=this;o.forEach(function(e){t[e+"Target"]=t.fp[e]})},p.altInputTarget.get=function(){return this.element.querySelector(".flatpickr-input")?this.element.querySelector(".flatpickr-input"):this.element},i.prototype.change=function(){},i.prototype.open=function(){},i.prototype.close=function(){},i.prototype.monthChange=function(){},i.prototype.yearChange=function(){},i.prototype.ready=function(){},i.prototype.valueUpdate=function(){},i.prototype.dayCreate=function(){},i.prototype.string=function(t){return this.data.get(t)},i.prototype.date=function(t){return this.data.get(t)},i.prototype.boolean=function(t){return"true"===this.data.get(t)},i.prototype.array=function(t){return JSON.parse(this.data.get(t))},i.prototype.number=function(t){return parseInt(this.data.get(t))},Object.defineProperties(i.prototype,p),i}(t); | ||
//# sourceMappingURL=stimulus-flatpickr.m.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("stimulus"),require("flatpickr")):"function"==typeof define&&define.amd?define(["stimulus","flatpickr"],e):t.stimulusFlatpickr=e(t.stimulus,t.flatpickr)}(this,function(t,e){e=e&&e.hasOwnProperty("default")?e.default:e;var n={string:["altFormat","altInputClass","ariaDateFormat","dateFormat","defaultDate","mode","nextArrow","prevArrow"],boolean:["altInput","allowInput","clickOpens","disableMobile","enableTime","enableSeconds","inline","noCalendar","shorthandCurrentMonth","static","time_24hr","weekNumbers","wrap"],date:["maxDate","minDate"],array:["disable","enable"],number:["defaultHour","defaultMinute","hourIncrement","minuteIncrement"]},a=["change","open","close","monthChange","yearChange","ready","valueUpdate","dayCreate"],o=["input","calendarContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","days"],i=/\%[a-zA-Z]/,r=function(t){if(i.test(t)){var e=t;return Object.keys(p).forEach(function(t){e=e.replace(RegExp(t,"g"),p[t])}),e}return t},p={"%Y":"Y","%y":"y","%C":"Y","%m":"m","%-m":"n","%_m":"n","%B":"F","%^B":"F","%b":"M","%^b":"M","%h":"M","%^h":"M","%d":"d","%-d":"j","%e":"j","%H":"H","%k":"H","%I":"h","%l":"h","%P":"K","%p":"K","%M":"i","%S":"S","%A":"l","%a":"D","%w":"w"};return function(t){function i(){t.apply(this,arguments)}t&&(i.__proto__=t),(i.prototype=Object.create(t&&t.prototype)).constructor=i;var p={altInputTarget:{configurable:!0}};return i.prototype.initialize=function(){this.config={}},i.prototype.connect=function(){this.initializeEvents(),this.initializeOptions(),this.initializeDateFormats(),this.fp=e(this.element,Object.assign({},this.config)),this.initializeElements()},i.prototype.disconnect=function(){this.fp.destroy()},i.prototype.initializeEvents=function(){var t=this;a.forEach(function(e){var n,a="on"+((n=e).charAt(0).toUpperCase()+n.slice(1));t.config[a]=t[e].bind(t)})},i.prototype.initializeOptions=function(){var t=this;Object.keys(n).forEach(function(e){n[e].forEach(function(n){var a=n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();t.data.has(a)&&(t.config[n]=t[e](a))})})},i.prototype.initializeDateFormats=function(){this.data.has("date-format")&&(this.config.dateFormat=r(this.data.get("date-format"))),this.data.has("alt-format")&&(this.config.altFormat=r(this.data.get("alt-format"))),this.data.has("aria-date-format")&&(this.config.ariaDateFormat=r(this.data.get("aria-date-format")))},i.prototype.initializeElements=function(){var t=this;o.forEach(function(e){t[e+"Target"]=t.fp[e]})},p.altInputTarget.get=function(){return this.element.querySelector(".flatpickr-input")?this.element.querySelector(".flatpickr-input"):this.element},i.prototype.change=function(){},i.prototype.open=function(){},i.prototype.close=function(){},i.prototype.monthChange=function(){},i.prototype.yearChange=function(){},i.prototype.ready=function(){},i.prototype.valueUpdate=function(){},i.prototype.dayCreate=function(){},i.prototype.string=function(t){return this.data.get(t)},i.prototype.date=function(t){return this.data.get(t)},i.prototype.boolean=function(t){return"true"===this.data.get(t)},i.prototype.array=function(t){return JSON.parse(this.data.get(t))},i.prototype.number=function(t){return parseInt(this.data.get(t))},Object.defineProperties(i.prototype,p),i}(t.Controller)}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("stimulus"),require("flatpickr")):"function"==typeof define&&define.amd?define(["stimulus","flatpickr"],e):t.stimulusFlatpickr=e(t.stimulus,t.flatpickr)}(this,function(t,e){e=e&&e.hasOwnProperty("default")?e.default:e;var n={string:["altFormat","altInputClass","ariaDateFormat","conjunction","dateFormat","defaultDate","mode","nextArrow","position","prevArrow"],boolean:["allowInput","altInput","animate","clickOpens","closeOnSelect","disableMobile","enableSeconds","enableTime","inline","noCalendar","shorthandCurrentMonth","static","time_24hr","weekNumbers","wrap"],date:["maxDate","minDate","maxTime","minTime","now"],array:["disable","enable"],number:["defaultHour","defaultMinute","defaultSeconds","hourIncrement","minuteIncrement","showMonths"]},a=["change","open","close","monthChange","yearChange","ready","valueUpdate","dayCreate"],o=["input","calendarContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","days"],i=/\%[a-zA-Z]/,r=function(t){if(i.test(t)){var e=t;return Object.keys(p).forEach(function(t){e=e.replace(RegExp(t,"g"),p[t])}),e}return t},p={"%Y":"Y","%y":"y","%C":"Y","%m":"m","%-m":"n","%_m":"n","%B":"F","%^B":"F","%b":"M","%^b":"M","%h":"M","%^h":"M","%d":"d","%-d":"j","%e":"j","%H":"H","%k":"H","%I":"h","%l":"h","%P":"K","%p":"K","%M":"i","%S":"S","%A":"l","%a":"D","%w":"w"};return function(t){function i(){t.apply(this,arguments)}t&&(i.__proto__=t),(i.prototype=Object.create(t&&t.prototype)).constructor=i;var p={altInputTarget:{configurable:!0}};return i.prototype.initialize=function(){this.config={}},i.prototype.connect=function(){this.initializeEvents(),this.initializeOptions(),this.initializeDateFormats(),this.fp=e(this.element,Object.assign({},this.config)),this.initializeElements()},i.prototype.disconnect=function(){this.fp.destroy()},i.prototype.initializeEvents=function(){var t=this;a.forEach(function(e){var n,a="on"+((n=e).charAt(0).toUpperCase()+n.slice(1));t.config[a]=t[e].bind(t)})},i.prototype.initializeOptions=function(){var t=this;Object.keys(n).forEach(function(e){n[e].forEach(function(n){var a=n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();t.data.has(a)&&(t.config[n]=t[e](a))})})},i.prototype.initializeDateFormats=function(){this.data.has("date-format")&&(this.config.dateFormat=r(this.data.get("date-format"))),this.data.has("alt-format")&&(this.config.altFormat=r(this.data.get("alt-format"))),this.data.has("aria-date-format")&&(this.config.ariaDateFormat=r(this.data.get("aria-date-format")))},i.prototype.initializeElements=function(){var t=this;o.forEach(function(e){t[e+"Target"]=t.fp[e]})},p.altInputTarget.get=function(){return this.element.querySelector(".flatpickr-input")?this.element.querySelector(".flatpickr-input"):this.element},i.prototype.change=function(){},i.prototype.open=function(){},i.prototype.close=function(){},i.prototype.monthChange=function(){},i.prototype.yearChange=function(){},i.prototype.ready=function(){},i.prototype.valueUpdate=function(){},i.prototype.dayCreate=function(){},i.prototype.string=function(t){return this.data.get(t)},i.prototype.date=function(t){return this.data.get(t)},i.prototype.boolean=function(t){return"true"===this.data.get(t)},i.prototype.array=function(t){return JSON.parse(this.data.get(t))},i.prototype.number=function(t){return parseInt(this.data.get(t))},Object.defineProperties(i.prototype,p),i}(t.Controller)}); | ||
//# sourceMappingURL=stimulus-flatpickr.umd.js.map |
{ | ||
"name": "stimulus-flatpickr", | ||
"version": "0.4.0", | ||
"version": "0.4.1-beta.1", | ||
"description": "A Stimulus Wrapper for Flatpickr library", | ||
@@ -5,0 +5,0 @@ "main": "dist/stimulus-flatpickr.js", |
const booleanOptions = [ | ||
"allowInput", | ||
"altInput", | ||
"allowInput", | ||
"animate", | ||
"clickOpens", | ||
"closeOnSelect", | ||
"disableMobile", | ||
"enableSeconds", | ||
"enableTime", | ||
"enableSeconds", | ||
"inline", | ||
@@ -21,2 +23,3 @@ "noCalendar", | ||
"ariaDateFormat", | ||
"conjunction", | ||
"dateFormat", | ||
@@ -26,2 +29,3 @@ "defaultDate", | ||
"nextArrow", | ||
"position", | ||
"prevArrow" | ||
@@ -33,4 +37,6 @@ ]; | ||
"defaultMinute", | ||
"defaultSeconds", | ||
"hourIncrement", | ||
"minuteIncrement" | ||
"minuteIncrement", | ||
"showMonths" | ||
]; | ||
@@ -40,3 +46,3 @@ | ||
const dateOptions = ["maxDate", "minDate"]; | ||
const dateOptions = ["maxDate", "minDate", "maxTime", "minTime", "now"]; | ||
@@ -43,0 +49,0 @@ export const options = { |
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
219830
247