bulma-extensions
Advanced tools
Comparing version 0.5.2 to 0.5.4
@@ -1,21 +0,21 @@ | ||
let accordions = document.querySelectorAll('.accordions'); | ||
if (accordions) { | ||
accordions.forEach(accordion => { | ||
let items = accordion.querySelectorAll('.accordion'); | ||
if (items) { | ||
items.forEach(item => { | ||
item.querySelector('.toggle').addEventListener('click', e => { | ||
e.preventDefault(); | ||
let currentItem = e.target.parentNode.parentNode; | ||
if (!currentItem.classList.contains('is-active')) { | ||
let activeItem = accordion.querySelector('.accordion.is-active'); | ||
if (activeItem) { | ||
activeItem.classList.remove('is-active'); | ||
} | ||
currentItem.classList.add('is-active'); | ||
document.addEventListener( 'DOMContentLoaded', function () { | ||
var accordions = document.querySelectorAll('.accordions'); | ||
[].forEach.call(accordions, function(accordion) { | ||
var items = accordion.querySelectorAll('.accordion'); | ||
[].forEach.call(items, function(item) { | ||
item.querySelector('.toggle').addEventListener('click', e => { | ||
e.preventDefault(); | ||
let currentItem = e.target.parentNode.parentNode; | ||
if (!currentItem.classList.contains('is-active')) { | ||
let activeItem = accordion.querySelector('.accordion.is-active'); | ||
if (activeItem) { | ||
activeItem.classList.remove('is-active'); | ||
} | ||
}); | ||
currentItem.classList.add('is-active'); | ||
} else { | ||
currentItem.classList.remove('is-active'); | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
} | ||
}); |
@@ -1,1 +0,1 @@ | ||
var accordions=document.querySelectorAll(".accordions");accordions&&accordions.forEach(function(c){var a=c.querySelectorAll(".accordion");a&&a.forEach(function(a){a.querySelector(".toggle").addEventListener("click",function(b){b.preventDefault();b=b.target.parentNode.parentNode;if(!b.classList.contains("is-active")){var a=c.querySelector(".accordion.is-active");a&&a.classList.remove("is-active");b.classList.add("is-active")}})})}); | ||
document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll(".accordions");[].forEach.call(a,function(c){var a=c.querySelectorAll(".accordion");[].forEach.call(a,function(a){a.querySelector(".toggle").addEventListener("click",function(b){b.preventDefault();b=b.target.parentNode.parentNode;if(b.classList.contains("is-active"))b.classList.remove("is-active");else{var a=c.querySelector(".accordion.is-active");a&&a.classList.remove("is-active");b.classList.add("is-active")}})})})}); |
{ | ||
"name": "bulma-accordion", | ||
"version": "0.1.4", | ||
"version": "0.1.8", | ||
"description": "A simple accordion extension for Bulma", | ||
@@ -5,0 +5,0 @@ "main": "accordion.sass", |
# bulma-accordion | ||
A simple accordion extension for Bulma | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-accordion.svg)](https://www.npmjs.com/package/bulma-accordion) |
# bulma-badge | ||
Bulma's extension element named "badge" to display a number on text, button, ... | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-badge.svg)](https://www.npmjs.com/package/bulma-badge) |
@@ -28,2 +28,47 @@ var datepicker_langs = { | ||
weekdaysShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'] | ||
}, | ||
tr: { | ||
weekStart: 1, | ||
previousMonth: 'Önceki Ay', | ||
nextMonth: 'Gelecek Ay', | ||
months: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], | ||
monthsShort: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], | ||
weekdays: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], | ||
weekdaysShort: ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'] | ||
}, | ||
it: { | ||
weekStart: 1, | ||
previousMonth: 'Mese Precedente', | ||
nextMonth: 'Prossimo Mese', | ||
months: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'], | ||
monthsShort: ['Gen', 'Feb', 'Mar', 'Apr', 'Mag', 'Giu', 'Lug', 'Ago', 'Set', 'Ott', 'Nov', 'Dic'], | ||
weekdays: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], | ||
weekdaysShort: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'] | ||
}, | ||
th: { | ||
weekStart: 1, | ||
previousMonth: 'เดือนก่อนหน้า', | ||
nextMonth: 'เดือนถัดไป', | ||
months: ['มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฎาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม'], | ||
monthsShort: ['ม.ค.','ก.พ.','มี.ค.','เม.ย.','พ.ค.','มิ.ย.','ก.ค.','ส.ค.','ก.ย.','ต.ค.','พ.ย.','ธ.ค.'], | ||
weekdays: ['อาทิตย์','จันทร์','อังคาร','พุธ','พฤหัสบดี','ศุกร์','เสาร์'], | ||
weekdaysShort: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'] | ||
}, | ||
hr: { | ||
weekStart: 2, | ||
previousMonth: 'Prošli mjesec', | ||
nextMonth: 'Slijedeći mjesec', | ||
months: ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'], | ||
monthsShort: ['sij', 'velj', 'ožu', 'tra', 'svi', 'lip', 'srp', 'kol', 'ruj', 'lis', 'stu', 'pro'], | ||
weekdays: ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], | ||
weekdaysShort: ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'] | ||
}, | ||
sr: { | ||
weekStart: 2, | ||
previousMonth: 'Prošli mesec', | ||
nextMonth: 'Sledeći mesec', | ||
months: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], | ||
monthsShort: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec'], | ||
weekdays: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], | ||
weekdaysShort: ['ned', 'pon', 'uto', 'sre', 'čet', 'pet', 'sub'] | ||
} | ||
@@ -321,3 +366,3 @@ } | ||
calendarBody.append(this.renderDay(day.getDate(), this.month, this.year, isSelected, isToday, isDisabled, isEmpty, isBetween, isSelectedIn, isSelectedOut)); | ||
calendarBody.appendChild(this.renderDay(day.getDate(), this.month, this.year, isSelected, isToday, isDisabled, isEmpty, isBetween, isSelectedIn, isSelectedOut)); | ||
} | ||
@@ -324,0 +369,0 @@ } |
@@ -5,4 +5,9 @@ var $jscomp={scope:{},owns:function(a,b){return Object.prototype.hasOwnProperty.call(a,b)}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this); | ||
monthsShort:"Jan F\u00e9v Mar Avr Mai Juin Juil Auo Sep Oct Nov D\u00e9c".split(" "),weekdays:"Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi".split(" "),weekdaysShort:"Dim Lun Mar Mer Jeu Ven Sam".split(" ")},de:{weekStart:1,previousMonth:"Vorheriger Monat",nextMonth:"N\u00e4chster Monat",months:"Januar Februar M\u00e4rz April Mai Juni Juli August September Oktober November Dezember".split(" "),monthsShort:"Jan Febr M\u00e4rz Apr Mai Juni Juli Aug Sept Okt Nov Dez".split(" "),weekdays:"Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag".split(" "), | ||
weekdaysShort:"So Mo Di Mi Do Fr Sa".split(" ")}},DatePicker=function(a,b){b||(b={});var c={startDate:new Date,dataFormat:"yyyy/mm/dd",lang:"en",overlay:!1,closeOnSelect:!0,onSelect:null,onOpen:null,onClose:null,onRender:null};this.element="string"===typeof a?document.querySelector(a):a;if(!this.element)throw Error("An invalid selector or non-DOM node has been provided.");this.parent=this.element.parentElement;this.lang="undefined"!==typeof datepicker_langs[this.lang]?this.lang:"en";this.options= | ||
Object.assign({},c,b);this.month=this.options.startDate.getMonth();this.year=this.options.startDate.getFullYear();this.open=!1;this.build()}; | ||
weekdaysShort:"So Mo Di Mi Do Fr Sa".split(" ")},tr:{weekStart:1,previousMonth:"\u00d6nceki Ay",nextMonth:"Gelecek Ay",months:"Ocak \u015eubat Mart Nisan May\u0131s Haziran Temmuz A\u011fustos Eyl\u00fcl Ekim Kas\u0131m Aral\u0131k".split(" "),monthsShort:"Oca \u015eub Mar Nis May Haz Tem A\u011fu Eyl Eki Kas Ara".split(" "),weekdays:"Pazar Pazartesi Sal\u0131 \u00c7ar\u015famba Per\u015fembe Cuma Cumartesi".split(" "),weekdaysShort:"Paz Pzt Sal \u00c7ar Per Cum Cmt".split(" ")},it:{weekStart:1,previousMonth:"Mese Precedente", | ||
nextMonth:"Prossimo Mese",months:"Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre".split(" "),monthsShort:"Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic".split(" "),weekdays:"Domenica Luned\u00ec Marted\u00ec Mercoled\u00ec Gioved\u00ec Venerd\u00ec Sabato".split(" "),weekdaysShort:"Dom Lun Mar Mer Gio Ven Sab".split(" ")},th:{weekStart:1,previousMonth:"\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e01\u0e48\u0e2d\u0e19\u0e2b\u0e19\u0e49\u0e32",nextMonth:"\u0e40\u0e14\u0e37\u0e2d\u0e19\u0e16\u0e31\u0e14\u0e44\u0e1b", | ||
months:"\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21 \u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c \u0e21\u0e35\u0e19\u0e32\u0e04\u0e21 \u0e40\u0e21\u0e29\u0e32\u0e22\u0e19 \u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21 \u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19 \u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21 \u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21 \u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19 \u0e15\u0e38\u0e25\u0e32\u0e04\u0e21 \u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19 \u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21".split(" "), | ||
monthsShort:"\u0e21.\u0e04. \u0e01.\u0e1e. \u0e21\u0e35.\u0e04. \u0e40\u0e21.\u0e22. \u0e1e.\u0e04. \u0e21\u0e34.\u0e22. \u0e01.\u0e04. \u0e2a.\u0e04. \u0e01.\u0e22. \u0e15.\u0e04. \u0e1e.\u0e22. \u0e18.\u0e04.".split(" "),weekdays:"\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c \u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c \u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23 \u0e1e\u0e38\u0e18 \u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35 \u0e28\u0e38\u0e01\u0e23\u0e4c \u0e40\u0e2a\u0e32\u0e23\u0e4c".split(" "),weekdaysShort:"\u0e2d\u0e32. \u0e08. \u0e2d. \u0e1e. \u0e1e\u0e24. \u0e28. \u0e2a.".split(" ")}, | ||
hr:{weekStart:2,previousMonth:"Pro\u0161li mjesec",nextMonth:"Slijede\u0107i mjesec",months:"sije\u010danj velja\u010da o\u017eujak travanj svibanj lipanj srpanj kolovoz rujan listopad studeni prosinac".split(" "),monthsShort:"sij velj o\u017eu tra svi lip srp kol ruj lis stu pro".split(" "),weekdays:"nedjelja ponedjeljak utorak srijeda \u010detvrtak petak subota".split(" "),weekdaysShort:"ned pon uto sri \u010det pet sub".split(" ")},sr:{weekStart:2,previousMonth:"Pro\u0161li mesec",nextMonth:"Slede\u0107i mesec", | ||
months:"januar februar mart april maj jun jul avgust septembar oktobar novembar decembar".split(" "),monthsShort:"jan feb mar apr maj jun jul avg sep okt nov dec".split(" "),weekdays:"nedelja ponedeljak utorak sreda \u010detvrtak petak subota".split(" "),weekdaysShort:"ned pon uto sre \u010det pet sub".split(" ")}},DatePicker=function(a,b){b||(b={});var c={startDate:new Date,dataFormat:"yyyy/mm/dd",lang:"en",overlay:!1,closeOnSelect:!0,onSelect:null,onOpen:null,onClose:null,onRender:null};this.element= | ||
"string"===typeof a?document.querySelector(a):a;if(!this.element)throw Error("An invalid selector or non-DOM node has been provided.");this.parent=this.element.parentElement;this.lang="undefined"!==typeof datepicker_langs[this.lang]?this.lang:"en";this.options=Object.assign({},c,b);this.month=this.options.startDate.getMonth();this.year=this.options.startDate.getFullYear();this.open=!1;this.build()}; | ||
DatePicker.prototype.build=function(){var a=this;this.datePickerContainer=document.createElement("div");this.datePickerContainer.id="datePicker"+(new Date).getTime();this.options.overlay&&this.datePickerContainer.classList.add("modal");this.datePickerContainer.classList.add("datepicker");this.calendarContainer=document.createElement("div");this.calendarContainer.id="datePicker"+(new Date).getTime();this.calendarContainer.classList.add("calendar");this.renderCalendar();if(this.options.overlay){var b= | ||
@@ -19,3 +24,3 @@ document.createElement("div");b.classList.add("modal-background");this.datePickerContainer.appendChild(b)}b=document.createElement("button");b.className="modal-close";b.addEventListener("click",function(b){b.preventDefault();a.datePickerContainer.classList.remove("is-active")});this.datePickerContainer.appendChild(this.calendarContainer);this.datePickerContainer.appendChild(b);document.body.appendChild(this.datePickerContainer);this.element.addEventListener("click",function(b){b.preventDefault(); | ||
DatePicker.prototype.renderCalendar=function(){var a=new Date,b=this.renderNav(this.year,this.month),c=this.renderHeader(),g=this.renderBody();this.calendarContainer.appendChild(b);this.calendarContainer.appendChild(c);this.calendarContainer.appendChild(g);b=this.getDaysInMonth(this.year,this.month);c=(new Date(this.year,this.month,1)).getDay();if("undefined"!=typeof this.options.onRender&&null!=this.options.onRender&&this.options.onRender)this.options.onRender(this);0<datepicker_langs[this.options.lang].weekStart&& | ||
(c-=datepicker_langs[this.options.lang].weekStart,0>c&&(c+=7));for(var e=b+c,d=e;7<d;)d-=7;e+=7-d;for(d=0;d<e;d++){var f=new Date(this.year,this.month,1+(d-c)),h=this.compareDates(f,a),n=d<c||d>=b+c,l=!1;f.getMonth()!==this.month&&(l=!0);g.append(this.renderDay(f.getDate(),this.month,this.year,!1,h,l,n,!1,!1,!1))}};DatePicker.prototype.prevMonth=function(){--this.month;this.adjustCalendar();this.renderCalendar()};DatePicker.prototype.nextMonth=function(){this.month+=1;this.adjustCalendar();this.renderCalendar()}; | ||
(c-=datepicker_langs[this.options.lang].weekStart,0>c&&(c+=7));for(var e=b+c,d=e;7<d;)d-=7;e+=7-d;for(d=0;d<e;d++){var f=new Date(this.year,this.month,1+(d-c)),h=this.compareDates(f,a),n=d<c||d>=b+c,l=!1;f.getMonth()!==this.month&&(l=!0);g.appendChild(this.renderDay(f.getDate(),this.month,this.year,!1,h,l,n,!1,!1,!1))}};DatePicker.prototype.prevMonth=function(){--this.month;this.adjustCalendar();this.renderCalendar()};DatePicker.prototype.nextMonth=function(){this.month+=1;this.adjustCalendar();this.renderCalendar()}; | ||
DatePicker.prototype.prevYear=function(){--this.year;this.adjustCalendar();this.renderCalendar()};DatePicker.prototype.nextYear=function(){this.year+=1;this.adjustCalendar();this.renderCalendar()};DatePicker.prototype.show=function(){if("undefined"!=typeof this.options.onOpen&&null!=this.options.onOpen&&this.options.onOpen)this.options.onOpen(this);this.datePickerContainer.classList.add("is-active");this.options.overlay||this.adjustPosition();this.open=!0}; | ||
@@ -22,0 +27,0 @@ DatePicker.prototype.hide=function(){this.open=!1;if("undefined"!=typeof this.options.onClose&&null!=this.options.onClose&&this.options.onClose)this.options.onClose(this);this.datePickerContainer.classList.remove("is-active")};DatePicker.prototype.adjustCalendar=function(){0>this.month&&(this.year-=Math.ceil(Math.abs(this.month)/12),this.month+=12);11<this.month&&(this.year+=Math.floor(Math.abs(this.month)/12),this.month-=12);this.calendarContainer.innerHTML="";return this}; |
{ | ||
"name": "bulma-calendar", | ||
"version": "0.1.3", | ||
"version": "0.1.5", | ||
"description": "Display a calendar for date selection or for planning management, in different colors and sizes", | ||
@@ -5,0 +5,0 @@ "main": "calendar.sass", |
# bulma-calendar | ||
Bulma's extension to display a calendar. It can be used on page as large calendar with apointments or in modal/popup for datepicker. | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -11,4 +11,58 @@ [![npm](https://img.shields.io/npm/v/bulma-calendar.svg)](https://www.npmjs.com/package/bulma-calendar) | ||
# Examples | ||
### Date format | ||
```js | ||
date = new DatePicker(document.querySelector('.sr-date'), { | ||
dataFormat: 'd MM yyyy' // 1 January 2018 | ||
}); | ||
``` | ||
where `dataFormat` is a string with a combination of this values: | ||
``` | ||
d: short day (1-31) | ||
dd: long day (00-31) | ||
D: weekday (es: Monday) | ||
m: short month (1-12) | ||
mm: long month (01-12) | ||
M: short month name (es: Jan, Feb) | ||
MM: full month name (es: January) | ||
yy: short year (18) | ||
yyyy: full year (2018) | ||
``` | ||
### Language | ||
```js | ||
date = new DatePicker(document.querySelector('.sr-date'), { | ||
lang: 'it' // one of: en (default), fr, de, tr, it, th | ||
}); | ||
``` | ||
### Other options | ||
Here's the options object and the default values as appears on code. | ||
```js | ||
var defaultOptions = { | ||
startDate: new Date(), | ||
// the default data format `field` value | ||
dataFormat: 'yyyy/mm/dd', | ||
// internationalization | ||
lang: 'en', | ||
overlay: false, | ||
closeOnSelect: true, | ||
// callback function | ||
onSelect: null, // callback(new Date(year, month, day)) | ||
onOpen: null, // callback(this) | ||
onClose: null, // callback(this) | ||
onRender: null // callback(this) | ||
}; | ||
``` | ||
Documentation & Demo | ||
--- | ||
You can find the Documentation and a demo [here](https://wikiki.github.io/components/calendar/) |
@@ -32,3 +32,3 @@ class Carousel { | ||
if (nbItems) { | ||
this.items.forEach((item, index) => { | ||
[].forEach.call(this.items, function(item, index) { | ||
let newValue; | ||
@@ -83,9 +83,7 @@ if (item.style.order) { | ||
window.onload = function() { | ||
let carousels = document.querySelectorAll('.carousel, .hero-carousel'); | ||
if (carousels) { | ||
carousels.forEach(element => { | ||
new Carousel(element); | ||
}) | ||
} | ||
}; | ||
document.addEventListener( 'DOMContentLoaded', function () { | ||
var carousels = document.querySelectorAll('.carousel, .hero-carousel'); | ||
[].forEach.call(carousels, function(carousel) { | ||
new Carousel(carousel); | ||
}); | ||
}); |
var Carousel=function(a){this.element=a;this.init()};Carousel.prototype.init=function(){var a=this;this.carouselContent=this.element.querySelector(".carousel-content");this.items=this.carouselContent.querySelectorAll(".carousel-item");this.element.querySelector(".carousel-nav-left").addEventListener("click",function(b){a.prevSlide()},!1);this.element.querySelector(".carousel-nav-right").addEventListener("click",function(b){a.nextSlide()},!1);this.setOrder()}; | ||
Carousel.prototype.setOrder=function(a){"previous"===a?a=1:"next"===a&&(a=-1);var b=this.items.length;b&&this.items.forEach(function(c,e){var d;(d=c.style.order?(parseInt(c.style.order,10)+a)%b:(e+2)%b)&&2===d?(c.style["z-index"]="1",c.classList.add("is-active")):(c.style["z-index"]="0",c.classList.remove("is-active"));c.style.order=d?d:b})}; | ||
Carousel.prototype.setOrder=function(a){"previous"===a?a=1:"next"===a&&(a=-1);var b=this.items.length;b&&[].forEach.call(this.items,function(c,e){var d;(d=c.style.order?(parseInt(c.style.order,10)+a)%b:(e+2)%b)&&2===d?(c.style["z-index"]="1",c.classList.add("is-active")):(c.style["z-index"]="0",c.classList.remove("is-active"));c.style.order=d?d:b})}; | ||
Carousel.prototype.prevSlide=function(a){var b=this;this.carouselContent.classList.add("carousel-reverse");this.carouselContent.classList.toggle("carousel-animate");this.setOrder("previous");setTimeout(function(){b.carouselContent.classList.toggle("carousel-animate")},50)}; | ||
Carousel.prototype.nextSlide=function(a){var b=this;this.carouselContent.classList.remove("carousel-reverse");this.carouselContent.classList.toggle("carousel-animate");this.setOrder("next");setTimeout(function(){b.carouselContent.classList.toggle("carousel-animate")},50)};window.onload=function(){var a=document.querySelectorAll(".carousel, .hero-carousel");a&&a.forEach(function(a){new Carousel(a)})}; | ||
Carousel.prototype.nextSlide=function(a){var b=this;this.carouselContent.classList.remove("carousel-reverse");this.carouselContent.classList.toggle("carousel-animate");this.setOrder("next");setTimeout(function(){b.carouselContent.classList.toggle("carousel-animate")},50)};document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll(".carousel, .hero-carousel");[].forEach.call(a,function(a){new Carousel(a)})}); |
{ | ||
"name": "bulma-carousel", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Display a Image / Content carousel", | ||
@@ -5,0 +5,0 @@ "main": "carousel.sass", |
@@ -6,5 +6,5 @@ # bulma-carousel | ||
[![npm](https://img.shields.io/npm/v/bulma-badge.svg)](https://www.npmjs.com/package/bulma-carousel) | ||
[![npm](https://img.shields.io/npm/dm/bulma-badge.svg)](https://www.npmjs.com/package/bulma-carousel) | ||
[![Build Status](https://travis-ci.org/Wikiki/bulma-badge.svg?branch=master)](https://travis-ci.org/Wikiki/bulma-carousel) | ||
[![npm](https://img.shields.io/npm/v/bulma-carousel.svg)](https://www.npmjs.com/package/bulma-carousel) | ||
[![npm](https://img.shields.io/npm/dm/bulma-carousel.svg)](https://www.npmjs.com/package/bulma-carousel) | ||
[![Build Status](https://travis-ci.org/Wikiki/bulma-carousel.svg?branch=master)](https://travis-ci.org/Wikiki/bulma-carousel) | ||
@@ -11,0 +11,0 @@ Documentation & Demo |
# bulma-checkradio | ||
Bulma's extension to display better checkbox and radio imputs | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-checkradio.svg)](https://www.npmjs.com/package/bulma-checkradio) |
# bulma-divider | ||
Bulma's extension to easily display an horizontal or vertical divider | ||
(find all my bulma's ext(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-divider.svg)](https://www.npmjs.com/package/bulma-divider) |
@@ -194,4 +194,5 @@ let fetchStyle = function(url) { | ||
this.modalSetTabs.querySelectorAll('.is-active').forEach( el => { | ||
el.classList.remove('is-active'); | ||
var activeModalTabs = this.modalSetTabs.querySelectorAll('.is-active'); | ||
[].forEach.call(activeModalTabs, function(activeModalTab) { | ||
activeModalTab.classList.remove('is-active'); | ||
}); | ||
@@ -241,13 +242,10 @@ | ||
if (typeof iconPickerOptions === undefined || iconPickerOptions === null) { | ||
let iconPickerOptions = {}; | ||
} | ||
console.log(iconPickerOptions); | ||
let iconPickers = document.querySelectorAll('[data-action="iconPicker"]'); | ||
if (iconPickers) { | ||
iconPickers.forEach(element => { | ||
if (!element.dataset.iconPicker) { | ||
element.dataset.iconPicker = new IconPicker(element, iconPickerOptions || {}); | ||
document.addEventListener( 'DOMContentLoaded', function () { | ||
let iconPickers = document.querySelectorAll('[data-action="iconPicker"]'); | ||
let iconPickerOptions = {}; | ||
[].forEach.call(iconPickers, function(iconPicker) { | ||
if (!iconPicker.dataset.iconPicker) { | ||
iconPicker.dataset.iconPicker = new IconPicker(iconPicker, iconPickerOptions); | ||
} | ||
}) | ||
} | ||
}); | ||
}); |
@@ -25,5 +25,5 @@ var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,d){if(d.get||d.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=d.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; | ||
document.createElement("input");this.modalHeaderSearch.setAttribute("type","search");this.modalHeaderSearch.setAttribute("placeholder","Search");this.modalHeaderSearch.className="iconpicker-search";this.modalHeaderSearch.addEventListener("input",function(b){a.filter(b.target.value)});var f=document.createElement("button");f.className="delete";f.addEventListener("click",function(b){b.preventDefault();a.modal.classList.remove("is-active")});d.appendChild(c);this.modalBody=document.createElement("section"); | ||
this.modalBody.className="modal-card-body";if(1<=this.options.iconSets.length){var g=document.createElement("div");g.className="iconpicker-sets";g.classList.add("tabs");this.modalSetTabs=document.createElement("ul");this.options.iconSets.forEach(function(b){var c=document.createElement("li"),d=document.createElement("a");d.dataset.iconset=b.name;d.innerHTML=b.name;d.addEventListener("click",function(b){b.preventDefault();a.modalSetTabs.querySelectorAll(".is-active").forEach(function(a){a.classList.remove("is-active")}); | ||
this.modalBody.className="modal-card-body";if(1<=this.options.iconSets.length){var g=document.createElement("div");g.className="iconpicker-sets";g.classList.add("tabs");this.modalSetTabs=document.createElement("ul");this.options.iconSets.forEach(function(b){var c=document.createElement("li"),d=document.createElement("a");d.dataset.iconset=b.name;d.innerHTML=b.name;d.addEventListener("click",function(b){b.preventDefault();var c=a.modalSetTabs.querySelectorAll(".is-active");[].forEach.call(c,function(a){a.classList.remove("is-active")}); | ||
b.target.parentNode.classList.add("is-active");a.drawIcons(a.icons[b.target.dataset.iconset]);a.filter(a.modalHeaderSearch.value)});c.appendChild(d);a.modalSetTabs.appendChild(c)});g.appendChild(this.modalSetTabs);d.appendChild(g)}this.iconsList=document.createElement("div");this.iconsList.className="iconpicker-icons";c.appendChild(e);c.appendChild(this.modalHeaderSearch);c.appendChild(f);this.modalBody.appendChild(this.iconsList);d.appendChild(this.modalBody);this.modal.appendChild(b);this.modal.appendChild(d); | ||
document.body.appendChild(this.modal)};IconPicker.prototype.filter=function(a){a=void 0===a?"":a;""===a?this.iconsList.querySelectorAll("[data-filter]").forEach(function(a){a.classList.remove("is-hidden")}):(this.iconsList.querySelectorAll("[data-filter]").forEach(function(a){a.classList.remove("is-hidden")}),this.iconsList.querySelectorAll('[data-filter]:not([data-filter*="'+a+'"])').forEach(function(a){a.classList.add("is-hidden")}))};if(null===iconPickerOptions)var iconPickerOptions$1={};console.log(iconPickerOptions); | ||
var iconPickers=document.querySelectorAll('[data-action="iconPicker"]');iconPickers&&iconPickers.forEach(function(a){a.dataset.iconPicker||(a.dataset.iconPicker=new IconPicker(a,iconPickerOptions||{}))}); | ||
document.body.appendChild(this.modal)};IconPicker.prototype.filter=function(a){a=void 0===a?"":a;""===a?this.iconsList.querySelectorAll("[data-filter]").forEach(function(a){a.classList.remove("is-hidden")}):(this.iconsList.querySelectorAll("[data-filter]").forEach(function(a){a.classList.remove("is-hidden")}),this.iconsList.querySelectorAll('[data-filter]:not([data-filter*="'+a+'"])').forEach(function(a){a.classList.add("is-hidden")}))}; | ||
document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll('[data-action="iconPicker"]'),b={};[].forEach.call(a,function(a){a.dataset.iconPicker||(a.dataset.iconPicker=new IconPicker(a,b))})}); |
{ | ||
"name": "bulma-iconpicker", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A wonderful customizable icon picker for your Bulma project", | ||
@@ -5,0 +5,0 @@ "main": "iconPicker.sass", |
# bulma-iconpicker | ||
A wonderful customizable icon picker for your Bulma project | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-iconpicker.svg)](https://www.npmjs.com/package/bulma-iconpicker) |
# bulma-pageloader | ||
Bulma's extension to show a page loader overlay of the whole page. | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-pageloader.svg)](https://www.npmjs.com/package/bulma-pageloader) |
{ | ||
"name": "bulma-pricingtable", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Display a pricing table easily. ", | ||
@@ -32,7 +32,8 @@ "main": "pricing-table.sass", | ||
"pricing-table.sass", | ||
"bulma-pricing-table.css", | ||
"bulma-pricing-table.min.css", | ||
"bulma-pricingtable.css", | ||
"bulma-pricingtable.min.css", | ||
"LICENSE", | ||
"CHANGELOG.md", | ||
"README.md" | ||
] | ||
} |
# bulma-pricingtable | ||
Display a pricing table with Bulma | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-pricingtable.svg)](https://www.npmjs.com/package/bulma-pricingtable) |
{ | ||
"name": "bulma-quickview", | ||
"version": "0.1.0", | ||
"version": "0.1.2", | ||
"description": "Display a quick view of data without leaving the current page", | ||
@@ -5,0 +5,0 @@ "main": "quickview.sass", |
# bulma-quickview | ||
Bulma's extension to display quick view of data without leaving the current page | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-quickview.svg)](https://www.npmjs.com/package/bulma-quickview) |
# bulma-ribbon | ||
Bulma's extension to show a ribbon on boxes | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-ribbon.svg)](https://www.npmjs.com/package/bulma-ribbon) |
{ | ||
"name": "bulma-slider", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Display classic slider more sexy, in different colors, sizes, and states ", | ||
@@ -5,0 +5,0 @@ "main": "slider.sass", |
# bulma-slider | ||
Bulma's extension to display sliders | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-slider.svg)](https://www.npmjs.com/package/bulma-slider) |
{ | ||
"name": "bulma-steps", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Display steps for a process (like sign-up, or order, form), in different colors, sizes, and states ", | ||
@@ -5,0 +5,0 @@ "main": "steps.sass", |
# bulma-steps | ||
Bulma's extension to manage steps | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-steps.svg)](https://www.npmjs.com/package/bulma-steps) |
# bulma-switch | ||
Bulma's extension to display checkbox as a toggle button | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-switch.svg)](https://www.npmjs.com/package/bulma-switch) |
{ | ||
"name": "bulma-tagsinput", | ||
"version": "0.1.3", | ||
"version": "0.1.8", | ||
"description": "Bulma.io extension to add interaction on input tags", | ||
@@ -5,0 +5,0 @@ "main": "tagsinput.sass", |
@@ -0,1 +1,40 @@ | ||
if (typeof Object.assign != 'function') { | ||
// Must be writable: true, enumerable: false, configurable: true | ||
Object.defineProperty(Object, "assign", { | ||
value: function assign(target, varArgs) { // .length of function is 2 | ||
'use strict'; | ||
if (target == null) { // TypeError if undefined or null | ||
throw new TypeError('Cannot convert undefined or null to object'); | ||
} | ||
var to = Object(target); | ||
for (var index = 1; index < arguments.length; index++) { | ||
var nextSource = arguments[index]; | ||
if (nextSource != null) { // Skip over if undefined or null | ||
for (var nextKey in nextSource) { | ||
// Avoid bugs when hasOwnProperty is shadowed | ||
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { | ||
to[nextKey] = nextSource[nextKey]; | ||
} | ||
} | ||
} | ||
} | ||
return to; | ||
}, | ||
writable: true, | ||
configurable: true | ||
}); | ||
} | ||
var KEY_BACKSPACE = 8, | ||
KEY_TAB = 9, | ||
KEY_ENTER = 13, | ||
KEY_LEFT = 37, | ||
KEY_RIGHT = 39, | ||
KEY_DELETE = 46, | ||
KEY_COMMA = 188; | ||
class Tagify { | ||
@@ -20,2 +59,3 @@ constructor(element, options = {}) { | ||
this.tags = []; | ||
// The container will visually looks like an input | ||
this.container = document.createElement('div'); | ||
@@ -32,4 +72,6 @@ this.container.className = 'tagsinput'; | ||
} | ||
// Create an invisible input element so user will be able to enter value | ||
this.input = document.createElement('input'); | ||
this.input.setAttribute('type', inputType); | ||
this.input.setAttribute('placeholder', 'Add a Tag'); | ||
this.container.appendChild(this.input); | ||
@@ -50,35 +92,37 @@ | ||
this.element.addEventListener('focus', () => { | ||
this.container.classList.add('focus'); | ||
this.select(); | ||
this.container.classList.add('is-focused'); | ||
this.select((Array.prototype.slice.call(this.container.querySelectorAll('.tag:not(.is-delete)'))).pop()); | ||
}); | ||
this.input.addEventListener('focus', () => { | ||
this.container.classList.add('focus'); | ||
this.select(); | ||
this.container.classList.add('is-focused'); | ||
this.select((Array.prototype.slice.call(this.container.querySelectorAll('.tag:not(.is-delete)'))).pop()); | ||
}); | ||
this.input.addEventListener('blur', () => { | ||
this.container.classList.remove('focus'); | ||
this.select(); | ||
this.container.classList.remove('is-focused'); | ||
this.select((Array.prototype.slice.call(this.container.querySelectorAll('.tag:not(.is-delete)'))).pop()); | ||
this.savePartial(); | ||
}); | ||
this.input.addEventListener('keydown', (e) => { | ||
let key = e.keyCode || e.which, | ||
let key = e.charCode || e.keyCode || e.which, | ||
selectedTag, | ||
activeTag = this.container.querySelector('.is-active'), | ||
last = (Array.prototype.slice.call(this.container.querySelectorAll('.tag'))).pop(), | ||
atStart = this.caretAtStart(e); | ||
activeTag = this.container.querySelector('.tag.is-active'), | ||
last = (Array.prototype.slice.call(this.container.querySelectorAll('.tag:not(.is-delete)'))).pop(), | ||
atStart = this.caretAtStart(this.input); | ||
if (activeTag) { | ||
selectedTag = this.container.querySelector('[data-tag="' + activeTag.innerHTML + '"]'); | ||
selectedTag = this.container.querySelector('[data-tag="' + activeTag.innerHTML.trim() + '"]'); | ||
} | ||
this.setInputWidth(); | ||
if (key === 13 || key === this.options.delimiter.charCodeAt(0) || key === 9) { | ||
if (!this.input.value && key !== this.options.delimiter.charCodeAt(0)) { | ||
if (key === KEY_ENTER || key === this.options.delimiter.charCodeAt(0) || key === KEY_COMMA || key === KEY_TAB) { | ||
if (!this.input.value && (key !== this.options.delimiter.charCodeAt(0) || key === KEY_COMMA)) { | ||
return; | ||
} | ||
this.savePartial(); | ||
} else if (key === 46 && selectedTag) { | ||
if (selectedTag.nextSibling !== this.input) { | ||
this.select(selectedTag.nextSibling); | ||
} else if (key === KEY_DELETE && selectedTag) { | ||
if (selectedTag.nextSibling) { | ||
this.select(selectedTag.nextSibling.querySelector('.tag')); | ||
} else if (selectedTag.previousSibling) { | ||
this.select(selectedTag.previousSibling.querySelector('.tag')); | ||
} | ||
@@ -89,5 +133,9 @@ this.container.removeChild(selectedTag); | ||
this.save(); | ||
} else if (key === 8) { | ||
} else if (key === KEY_BACKSPACE) { | ||
if (selectedTag) { | ||
this.select(selectedTag.previousSibling); | ||
if (selectedTag.previousSibling) { | ||
this.select(selectedTag.previousSibling.querySelector('.tag')); | ||
} else if (selectedTag.nextSibling) { | ||
this.select(selectedTag.nextSibling.querySelector('.tag')); | ||
} | ||
this.container.removeChild(selectedTag); | ||
@@ -97,13 +145,11 @@ delete this.tags[this.tags.indexOf(selectedTag.getAttribute('data-tag'))]; | ||
this.save(); | ||
} | ||
else if (last && atStart) { | ||
} else if (last && atStart) { | ||
this.select(last); | ||
} | ||
else { | ||
} else { | ||
return; | ||
} | ||
} else if (key === 37) { | ||
} else if (key === KEY_LEFT) { | ||
if (selectedTag) { | ||
if (selectedTag.previousSibling) { | ||
select(selectedTag.previousSibling); | ||
this.select(selectedTag.previousSibling.querySelector('.tag')); | ||
} | ||
@@ -116,7 +162,7 @@ } else if (!atStart) { | ||
} | ||
else if (key === 39) { | ||
else if (key === KEY_RIGHT) { | ||
if (!selectedTag) { | ||
return; | ||
} | ||
this.select(selectedTag.nextSibling); | ||
this.select(selectedTag.nextSibling.querySelector('.tag')); | ||
} | ||
@@ -197,2 +243,4 @@ else { | ||
newTagContent.className = 'tag'; | ||
newTagContent.classList.add('is-active'); | ||
this.select(newTagContent); | ||
newTagContent.innerHTML = tag; | ||
@@ -209,6 +257,6 @@ | ||
last = (Array.prototype.slice.call(this.container.querySelectorAll('.tag'))).pop(), | ||
atStart = this.caretAtStart(e); | ||
atStart = this.caretAtStart(this.input); | ||
if (activeTag) { | ||
selectedTag = this.container.querySelector('[data-tag="' + activeTag.innerText + '"]'); | ||
selectedTag = this.container.querySelector('[data-tag="' + activeTag.innerText.trim() + '"]'); | ||
} | ||
@@ -234,3 +282,3 @@ | ||
this.container.insertBefore( newTagWrapper, this.input); | ||
this.container.insertBefore(newTagWrapper, this.input); | ||
} | ||
@@ -308,7 +356,7 @@ } | ||
let tagInputs = document.querySelectorAll('input[type="tags"]'); | ||
if (tagInputs) { | ||
tagInputs.forEach(element => { | ||
new Tagify(element); | ||
}) | ||
} | ||
document.addEventListener( 'DOMContentLoaded', function () { | ||
let tagInputs = document.querySelectorAll('input[type="tags"]'); | ||
[].forEach.call(tagInputs, function(tagInput) { | ||
new Tagify(tagInput); | ||
}); | ||
}); |
var $jscomp={scope:{},owns:function(a,b){return Object.prototype.hasOwnProperty.call(a,b)}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this); | ||
$jscomp.polyfill=function(a,b,c,d){if(b){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];e in c||(c[e]={});c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})}};$jscomp.polyfill("Object.assign",function(a){return a?a:function(a,c){for(var b=1;b<arguments.length;b++){var e=arguments[b];if(e)for(var f in e)$jscomp.owns(e,f)&&(a[f]=e[f])}return a}},"es6-impl","es3"); | ||
var Tagify=function(a,b){b=void 0===b?{}:b;this.element=a;this.options=Object.assign({},{disabled:!1,delimiter:",",allowDelete:!0,lowercase:!1,uppercase:!1,duplicates:!0},b);this.init()}; | ||
Tagify.prototype.init=function(){if(!this.options.disabled){this.tags=[];this.container=document.createElement("div");this.container.className="tagsinput";this.container.classList.add("field");this.container.classList.add("is-grouped");this.container.classList.add("is-grouped-multiline");this.container.classList.add("input");var a=this.element.getAttribute("type");a&&"tags"!==a||(a="text");this.input=document.createElement("input");this.input.setAttribute("type",a);this.container.appendChild(this.input); | ||
a=this.element.nextSibling;this.element.parentNode[a?"insertBefore":"appendChild"](this.container,a);this.element.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;opacity:0.01;";this.element.tabIndex=-1;this.enable()}}; | ||
Tagify.prototype.enable=function(){var a=this;this.enabled||this.options.disabled||(this.element.addEventListener("focus",function(){a.container.classList.add("focus");a.select()}),this.input.addEventListener("focus",function(){a.container.classList.add("focus");a.select()}),this.input.addEventListener("blur",function(){a.container.classList.remove("focus");a.select();a.savePartial()}),this.input.addEventListener("keydown",function(b){var c=b.keyCode||b.which,d,e=a.container.querySelector(".is-active"), | ||
f=Array.prototype.slice.call(a.container.querySelectorAll(".tag")).pop(),g=a.caretAtStart(b);e&&(d=a.container.querySelector('[data-tag="'+e.innerHTML+'"]'));a.setInputWidth();if(13===c||c===a.options.delimiter.charCodeAt(0)||9===c){if(!a.input.value&&c!==a.options.delimiter.charCodeAt(0))return;a.savePartial()}else if(46===c&&d)d.nextSibling!==a.input&&a.select(d.nextSibling),a.container.removeChild(d),delete a.tags[a.tags.indexOf(d.getAttribute("data-tag"))],a.setInputWidth(),a.save();else if(8=== | ||
c)if(d)a.select(d.previousSibling),a.container.removeChild(d),delete a.tags[a.tags.indexOf(d.getAttribute("data-tag"))],a.setInputWidth(),a.save();else if(f&&g)a.select(f);else return;else if(37===c)if(d)d.previousSibling&&select(d.previousSibling);else if(g)a.select(f);else return;else if(39===c){if(!d)return;a.select(d.nextSibling)}else return a.select();b.preventDefault();return!1}),this.input.addEventListener("input",function(){a.element.value=a.getValue();a.element.dispatchEvent(new Event("input"))}), | ||
this.input.addEventListener("paste",function(){return setTimeout(savePartial,0)}),this.container.addEventListener("mousedown",function(b){a.refocus(b)}),this.container.addEventListener("touchstart",function(b){a.refocus(b)}),this.savePartial(this.element.value),this.enabled=!0)};Tagify.prototype.disable=function(){this.enabled&&!this.options.disabled&&(this.reset(),this.enabled=!1)}; | ||
"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(a,b){if(null==a)throw new TypeError("Cannot convert undefined or null to object");for(var c=Object(a),d=1;d<arguments.length;d++){var e=arguments[d];if(null!=e)for(var f in e)Object.prototype.hasOwnProperty.call(e,f)&&(c[f]=e[f])}return c},writable:!0,configurable:!0}); | ||
var KEY_BACKSPACE=8,KEY_TAB=9,KEY_ENTER=13,KEY_LEFT=37,KEY_RIGHT=39,KEY_DELETE=46,KEY_COMMA=188,Tagify=function(a,b){b=void 0===b?{}:b;this.element=a;this.options=Object.assign({},{disabled:!1,delimiter:",",allowDelete:!0,lowercase:!1,uppercase:!1,duplicates:!0},b);this.init()}; | ||
Tagify.prototype.init=function(){if(!this.options.disabled){this.tags=[];this.container=document.createElement("div");this.container.className="tagsinput";this.container.classList.add("field");this.container.classList.add("is-grouped");this.container.classList.add("is-grouped-multiline");this.container.classList.add("input");var a=this.element.getAttribute("type");a&&"tags"!==a||(a="text");this.input=document.createElement("input");this.input.setAttribute("type",a);this.input.setAttribute("placeholder", | ||
"Add a Tag");this.container.appendChild(this.input);a=this.element.nextSibling;this.element.parentNode[a?"insertBefore":"appendChild"](this.container,a);this.element.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;opacity:0.01;";this.element.tabIndex=-1;this.enable()}}; | ||
Tagify.prototype.enable=function(){var a=this;this.enabled||this.options.disabled||(this.element.addEventListener("focus",function(){a.container.classList.add("is-focused");a.select(Array.prototype.slice.call(a.container.querySelectorAll(".tag:not(.is-delete)")).pop())}),this.input.addEventListener("focus",function(){a.container.classList.add("is-focused");a.select(Array.prototype.slice.call(a.container.querySelectorAll(".tag:not(.is-delete)")).pop())}),this.input.addEventListener("blur",function(){a.container.classList.remove("is-focused"); | ||
a.select(Array.prototype.slice.call(a.container.querySelectorAll(".tag:not(.is-delete)")).pop());a.savePartial()}),this.input.addEventListener("keydown",function(b){var c=b.charCode||b.keyCode||b.which,d,e=a.container.querySelector(".tag.is-active"),f=Array.prototype.slice.call(a.container.querySelectorAll(".tag:not(.is-delete)")).pop(),g=a.caretAtStart(a.input);e&&(d=a.container.querySelector('[data-tag="'+e.innerHTML.trim()+'"]'));a.setInputWidth();if(c===KEY_ENTER||c===a.options.delimiter.charCodeAt(0)|| | ||
c===KEY_COMMA||c===KEY_TAB){if(!a.input.value&&(c!==a.options.delimiter.charCodeAt(0)||c===KEY_COMMA))return;a.savePartial()}else if(c===KEY_DELETE&&d)d.nextSibling?a.select(d.nextSibling.querySelector(".tag")):d.previousSibling&&a.select(d.previousSibling.querySelector(".tag")),a.container.removeChild(d),delete a.tags[a.tags.indexOf(d.getAttribute("data-tag"))],a.setInputWidth(),a.save();else if(c===KEY_BACKSPACE)if(d)d.previousSibling?a.select(d.previousSibling.querySelector(".tag")):d.nextSibling&& | ||
a.select(d.nextSibling.querySelector(".tag")),a.container.removeChild(d),delete a.tags[a.tags.indexOf(d.getAttribute("data-tag"))],a.setInputWidth(),a.save();else if(f&&g)a.select(f);else return;else if(c===KEY_LEFT)if(d)d.previousSibling&&a.select(d.previousSibling.querySelector(".tag"));else if(g)a.select(f);else return;else if(c===KEY_RIGHT){if(!d)return;a.select(d.nextSibling.querySelector(".tag"))}else return a.select();b.preventDefault();return!1}),this.input.addEventListener("input",function(){a.element.value= | ||
a.getValue();a.element.dispatchEvent(new Event("input"))}),this.input.addEventListener("paste",function(){return setTimeout(savePartial,0)}),this.container.addEventListener("mousedown",function(b){a.refocus(b)}),this.container.addEventListener("touchstart",function(b){a.refocus(b)}),this.savePartial(this.element.value),this.enabled=!0)};Tagify.prototype.disable=function(){this.enabled&&!this.options.disabled&&(this.reset(),this.enabled=!1)}; | ||
Tagify.prototype.select=function(a){var b=this.container.querySelector(".is-active");b&&b.classList.remove("is-active");a&&a.classList.add("is-active")}; | ||
Tagify.prototype.addTag=function(a){var b=this;~a.indexOf(this.options.delimiter)&&(a=a.split(this.options.delimiter));if(Array.isArray(a))return a.forEach(function(a){b.addTag(a)});var c=a&&a.trim();if(!c)return!1;if(this.element.getAttribute("lowercase")||"true"==this.options.lowercase)c=c.toLowerCase();if(this.element.getAttribute("uppercase")||"true"==this.options.uppercase)c=c.toUpperCase();if("true"==this.element.getAttribute("duplicates")||this.options.duplicates||-1===this.tags.indexOf(c)){this.tags.push(c); | ||
a=document.createElement("div");a.className="control";a.setAttribute("data-tag",c);var d=document.createElement("div");d.className="tags";d.classList.add("has-addons");var e=document.createElement("span");e.className="tag";e.innerHTML=c;d.appendChild(e);this.options.allowDelete&&(c=document.createElement("a"),c.className="tag",c.classList.add("is-delete"),c.addEventListener("click",function(a){var c,d=a.target.parentNode,e=Array.prototype.slice.call(b.container.querySelectorAll(".tag")).pop();a=b.caretAtStart(a); | ||
d&&(c=b.container.querySelector('[data-tag="'+d.innerText+'"]'));c?(b.select(c.previousSibling),b.container.removeChild(c),delete b.tags[b.tags.indexOf(c.getAttribute("data-tag"))],b.setInputWidth(),b.save()):e&&a&&b.select(e)}),d.appendChild(c));a.appendChild(d);this.container.insertBefore(a,this.input)}};Tagify.prototype.getValue=function(){return this.tags.join(this.options.delimiter)}; | ||
a=document.createElement("div");a.className="control";a.setAttribute("data-tag",c);var d=document.createElement("div");d.className="tags";d.classList.add("has-addons");var e=document.createElement("span");e.className="tag";e.classList.add("is-active");this.select(e);e.innerHTML=c;d.appendChild(e);this.options.allowDelete&&(c=document.createElement("a"),c.className="tag",c.classList.add("is-delete"),c.addEventListener("click",function(a){var c;a=a.target.parentNode;var d=Array.prototype.slice.call(b.container.querySelectorAll(".tag")).pop(), | ||
e=b.caretAtStart(b.input);a&&(c=b.container.querySelector('[data-tag="'+a.innerText.trim()+'"]'));c?(b.select(c.previousSibling),b.container.removeChild(c),delete b.tags[b.tags.indexOf(c.getAttribute("data-tag"))],b.setInputWidth(),b.save()):d&&e&&b.select(d)}),d.appendChild(c));a.appendChild(d);this.container.insertBefore(a,this.input)}};Tagify.prototype.getValue=function(){return this.tags.join(this.options.delimiter)}; | ||
Tagify.prototype.setValue=function(a){var b=this;Array.prototype.slice.call(this.container.querySelectorAll(".tag")).forEach(function(a){delete b.tags[b.tags.indexOf(a.innerHTML)];b.container.removeChild(a)});this.savePartial(a)}; | ||
Tagify.prototype.setInputWidth=function(){var a=Array.prototype.slice.call(this.container.querySelectorAll(".control")).pop();this.container.offsetWidth&&(this.input.style.width=Math.max(this.container.offsetWidth-(a?a.offsetLeft+a.offsetWidth:30)-30,this.container.offsetWidth/4)+"px")};Tagify.prototype.savePartial=function(a){"string"===typeof a||Array.isArray(a)||(a=this.input.value);!1!==this.addTag(a)&&(this.input.value="",this.save(),this.setInputWidth())}; | ||
Tagify.prototype.save=function(){this.element.value=this.tags.join(this.options.delimiter);this.element.dispatchEvent(new Event("change"))};Tagify.prototype.caretAtStart=function(a){try{return 0===a.selectionStart&&0===a.selectionEnd}catch(b){return""===a.value}};Tagify.prototype.refocus=function(a){a.target.classList.contains("tag")&&this.select(a.target);if(a.target===this.input)return this.select();this.input.focus();a.preventDefault();return!1};Tagify.prototype.reset=function(){this.tags=[]}; | ||
Tagify.prototype.destroy=function(){this.disable();this.reset();this.element=null};var tagInputs=document.querySelectorAll('input[type="tags"]');tagInputs&&tagInputs.forEach(function(a){new Tagify(a)}); | ||
Tagify.prototype.destroy=function(){this.disable();this.reset();this.element=null};document.addEventListener("DOMContentLoaded",function(){var a=document.querySelectorAll('input[type="tags"]');[].forEach.call(a,function(a){new Tagify(a)})}); |
# bulma-timeline | ||
Bulma's extension to display a timeline | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-timeline.svg)](https://www.npmjs.com/package/bulma-timeline) |
# bulma-tooltip | ||
Bulma's extension to display tooltip on desktop layout | ||
(find all my bulma's extensions [here](https://wikiki.github.io/bulma-extensions/overview)) | ||
(find all my bulma's extensions [here](https://wikiki.github.io/)) | ||
@@ -5,0 +5,0 @@ [![npm](https://img.shields.io/npm/v/bulma-tooltip.svg)](https://www.npmjs.com/package/bulma-tooltip) |
{ | ||
"name": "bulma-extensions", | ||
"version": "0.5.2", | ||
"version": "0.5.4", | ||
"description": "Set of extensions for Bulma.io CSS Framework", | ||
@@ -5,0 +5,0 @@ "main": "extensions.sass", |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
501359
120
8139