diff --git a/.babelrc.js b/.babelrc.js index cb09b45..5a0b999 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -3,13 +3,17 @@ module.exports = { [ '@babel/env', { - loose : true, - modules: false, + loose: true, exclude: ['transform-typeof-symbol'] } ] ], plugins: [ - '@babel/proposal-object-rest-spread' + [ + '@babel/proposal-object-rest-spread', + { + loose: true + } + ] ] }; diff --git a/dist/bootstrap-confirmation.js b/dist/bootstrap-confirmation.js index 030ee07..d5553e4 100644 --- a/dist/bootstrap-confirmation.js +++ b/dist/bootstrap-confirmation.js @@ -1,16 +1,14 @@ /*! - * Bootstrap Confirmation (v4.1.0) + * Bootstrap Confirmation (v4.2.0) * @copyright 2013 Nimit Suwannagate - * @copyright 2014-2018 Damien "Mistic" Sorel + * @copyright 2014-2020 Damien "Mistic" Sorel * @licence Apache License, Version 2.0 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('jquery'), require('bootstrap')) : typeof define === 'function' && define.amd ? define(['jquery', 'bootstrap'], factory) : - (global = global || self, factory(global.jQuery)); -}(this, function ($) { 'use strict'; - - $ = $ && $.hasOwnProperty('default') ? $['default'] : $; + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.jQuery)); +}(this, (function ($) { 'use strict'; function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { @@ -28,38 +26,22 @@ return Constructor; } - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } + function _extends() { + _extends = Object.assign || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; - return obj; - } - - function _objectSpread(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - var ownKeys = Object.keys(source); - - if (typeof Object.getOwnPropertySymbols === 'function') { - ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { - return Object.getOwnPropertyDescriptor(source, sym).enumerable; - })); + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } } - ownKeys.forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } + return target; + }; - return target; + return _extends.apply(this, arguments); } function _inheritsLoose(subClass, superClass) { @@ -81,14 +63,14 @@ */ var NAME = 'confirmation'; - var VERSION = '4.1.0'; + var VERSION = '4.2.0'; var DATA_KEY = "bs." + NAME; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; var BTN_CLASS_BASE = 'h-100 d-flex align-items-center'; var BTN_CLASS_DEFAULT = 'btn btn-sm'; - var DefaultType = _objectSpread({}, Popover.DefaultType, { + var DefaultType = _extends({}, Popover.DefaultType, { singleton: 'boolean', popout: 'boolean', copyAttributes: '(string|array)', @@ -105,7 +87,7 @@ buttons: 'array' }); - var Default = _objectSpread({}, Popover.Default, { + var Default = _extends({}, Popover.Default, { _attributes: {}, _selector: null, placement: 'top', @@ -175,9 +157,7 @@ var activeConfirmation; - var Confirmation = - /*#__PURE__*/ - function (_Popover) { + var Confirmation = /*#__PURE__*/function (_Popover) { _inheritsLoose(Confirmation, _Popover); _createClass(Confirmation, null, [{ @@ -398,13 +378,13 @@ _proto._setStandardButtons = function _setStandardButtons($tip) { var buttons = [{ - class: this.config.btnOkClass, + "class": this.config.btnOkClass, label: this.config.btnOkLabel, iconClass: this.config.btnOkIconClass, iconContent: this.config.btnOkIconContent, attr: this.config._attributes }, { - class: this.config.btnCancelClass, + "class": this.config.btnCancelClass, label: this.config.btnCancelLabel, iconClass: this.config.btnCancelIconClass, iconContent: this.config.btnCancelIconContent, @@ -425,7 +405,7 @@ var self = this; var $group = $tip.find(Selector.BUTTONS).empty(); buttons.forEach(function (button) { - var btn = $('').addClass(BTN_CLASS_BASE).addClass(button.class || BTN_CLASS_DEFAULT + " btn-secondary").html(button.label || '').attr(button.attr || {}); + var btn = $('').addClass(BTN_CLASS_BASE).addClass(button["class"] || BTN_CLASS_DEFAULT + " btn-secondary").html(button.label || '').attr(button.attr || (button.cancel ? {} : self.config._attributes)); if (button.iconClass || button.iconContent) { btn.prepend($('').addClass(button.iconClass || '').text(button.iconContent || '')); @@ -522,9 +502,6 @@ $active.removeClass('active'); $next.addClass('active').focus(); break; - - default: - break; } } // Static @@ -590,5 +567,5 @@ return Confirmation._jQueryInterface; }; -})); +}))); //# sourceMappingURL=bootstrap-confirmation.js.map diff --git a/dist/bootstrap-confirmation.js.map b/dist/bootstrap-confirmation.js.map index f96eca5..2224e95 100644 --- a/dist/bootstrap-confirmation.js.map +++ b/dist/bootstrap-confirmation.js.map @@ -1 +1 @@ -{"version":3,"file":"bootstrap-confirmation.js","sources":["../src/popover.js","../src/confirmation.js"],"sourcesContent":["import $ from 'jquery';\nimport 'bootstrap';\n\nif (typeof $.fn.popover === 'undefined' || $.fn.popover.Constructor.VERSION.split('.').shift() !== '4') {\n throw new Error('Bootstrap Confirmation 4 requires Bootstrap Popover 4');\n}\n\nconst Popover = $.fn.popover.Constructor;\n\nexport default Popover;\n","import $ from 'jquery';\nimport Popover from 'bootstrap/js/src/popover';\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'confirmation';\nconst VERSION = '$VERSION';\nconst DATA_KEY = `bs.${NAME}`;\nconst EVENT_KEY = `.${DATA_KEY}`;\nconst JQUERY_NO_CONFLICT = $.fn[NAME];\nconst BTN_CLASS_BASE = 'h-100 d-flex align-items-center';\nconst BTN_CLASS_DEFAULT = 'btn btn-sm';\n\nconst DefaultType = {\n ...Popover.DefaultType,\n singleton : 'boolean',\n popout : 'boolean',\n copyAttributes : '(string|array)',\n onConfirm : 'function',\n onCancel : 'function',\n btnOkClass : 'string',\n btnOkLabel : 'string',\n btnOkIconClass : 'string',\n btnOkIconContent : 'string',\n btnCancelClass : 'string',\n btnCancelLabel : 'string',\n btnCancelIconClass : 'string',\n btnCancelIconContent: 'string',\n buttons : 'array',\n};\n\nconst Default = {\n ...Popover.Default,\n _attributes : {},\n _selector : null,\n placement : 'top',\n title : 'Are you sure?',\n trigger : 'click',\n confirmationEvent : undefined,\n content : '',\n singleton : false,\n popout : false,\n copyAttributes : 'href target',\n onConfirm : $.noop,\n onCancel : $.noop,\n btnOkClass : `${BTN_CLASS_DEFAULT} btn-primary`,\n btnOkLabel : 'Yes',\n btnOkIconClass : '',\n btnOkIconContent : '',\n btnCancelClass : `${BTN_CLASS_DEFAULT} btn-secondary`,\n btnCancelLabel : 'No',\n btnCancelIconClass : '',\n btnCancelIconContent: '',\n buttons : [],\n // @formatter:off\n template : `\n
\n
\n

\n
\n

\n
\n
\n
\n
\n
`,\n // @formatter:on\n};\n\nif (Default.whiteList) {\n Default.whiteList['*'].push('data-apply', 'data-dismiss');\n}\n\nconst ClassName = {\n FADE: 'fade',\n SHOW: 'show',\n};\n\nconst Selector = {\n TITLE : '.popover-header',\n CONTENT: '.confirmation-content',\n BUTTONS: '.confirmation-buttons .btn-group',\n};\n\nconst Keymap = {\n 13: 'Enter',\n 27: 'Escape',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n};\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER: `mouseenter${EVENT_KEY}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY}`,\n CONFIRMED : `confirmed${EVENT_KEY}`,\n CANCELED : `canceled${EVENT_KEY}`,\n KEYUP : `keyup${EVENT_KEY}`,\n};\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n// keep track of the last openned confirmation for keyboard navigation\nlet activeConfirmation;\n\nclass Confirmation extends Popover {\n // Getters\n\n static get VERSION() {\n return VERSION;\n }\n\n static get Default() {\n return Default;\n }\n\n static get NAME() {\n return NAME;\n }\n\n static get DATA_KEY() {\n return DATA_KEY;\n }\n\n static get Event() {\n return Event;\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY;\n }\n\n static get DefaultType() {\n return DefaultType;\n }\n\n // Constructor\n\n constructor(element, config) {\n super(element, config);\n\n if ((this.config.popout || this.config.singleton) && !this.config.rootSelector) {\n throw new Error('The rootSelector option is required to use popout and singleton features since jQuery 3.');\n }\n\n // keep trace of selectors\n this._isDelegate = false;\n\n if (config.selector) { // container of buttons\n config._selector = `${config.rootSelector} ${config.selector}`;\n this.config._selector = config._selector;\n }\n else if (config._selector) { // children of container\n this.config._selector = config._selector;\n this._isDelegate = true;\n }\n else { // standalone\n this.config._selector = config.rootSelector;\n }\n\n if (this.config.confirmationEvent === undefined) {\n this.config.confirmationEvent = this.config.trigger;\n }\n\n if (!this.config.selector) {\n this._copyAttributes();\n }\n\n this._setConfirmationListeners();\n }\n\n // Overrides\n\n isWithContent() {\n return true;\n }\n\n setContent() {\n const $tip = $(this.getTipElement());\n let content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle());\n\n $tip.find(Selector.CONTENT).toggle(!!content);\n if (content) {\n this.setElementContent($tip.find(Selector.CONTENT), content);\n }\n\n if (this.config.buttons.length > 0) {\n this._setButtons($tip, this.config.buttons);\n }\n else {\n this._setStandardButtons($tip);\n }\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`);\n\n this._setupKeyupEvent();\n }\n\n dispose() {\n $('body').off(`${Event.CLICK}.${this.uid}`);\n this.eventBody = false;\n this._cleanKeyupEvent();\n super.dispose();\n }\n\n hide(callback) {\n this._cleanKeyupEvent();\n super.hide(callback);\n }\n\n // Private\n\n /**\n * Copy the value of `copyAttributes` on the config object\n * @private\n */\n _copyAttributes() {\n this.config._attributes = {};\n if (this.config.copyAttributes) {\n if (typeof this.config.copyAttributes === 'string') {\n this.config.copyAttributes = this.config.copyAttributes.split(' ');\n }\n }\n else {\n this.config.copyAttributes = [];\n }\n\n this.config.copyAttributes.forEach((attr) => {\n this.config._attributes[attr] = $(this.element).attr(attr);\n });\n }\n\n /**\n * Custom event listeners for popouts and singletons\n * @private\n */\n _setConfirmationListeners() {\n const self = this;\n\n if (!this.config.selector) {\n // cancel original event\n $(this.element).on(this.config.trigger, (e, ack) => {\n if (!ack) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n });\n\n // manage singleton\n $(this.element).on(Event.SHOWN, function () {\n if (self.config.singleton) {\n // close all other popover already initialized\n $(self.config._selector).not($(this)).filter(function () {\n return $(this).data(DATA_KEY) !== undefined;\n }).confirmation('hide');\n }\n });\n }\n else {\n // cancel original event\n $(this.element).on(this.config.trigger, this.config.selector, (e, ack) => {\n if (!ack) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n });\n }\n\n if (!this._isDelegate) {\n // manage popout\n this.eventBody = false;\n this.uid = this.element.id || Confirmation.getUID(`${NAME}_group`);\n\n $(this.element).on(Event.SHOWN, () => {\n if (self.config.popout && !self.eventBody) {\n self.eventBody = $('body').on(`${Event.CLICK}.${self.uid}`, (e) => {\n if ($(self.config._selector).is(e.target) || $(self.config._selector).has(e.target).length > 0) {\n return;\n }\n // close all popover already initialized\n $(self.config._selector).filter(function () {\n return $(this).data(DATA_KEY) !== undefined;\n }).confirmation('hide');\n\n $('body').off(`${Event.CLICK}.${self.uid}`);\n self.eventBody = false;\n });\n }\n });\n }\n }\n\n /**\n * Init the standard ok/cancel buttons\n * @param $tip\n * @private\n */\n _setStandardButtons($tip) {\n const buttons = [\n {\n class : this.config.btnOkClass,\n label : this.config.btnOkLabel,\n iconClass : this.config.btnOkIconClass,\n iconContent: this.config.btnOkIconContent,\n attr : this.config._attributes,\n },\n {\n class : this.config.btnCancelClass,\n label : this.config.btnCancelLabel,\n iconClass : this.config.btnCancelIconClass,\n iconContent: this.config.btnCancelIconContent,\n cancel : true,\n },\n ];\n\n this._setButtons($tip, buttons);\n }\n\n /**\n * Init the buttons\n * @param $tip\n * @param buttons\n * @private\n */\n _setButtons($tip, buttons) {\n const self = this;\n const $group = $tip.find(Selector.BUTTONS).empty();\n\n buttons.forEach((button) => {\n const btn = $('')\n .addClass(BTN_CLASS_BASE)\n .addClass(button.class || `${BTN_CLASS_DEFAULT} btn-secondary`)\n .html(button.label || '')\n .attr(button.attr || {});\n\n if (button.iconClass || button.iconContent) {\n btn.prepend($('')\n .addClass(button.iconClass || '')\n .text(button.iconContent || ''));\n }\n\n btn.one('click', function (e) {\n if ($(this).attr('href') === '#') {\n e.preventDefault();\n }\n\n if (button.onClick) {\n button.onClick.call($(self.element));\n }\n\n if (button.cancel) {\n self.config.onCancel.call(self.element, button.value);\n $(self.element).trigger(Event.CANCELED, [button.value]);\n }\n else {\n self.config.onConfirm.call(self.element, button.value);\n $(self.element).trigger(Event.CONFIRMED, [button.value]);\n $(self.element).trigger(self.config.confirmationEvent, [true]);\n }\n\n self.hide();\n });\n\n $group.append(btn);\n });\n }\n\n /**\n * Install the keyboatd event handler\n * @private\n */\n _setupKeyupEvent() {\n activeConfirmation = this;\n $(window)\n .off(Event.KEYUP)\n .on(Event.KEYUP, this._onKeyup.bind(this));\n }\n\n /**\n * Remove the keyboard event handler\n * @private\n */\n _cleanKeyupEvent() {\n if (activeConfirmation === this) {\n activeConfirmation = undefined;\n $(window).off(Event.KEYUP);\n }\n }\n\n /**\n * Event handler for keyboard navigation\n * @param event\n * @private\n */\n _onKeyup(event) {\n if (!this.tip) {\n this._cleanKeyupEvent();\n return;\n }\n\n const $tip = $(this.getTipElement());\n const key = event.key || Keymap[event.keyCode || event.which];\n\n const $group = $tip.find(Selector.BUTTONS);\n const $active = $group.find('.active');\n let $next;\n\n switch (key) {\n case 'Escape':\n this.hide();\n break;\n\n case 'ArrowRight':\n if ($active.length && $active.next().length) {\n $next = $active.next();\n }\n else {\n $next = $group.children().first();\n }\n $active.removeClass('active');\n $next.addClass('active').focus();\n break;\n\n case 'ArrowLeft':\n if ($active.length && $active.prev().length) {\n $next = $active.prev();\n }\n else {\n $next = $group.children().last();\n }\n $active.removeClass('active');\n $next.addClass('active').focus();\n break;\n\n default:\n break;\n }\n }\n\n // Static\n\n /**\n * Generates an uui, copied from Bootrap's utils\n * @param {string} prefix\n * @returns {string}\n */\n static getUID(prefix) {\n let uid = prefix;\n do {\n // eslint-disable-next-line no-bitwise\n uid += ~~(Math.random() * 1000000); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(uid));\n return uid;\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY);\n\n const _config = typeof config === 'object' ? config : {};\n _config.rootSelector = $(this).selector || _config.rootSelector; // this.selector removed in jQuery > 3\n\n if (!data && /destroy|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Confirmation(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Confirmation._jQueryInterface;\n$.fn[NAME].Constructor = Confirmation;\n$.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Confirmation._jQueryInterface;\n};\n\nexport default Confirmation;\n"],"names":["$","fn","popover","Constructor","VERSION","split","shift","Error","Popover","NAME","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","BTN_CLASS_BASE","BTN_CLASS_DEFAULT","DefaultType","singleton","popout","copyAttributes","onConfirm","onCancel","btnOkClass","btnOkLabel","btnOkIconClass","btnOkIconContent","btnCancelClass","btnCancelLabel","btnCancelIconClass","btnCancelIconContent","buttons","Default","_attributes","_selector","placement","title","trigger","confirmationEvent","undefined","content","noop","template","whiteList","push","ClassName","FADE","SHOW","Selector","TITLE","CONTENT","BUTTONS","Keymap","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","CONFIRMED","CANCELED","KEYUP","activeConfirmation","Confirmation","element","config","rootSelector","_isDelegate","selector","_copyAttributes","_setConfirmationListeners","isWithContent","setContent","$tip","getTipElement","_getContent","call","setElementContent","find","getTitle","toggle","length","_setButtons","_setStandardButtons","removeClass","_setupKeyupEvent","dispose","off","uid","eventBody","_cleanKeyupEvent","hide","callback","forEach","attr","self","on","e","ack","preventDefault","stopPropagation","stopImmediatePropagation","not","filter","data","confirmation","id","getUID","is","target","has","class","label","iconClass","iconContent","cancel","$group","empty","button","btn","addClass","html","prepend","text","one","onClick","value","append","window","_onKeyup","bind","event","tip","key","keyCode","which","$active","$next","next","children","first","focus","prev","last","prefix","Math","random","document","getElementById","_jQueryInterface","each","_config","test","TypeError","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,IAAI,OAAOA,CAAC,CAACC,EAAF,CAAKC,OAAZ,KAAwB,WAAxB,IAAuCF,CAAC,CAACC,EAAF,CAAKC,OAAL,CAAaC,WAAb,CAAyBC,OAAzB,CAAiCC,KAAjC,CAAuC,GAAvC,EAA4CC,KAA5C,OAAwD,GAAnG,EAAwG;EACtG,QAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;EACD;;EAED,IAAMC,OAAO,GAAGR,CAAC,CAACC,EAAF,CAAKC,OAAL,CAAaC,WAA7B;;ECJA;;;;;;EAMA,IAAMM,IAAI,GAAG,cAAb;EACA,IAAML,OAAO,GAAG,OAAhB;EACA,IAAMM,QAAQ,WAASD,IAAvB;EACA,IAAME,SAAS,SAAOD,QAAtB;EACA,IAAME,kBAAkB,GAAGZ,CAAC,CAACC,EAAF,CAAKQ,IAAL,CA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AAOvC,MAAP,KAAkB,QAAtB,EAAgC;EAC9B,YAAI,OAAOuC,IAAI,CAACvC,MAAD,CAAX,KAAwB,WAA5B,EAAyC;EACvC,gBAAM,IAAIwF,SAAJ,wBAAkCxF,MAAlC,QAAN;EACD;;EACDuC,QAAAA,IAAI,CAACvC,MAAD,CAAJ;EACD;EACF,KArBM,CAAP;EAsBD;;;IA7XwB3D;EAgY3B;;;;;;;EAMAR,CAAC,CAACC,EAAF,CAAKQ,IAAL,IAAawD,YAAY,CAACsF,gBAA1B;EACAvJ,CAAC,CAACC,EAAF,CAAKQ,IAAL,EAAWN,WAAX,GAAyB8D,YAAzB;;EACAjE,CAAC,CAACC,EAAF,CAAKQ,IAAL,EAAWmJ,UAAX,GAAwB,YAAY;EAClC5J,EAAAA,CAAC,CAACC,EAAF,CAAKQ,IAAL,IAAaG,kBAAb;EACA,SAAOqD,YAAY,CAACsF,gBAApB;EACD,CAHD;;;;"} \ No newline at end of file +{"version":3,"file":"bootstrap-confirmation.js","sources":["../src/popover.js","../src/confirmation.js"],"sourcesContent":["import $ from 'jquery';\nimport 'bootstrap';\n\nif (typeof $.fn.popover === 'undefined' || $.fn.popover.Constructor.VERSION.split('.').shift() !== '4') {\n throw new Error('Bootstrap Confirmation 4 requires Bootstrap Popover 4');\n}\n\nconst Popover = $.fn.popover.Constructor;\n\nexport default Popover;\n","import $ from 'jquery';\nimport Popover from 'bootstrap/js/src/popover';\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'confirmation';\nconst VERSION = '$VERSION';\nconst DATA_KEY = `bs.${NAME}`;\nconst EVENT_KEY = `.${DATA_KEY}`;\nconst JQUERY_NO_CONFLICT = $.fn[NAME];\nconst BTN_CLASS_BASE = 'h-100 d-flex align-items-center';\nconst BTN_CLASS_DEFAULT = 'btn btn-sm';\n\nconst DefaultType = {\n ...Popover.DefaultType,\n singleton : 'boolean',\n popout : 'boolean',\n copyAttributes : '(string|array)',\n onConfirm : 'function',\n onCancel : 'function',\n btnOkClass : 'string',\n btnOkLabel : 'string',\n btnOkIconClass : 'string',\n btnOkIconContent : 'string',\n btnCancelClass : 'string',\n btnCancelLabel : 'string',\n btnCancelIconClass : 'string',\n btnCancelIconContent: 'string',\n buttons : 'array',\n};\n\nconst Default = {\n ...Popover.Default,\n _attributes : {},\n _selector : null,\n placement : 'top',\n title : 'Are you sure?',\n trigger : 'click',\n confirmationEvent : undefined,\n content : '',\n singleton : false,\n popout : false,\n copyAttributes : 'href target',\n onConfirm : $.noop,\n onCancel : $.noop,\n btnOkClass : `${BTN_CLASS_DEFAULT} btn-primary`,\n btnOkLabel : 'Yes',\n btnOkIconClass : '',\n btnOkIconContent : '',\n btnCancelClass : `${BTN_CLASS_DEFAULT} btn-secondary`,\n btnCancelLabel : 'No',\n btnCancelIconClass : '',\n btnCancelIconContent: '',\n buttons : [],\n // @formatter:off\n template : `\n
\n
\n

\n
\n

\n
\n
\n
\n
\n
`,\n // @formatter:on\n};\n\nif (Default.whiteList) {\n Default.whiteList['*'].push('data-apply', 'data-dismiss');\n}\n\nconst ClassName = {\n FADE: 'fade',\n SHOW: 'show',\n};\n\nconst Selector = {\n TITLE : '.popover-header',\n CONTENT: '.confirmation-content',\n BUTTONS: '.confirmation-buttons .btn-group',\n};\n\nconst Keymap = {\n 13: 'Enter',\n 27: 'Escape',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n};\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER: `mouseenter${EVENT_KEY}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY}`,\n CONFIRMED : `confirmed${EVENT_KEY}`,\n CANCELED : `canceled${EVENT_KEY}`,\n KEYUP : `keyup${EVENT_KEY}`,\n};\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n// keep track of the last openned confirmation for keyboard navigation\nlet activeConfirmation;\n\nclass Confirmation extends Popover {\n // Getters\n\n static get VERSION() {\n return VERSION;\n }\n\n static get Default() {\n return Default;\n }\n\n static get NAME() {\n return NAME;\n }\n\n static get DATA_KEY() {\n return DATA_KEY;\n }\n\n static get Event() {\n return Event;\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY;\n }\n\n static get DefaultType() {\n return DefaultType;\n }\n\n // Constructor\n\n constructor(element, config) {\n super(element, config);\n\n if ((this.config.popout || this.config.singleton) && !this.config.rootSelector) {\n throw new Error('The rootSelector option is required to use popout and singleton features since jQuery 3.');\n }\n\n // keep trace of selectors\n this._isDelegate = false;\n\n if (config.selector) { // container of buttons\n config._selector = `${config.rootSelector} ${config.selector}`;\n this.config._selector = config._selector;\n }\n else if (config._selector) { // children of container\n this.config._selector = config._selector;\n this._isDelegate = true;\n }\n else { // standalone\n this.config._selector = config.rootSelector;\n }\n\n if (this.config.confirmationEvent === undefined) {\n this.config.confirmationEvent = this.config.trigger;\n }\n\n if (!this.config.selector) {\n this._copyAttributes();\n }\n\n this._setConfirmationListeners();\n }\n\n // Overrides\n\n isWithContent() {\n return true;\n }\n\n setContent() {\n const $tip = $(this.getTipElement());\n let content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle());\n\n $tip.find(Selector.CONTENT).toggle(!!content);\n if (content) {\n this.setElementContent($tip.find(Selector.CONTENT), content);\n }\n\n if (this.config.buttons.length > 0) {\n this._setButtons($tip, this.config.buttons);\n }\n else {\n this._setStandardButtons($tip);\n }\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`);\n\n this._setupKeyupEvent();\n }\n\n dispose() {\n $('body').off(`${Event.CLICK}.${this.uid}`);\n this.eventBody = false;\n this._cleanKeyupEvent();\n super.dispose();\n }\n\n hide(callback) {\n this._cleanKeyupEvent();\n super.hide(callback);\n }\n\n // Private\n\n /**\n * Copy the value of `copyAttributes` on the config object\n * @private\n */\n _copyAttributes() {\n this.config._attributes = {};\n if (this.config.copyAttributes) {\n if (typeof this.config.copyAttributes === 'string') {\n this.config.copyAttributes = this.config.copyAttributes.split(' ');\n }\n }\n else {\n this.config.copyAttributes = [];\n }\n\n this.config.copyAttributes.forEach((attr) => {\n this.config._attributes[attr] = $(this.element).attr(attr);\n });\n }\n\n /**\n * Custom event listeners for popouts and singletons\n * @private\n */\n _setConfirmationListeners() {\n const self = this;\n\n if (!this.config.selector) {\n // cancel original event\n $(this.element).on(this.config.trigger, (e, ack) => {\n if (!ack) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n });\n\n // manage singleton\n $(this.element).on(Event.SHOWN, function () {\n if (self.config.singleton) {\n // close all other popover already initialized\n $(self.config._selector).not($(this)).filter(function () {\n return $(this).data(DATA_KEY) !== undefined;\n }).confirmation('hide');\n }\n });\n }\n else {\n // cancel original event\n $(this.element).on(this.config.trigger, this.config.selector, (e, ack) => {\n if (!ack) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n });\n }\n\n if (!this._isDelegate) {\n // manage popout\n this.eventBody = false;\n this.uid = this.element.id || Confirmation.getUID(`${NAME}_group`);\n\n $(this.element).on(Event.SHOWN, () => {\n if (self.config.popout && !self.eventBody) {\n self.eventBody = $('body').on(`${Event.CLICK}.${self.uid}`, (e) => {\n if ($(self.config._selector).is(e.target) || $(self.config._selector).has(e.target).length > 0) {\n return;\n }\n // close all popover already initialized\n $(self.config._selector).filter(function () {\n return $(this).data(DATA_KEY) !== undefined;\n }).confirmation('hide');\n\n $('body').off(`${Event.CLICK}.${self.uid}`);\n self.eventBody = false;\n });\n }\n });\n }\n }\n\n /**\n * Init the standard ok/cancel buttons\n * @param $tip\n * @private\n */\n _setStandardButtons($tip) {\n const buttons = [\n {\n class : this.config.btnOkClass,\n label : this.config.btnOkLabel,\n iconClass : this.config.btnOkIconClass,\n iconContent: this.config.btnOkIconContent,\n attr : this.config._attributes,\n },\n {\n class : this.config.btnCancelClass,\n label : this.config.btnCancelLabel,\n iconClass : this.config.btnCancelIconClass,\n iconContent: this.config.btnCancelIconContent,\n cancel : true,\n },\n ];\n\n this._setButtons($tip, buttons);\n }\n\n /**\n * Init the buttons\n * @param $tip\n * @param buttons\n * @private\n */\n _setButtons($tip, buttons) {\n const self = this;\n const $group = $tip.find(Selector.BUTTONS).empty();\n\n buttons.forEach((button) => {\n const btn = $('')\n .addClass(BTN_CLASS_BASE)\n .addClass(button.class || `${BTN_CLASS_DEFAULT} btn-secondary`)\n .html(button.label || '')\n .attr(button.attr || (button.cancel ? {} : self.config._attributes));\n\n if (button.iconClass || button.iconContent) {\n btn.prepend($('')\n .addClass(button.iconClass || '')\n .text(button.iconContent || ''));\n }\n\n btn.one('click', function (e) {\n if ($(this).attr('href') === '#') {\n e.preventDefault();\n }\n\n if (button.onClick) {\n button.onClick.call($(self.element));\n }\n\n if (button.cancel) {\n self.config.onCancel.call(self.element, button.value);\n $(self.element).trigger(Event.CANCELED, [button.value]);\n }\n else {\n self.config.onConfirm.call(self.element, button.value);\n $(self.element).trigger(Event.CONFIRMED, [button.value]);\n $(self.element).trigger(self.config.confirmationEvent, [true]);\n }\n\n self.hide();\n });\n\n $group.append(btn);\n });\n }\n\n /**\n * Install the keyboatd event handler\n * @private\n */\n _setupKeyupEvent() {\n activeConfirmation = this;\n $(window)\n .off(Event.KEYUP)\n .on(Event.KEYUP, this._onKeyup.bind(this));\n }\n\n /**\n * Remove the keyboard event handler\n * @private\n */\n _cleanKeyupEvent() {\n if (activeConfirmation === this) {\n activeConfirmation = undefined;\n $(window).off(Event.KEYUP);\n }\n }\n\n /**\n * Event handler for keyboard navigation\n * @param event\n * @private\n */\n _onKeyup(event) {\n if (!this.tip) {\n this._cleanKeyupEvent();\n return;\n }\n\n const $tip = $(this.getTipElement());\n const key = event.key || Keymap[event.keyCode || event.which];\n\n const $group = $tip.find(Selector.BUTTONS);\n const $active = $group.find('.active');\n let $next;\n\n switch (key) {\n case 'Escape':\n this.hide();\n break;\n\n case 'ArrowRight':\n if ($active.length && $active.next().length) {\n $next = $active.next();\n }\n else {\n $next = $group.children().first();\n }\n $active.removeClass('active');\n $next.addClass('active').focus();\n break;\n\n case 'ArrowLeft':\n if ($active.length && $active.prev().length) {\n $next = $active.prev();\n }\n else {\n $next = $group.children().last();\n }\n $active.removeClass('active');\n $next.addClass('active').focus();\n break;\n\n default:\n break;\n }\n }\n\n // Static\n\n /**\n * Generates an uui, copied from Bootrap's utils\n * @param {string} prefix\n * @returns {string}\n */\n static getUID(prefix) {\n let uid = prefix;\n do {\n // eslint-disable-next-line no-bitwise\n uid += ~~(Math.random() * 1000000); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(uid));\n return uid;\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY);\n\n const _config = typeof config === 'object' ? config : {};\n _config.rootSelector = $(this).selector || _config.rootSelector; // this.selector removed in jQuery > 3\n\n if (!data && /destroy|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Confirmation(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Confirmation._jQueryInterface;\n$.fn[NAME].Constructor = Confirmation;\n$.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Confirmation._jQueryInterface;\n};\n\nexport default Confirmation;\n"],"names":["$","fn","popover","Constructor","VERSION","split","shift","Error","Popover","NAME","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","BTN_CLASS_BASE","BTN_CLASS_DEFAULT","DefaultType","singleton","popout","copyAttributes","onConfirm","onCancel","btnOkClass","btnOkLabel","btnOkIconClass","btnOkIconContent","btnCancelClass","btnCancelLabel","btnCancelIconClass","btnCancelIconContent","buttons","Default","_attributes","_selector","placement","title","trigger","confirmationEvent","undefined","content","noop","template","whiteList","push","ClassName","FADE","SHOW","Selector","TITLE","CONTENT","BUTTONS","Keymap","Event","HIDE","HIDDEN","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","CONFIRMED","CANCELED","KEYUP","activeConfirmation","Confirmation","element","config","rootSelector","_isDelegate","selector","_copyAttributes","_setConfirmationListeners","isWithContent","setContent","$tip","getTipElement","_getContent","call","setElementContent","find","getTitle","toggle","length","_setButtons","_setStandardButtons","removeClass","_setupKeyupEvent","dispose","off","uid","eventBody","_cleanKeyupEvent","hide","callback","forEach","attr","self","on","e","ack","preventDefault","stopPropagation","stopImmediatePropagation","not","filter","data","confirmation","id","getUID","is","target","has","label","iconClass","iconContent","cancel","$group","empty","button","btn","addClass","html","prepend","text","one","onClick","value","append","window","_onKeyup","bind","event","tip","key","keyCode","which","$active","$next","next","children","first","focus","prev","last","prefix","Math","random","document","getElementById","_jQueryInterface","each","_config","test","TypeError","noConflict"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,IAAI,OAAOA,CAAC,CAACC,EAAF,CAAKC,OAAZ,KAAwB,WAAxB,IAAuCF,CAAC,CAACC,EAAF,CAAKC,OAAL,CAAaC,WAAb,CAAyBC,OAAzB,CAAiCC,KAAjC,CAAuC,GAAvC,EAA4CC,KAA5C,OAAwD,GAAnG,EAAwG;EACtG,QAAM,IAAIC,KAAJ,CAAU,uDAAV,CAAN;EACD;;EAED,IAAMC,OAAO,GAAGR,CAAC,CAACC,EAAF,CAAKC,OAAL,CAAaC,WAA7B;;ECJA;EAC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AR,IAAoBkF,OAAO,CAACpF,YAAnD,CAJ2B;;EAM3B,UAAI,CAACsC,IAAD,IAAS,eAAe+C,IAAf,CAAoBtF,MAApB,CAAb,EAA0C;EACxC;EACD;;EAED,UAAI,CAACuC,IAAL,EAAW;EACTA,QAAAA,IAAI,GAAG,IAAIzC,YAAJ,CAAiB,IAAjB,EAAuBuF,OAAvB,CAAP;EACAxJ,QAAAA,CAAC,CAAC,IAAD,CAAD,CAAQ0G,IAAR,CAAahG,QAAb,EAAuBgG,IAAvB;EACD;;EAED,UAAI,OAAOvC,MAAP,KAAkB,QAAtB,EAAgC;EAC9B,YAAI,OAAOuC,IAAI,CAACvC,MAAD,CAAX,KAAwB,WAA5B,EAAyC;EACvC,gBAAM,IAAIuF,SAAJ,wBAAkCvF,MAAlC,QAAN;EACD;;EACDuC,QAAAA,IAAI,CAACvC,MAAD,CAAJ;EACD;EACF,KArBM,CAAP;EAsBD;;;IA7XwB3D;EAgY3B;EACA;EACA;EACA;EACA;;;EAEAR,CAAC,CAACC,EAAF,CAAKQ,IAAL,IAAawD,YAAY,CAACqF,gBAA1B;EACAtJ,CAAC,CAACC,EAAF,CAAKQ,IAAL,EAAWN,WAAX,GAAyB8D,YAAzB;;EACAjE,CAAC,CAACC,EAAF,CAAKQ,IAAL,EAAWkJ,UAAX,GAAwB,YAAY;EAClC3J,EAAAA,CAAC,CAACC,EAAF,CAAKQ,IAAL,IAAaG,kBAAb;EACA,SAAOqD,YAAY,CAACqF,gBAApB;EACD,CAHD;;;;;;"} \ No newline at end of file diff --git a/dist/bootstrap-confirmation.min.js b/dist/bootstrap-confirmation.min.js deleted file mode 100644 index fae5870..0000000 --- a/dist/bootstrap-confirmation.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/*! - * Bootstrap Confirmation (v4.0.3) - * @copyright 2013 Nimit Suwannagate - * @copyright 2014-2018 Damien "Mistic" Sorel - * @licence Apache License, Version 2.0 - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jquery"),require("bootstrap")):"function"==typeof define&&define.amd?define(["jquery","bootstrap"],e):e((t=t||self).jQuery)}(this,function(a){"use strict";function l(t,e){for(var n=0;n\n
\n

\n
\n

\n
\n
\n \n \n
\n
\n
\n'});g.whiteList&&g.whiteList["*"].push("data-apply","data-dismiss");var C,b="fade",y="show",m=".popover-header",v=".confirmation-content",E=".confirmation-buttons .btn-group",_="[data-apply=confirmation]",O="[data-dismiss=confirmation]",k={13:"Enter",27:"Escape",39:"ArrowRight",40:"ArrowDown"},I={HIDE:"hide"+p,HIDDEN:"hidden"+p,SHOW:"show"+p,SHOWN:"shown"+p,INSERTED:"inserted"+p,CLICK:"click"+p,FOCUSIN:"focusin"+p,FOCUSOUT:"focusout"+p,MOUSEENTER:"mouseenter"+p,MOUSELEAVE:"mouseleave"+p,CONFIRMED:"confirmed"+p,CANCELED:"canceled"+p,KEYUP:"keyup"+p},o=function(o){var t,e,n,i,r;function s(t,e){var n;if(((n=o.call(this,t,e)||this).config.popout||n.config.singleton)&&!n.config.rootSelector)throw new Error("The rootSelector option is required to use popout and singleton features since jQuery 3.");return n._isDelegate=!1,e.selector?(e._selector=e.rootSelector+" "+e.selector,n.config._selector=e._selector):e._selector?(n.config._selector=e._selector,n._isDelegate=!0):n.config._selector=e.rootSelector,void 0===n.config.confirmationEvent&&(n.config.confirmationEvent=n.config.trigger),n.config.selector||n._copyAttributes(),n._setConfirmationListeners(),n}e=o,(t=s).prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e,n=s,r=[{key:"VERSION",get:function(){return"4.0.3"}},{key:"Default",get:function(){return g}},{key:"NAME",get:function(){return f}},{key:"DATA_KEY",get:function(){return u}},{key:"Event",get:function(){return I}},{key:"EVENT_KEY",get:function(){return p}},{key:"DefaultType",get:function(){return d}}],(i=null)&&l(n.prototype,i),r&&l(n,r);var c=s.prototype;return c.isWithContent=function(){return!0},c.setContent=function(){var t=a(this.getTipElement()),e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(m),this.getTitle()),t.find(v).toggle(!!e),e&&this.setElementContent(t.find(v),e),0").addClass(this.config.btnOkIconClass||"").text(this.config.btnOkIconContent||"")),n.off("click").one("click",function(t){"#"===a(this).attr("href")&&t.preventDefault(),e.config.onConfirm.call(e.element),a(e.element).trigger(I.CONFIRMED),a(e.element).trigger(e.config.confirmationEvent,[!0]),e.hide()});var o=t.find(O).addClass(this.config.btnCancelClass).html(this.config.btnCancelLabel);(this.config.btnCancelIconClass||this.config.btnCancelIconContent)&&o.prepend(a("").addClass(this.config.btnCancelIconClass||"").text(this.config.btnCancelIconContent||"")),o.off("click").one("click",function(t){t.preventDefault(),e.config.onCancel.call(e.element),a(e.element).trigger(I.CANCELED),e.hide()})},c._setCustomButtons=function(t){var n=this,o=t.find(E).empty();this.config.buttons.forEach(function(e){var t=a('').addClass(h).addClass(e.class||"btn btn-secondary").html(e.label||"").attr(e.attr||{});(e.iconClass||e.iconContent)&&t.prepend(a("").addClass(e.iconClass||"").text(e.iconContent||"")),t.one("click",function(t){"#"===a(this).attr("href")&&t.preventDefault(),e.onClick&&e.onClick.call(a(n.element)),e.cancel?(n.config.onCancel.call(n.element,e.value),a(n.element).trigger(I.CANCELED,[e.value])):(n.config.onConfirm.call(n.element,e.value),a(n.element).trigger(I.CONFIRMED,[e.value])),n.hide()}),o.append(t)})},c._setupKeyupEvent=function(){C=this,a(window).off(I.KEYUP).on(I.KEYUP,this._onKeyup.bind(this))},c._cleanKeyupEvent=function(){C===this&&(C=void 0,a(window).off(I.KEYUP))},c._onKeyup=function(t){if(this.tip){var e,n=a(this.getTipElement()),o=t.key||k[t.keyCode||t.which],i=n.find(E),r=i.find(".active");switch(o){case"Escape":this.hide();break;case"ArrowRight":e=r.length&&r.next().length?r.next():i.children().first(),r.removeClass("active"),e.addClass("active").focus();break;case"ArrowLeft":e=r.length&&r.prev().length?r.prev():i.children().last(),r.removeClass("active"),e.addClass("active").focus()}}else this._cleanKeyupEvent()},s.getUID=function(t){for(var e=t;e+=~~(1e6*Math.random()),document.getElementById(e););return e},s._jQueryInterface=function(n){return this.each(function(){var t=a(this).data(u),e="object"==typeof n?n:{};if(e.rootSelector=a(this).selector||e.rootSelector,(t||!/destroy|hide/.test(n))&&(t||(t=new s(this,e),a(this).data(u,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s}(e);a.fn[f]=o._jQueryInterface,a.fn[f].Constructor=o,a.fn[f].noConflict=function(){return a.fn[f]=n,o._jQueryInterface}}); -//# sourceMappingURL=bootstrap-confirmation.min.js.map \ No newline at end of file diff --git a/dist/bootstrap-confirmation.min.js.map b/dist/bootstrap-confirmation.min.js.map deleted file mode 100644 index 2ff5b0b..0000000 --- a/dist/bootstrap-confirmation.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/popover.js","../src/confirmation.js"],"names":["fn","popover","$","Constructor","VERSION","split","shift","Error","Popover","NAME","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","BTN_CLASS_DEFAULT","DefaultType","_objectSpread","singleton","popout","copyAttributes","onConfirm","onCancel","btnOkClass","btnOkLabel","btnOkIconClass","btnOkIconContent","btnCancelClass","btnCancelLabel","btnCancelIconClass","btnCancelIconContent","buttons","Default","_attributes","_selector","placement","title","trigger","confirmationEvent","undefined","content","noop","template","whiteList","push","activeConfirmation","ClassName","Selector","Keymap","13","27","39","40","Event","HIDE","HIDDEN","SHOW","SHOWN","INSERTED","CLICK","FOCUSIN","FOCUSOUT","MOUSEENTER","MOUSELEAVE","CONFIRMED","CANCELED","KEYUP","Confirmation","element","config","_this","_Popover","call","this","rootSelector","_isDelegate","selector","_copyAttributes","_setConfirmationListeners","isWithContent","setContent","$tip","getTipElement","_getContent","setElementContent","find","getTitle","toggle","length","_setCustomButtons","_setStandardButtons","removeClass","_setupKeyupEvent","dispose","_cleanKeyupEvent","prototype","hide","callback","_this2","forEach","attr","self","on","e","ack","preventDefault","stopPropagation","stopImmediatePropagation","not","filter","data","confirmation","eventBody","uid","id","getUID","is","target","off","btnApply","addClass","html","prepend","text","one","btnDismiss","$group","empty","button","btn","class","label","iconClass","iconContent","onClick","cancel","value","append","window","_onKeyup","bind","event","tip","$next","key","keyCode","which","$active","next","children","first","focus","prev","last","prefix","Math","random","document","getElementById","_jQueryInterface","each","_config","test","TypeError","noConflict"],"mappings":";;;;;;4zBAGA,GAA4B,kEAAfA,GAAGC,SAAmF,MAAxDC,EAAEF,GAAGC,QAAQE,YAAYC,QAAQC,MAAM,KAAKC,QACrF,MAAM,IAAIC,MAAM,yDAGlB,IAAMC,EAAUN,EAAEF,GAAGC,QAAQE,YCEvBM,EAAO,eAEPC,EAAQ,MAASD,EACjBE,EAAS,IAAOD,EAChBE,EAAqBV,EAAEF,GAAGS,GAC1BI,EAAoB,6CAEpBC,EAAWC,EAAA,GACZP,EAAQM,YADI,CAEfE,UAAsB,UACtBC,OAAsB,UACtBC,eAAsB,iBACtBC,UAAsB,WACtBC,SAAsB,WACtBC,WAAsB,SACtBC,WAAsB,SACtBC,eAAsB,SACtBC,iBAAsB,SACtBC,eAAsB,SACtBC,eAAsB,SACtBC,mBAAsB,SACtBC,qBAAsB,SACtBC,QAAsB,UAGlBC,EAAOf,EAAA,GACRP,EAAQsB,QADA,CAEXC,YAAsB,GACtBC,UAAsB,KACtBC,UAAsB,MACtBC,MAAsB,gBACtBC,QAAsB,QACtBC,uBAAsBC,EACtBC,QAAsB,GACtBtB,WAAsB,EACtBC,QAAsB,EACtBC,eAAsB,cACtBC,UAAsBjB,EAAEqC,KACxBnB,SAAsBlB,EAAEqC,KACxBlB,WAAsB,cACtBC,WAAsB,MACtBC,eAAsB,GACtBC,iBAAsB,GACtBC,eAAsB,gBACtBC,eAAsB,KACtBC,mBAAsB,GACtBC,qBAAsB,GACtBC,QAAsB,GAGtBW,SAAQ,gSAQmB3B,EARnB,gEASmBA,EATnB,mFAiBNiB,EAAQW,WACVX,EAAQW,UAAU,KAAKC,K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UACRC,SAASC,eAAe7C,KACjC,OAAOA,KAGF8C,iBAAP,SAAwB1F,GACtB,OAAOI,KAAKuF,KAAK,WACf,IAAIlD,EAAO1G,EAAEqE,MAAMqC,KAAKlG,GAElBqJ,EAA4B,iBAAX5F,EAAsBA,EAAS,GAGtD,GAFA4F,EAAQvF,aAAetE,EAAEqE,MAAMG,UAAYqF,EAAQvF,cAE9CoC,IAAQ,eAAeoD,KAAK7F,MAI5ByC,IACHA,EAAO,IAAI3C,EAAaM,KAAMwF,GAC9B7J,EAAEqE,MAAMqC,KAAKlG,EAAUkG,IAGH,iBAAXzC,GAAqB,CAC9B,GAA4B,oBAAjByC,EAAKzC,GACd,MAAM,IAAI8F,UAAJ,oBAAkC9F,EAAlC,KAERyC,EAAKzC,YAjZc3D,GA6Z3BN,EAAEF,GAAGS,GAAQwD,EAAa4F,iBAC1B3J,EAAEF,GAAGS,GAAMN,YAAc8D,EACzB/D,EAAEF,GAAGS,GAAMyJ,WAAa,WAEtB,OADAhK,EAAEF,GAAGS,GAAQG,EACNqD,EAAa4F","sourcesContent":["import $ from 'jquery';\nimport 'bootstrap';\n\nif (typeof $.fn.popover === 'undefined' || $.fn.popover.Constructor.VERSION.split('.').shift() !== '4') {\n throw new Error('Bootstrap Confirmation 4 requires Bootstrap Popover 4');\n}\n\nconst Popover = $.fn.popover.Constructor;\n\nexport default Popover;\n","import $ from 'jquery';\nimport Popover from 'bootstrap/js/src/popover';\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'confirmation';\nconst VERSION = '4.0.3';\nconst DATA_KEY = `bs.${NAME}`;\nconst EVENT_KEY = `.${DATA_KEY}`;\nconst JQUERY_NO_CONFLICT = $.fn[NAME];\nconst BTN_CLASS_DEFAULT = 'btn btn-sm h-100 d-flex align-items-center';\n\nconst DefaultType = {\n ...Popover.DefaultType,\n singleton : 'boolean',\n popout : 'boolean',\n copyAttributes : '(string|array)',\n onConfirm : 'function',\n onCancel : 'function',\n btnOkClass : 'string',\n btnOkLabel : 'string',\n btnOkIconClass : 'string',\n btnOkIconContent : 'string',\n btnCancelClass : 'string',\n btnCancelLabel : 'string',\n btnCancelIconClass : 'string',\n btnCancelIconContent: 'string',\n buttons : 'array',\n};\n\nconst Default = {\n ...Popover.Default,\n _attributes : {},\n _selector : null,\n placement : 'top',\n title : 'Are you sure?',\n trigger : 'click',\n confirmationEvent : undefined,\n content : '',\n singleton : false,\n popout : false,\n copyAttributes : 'href target',\n onConfirm : $.noop,\n onCancel : $.noop,\n btnOkClass : 'btn-primary',\n btnOkLabel : 'Yes',\n btnOkIconClass : '',\n btnOkIconContent : '',\n btnCancelClass : 'btn-secondary',\n btnCancelLabel : 'No',\n btnCancelIconClass : '',\n btnCancelIconContent: '',\n buttons : [],\n // @formatter:off\n // href=\"#\" allows the buttons to be focused\n template : `\n
\n
\n

\n
\n

\n
\n
\n \n \n
\n
\n
\n
`,\n // @formatter:on\n};\n\nif (Default.whiteList) {\n Default.whiteList['*'].push('data-apply', 'data-dismiss');\n}\n\nconst ClassName = {\n FADE: 'fade',\n SHOW: 'show',\n};\n\nconst Selector = {\n TITLE : '.popover-header',\n CONTENT : '.confirmation-content',\n BUTTONS : '.confirmation-buttons .btn-group',\n BTN_APPLY : '[data-apply=confirmation]',\n BTN_DISMISS: '[data-dismiss=confirmation]',\n};\n\nconst Keymap = {\n 13: 'Enter',\n 27: 'Escape',\n 39: 'ArrowRight',\n 40: 'ArrowDown',\n};\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER: `mouseenter${EVENT_KEY}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY}`,\n CONFIRMED : `confirmed${EVENT_KEY}`,\n CANCELED : `canceled${EVENT_KEY}`,\n KEYUP : `keyup${EVENT_KEY}`,\n};\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n// keep track of the last openned confirmation for keyboard navigation\nlet activeConfirmation;\n\nclass Confirmation extends Popover {\n // Getters\n\n static get VERSION() {\n return VERSION;\n }\n\n static get Default() {\n return Default;\n }\n\n static get NAME() {\n return NAME;\n }\n\n static get DATA_KEY() {\n return DATA_KEY;\n }\n\n static get Event() {\n return Event;\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY;\n }\n\n static get DefaultType() {\n return DefaultType;\n }\n\n // Constructor\n\n constructor(element, config) {\n super(element, config);\n\n if ((this.config.popout || this.config.singleton) && !this.config.rootSelector) {\n throw new Error('The rootSelector option is required to use popout and singleton features since jQuery 3.');\n }\n\n // keep trace of selectors\n this._isDelegate = false;\n\n if (config.selector) { // container of buttons\n config._selector = `${config.rootSelector} ${config.selector}`;\n this.config._selector = config._selector;\n }\n else if (config._selector) { // children of container\n this.config._selector = config._selector;\n this._isDelegate = true;\n }\n else { // standalone\n this.config._selector = config.rootSelector;\n }\n\n if (this.config.confirmationEvent === undefined) {\n this.config.confirmationEvent = this.config.trigger;\n }\n\n if (!this.config.selector) {\n this._copyAttributes();\n }\n\n this._setConfirmationListeners();\n }\n\n // Overrides\n\n isWithContent() {\n return true;\n }\n\n setContent() {\n const $tip = $(this.getTipElement());\n let content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle());\n\n $tip.find(Selector.CONTENT).toggle(!!content);\n if (content) {\n this.setElementContent($tip.find(Selector.CONTENT), content);\n }\n\n if (this.config.buttons.length > 0) {\n this._setCustomButtons($tip);\n }\n else {\n this._setStandardButtons($tip);\n }\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`);\n\n this._setupKeyupEvent();\n }\n\n dispose() {\n this._cleanKeyupEvent();\n super.dispose();\n }\n\n hide(callback) {\n this._cleanKeyupEvent();\n super.hide(callback);\n }\n\n // Private\n\n /**\n * Copy the value of `copyAttributes` on the config object\n * @private\n */\n _copyAttributes() {\n this.config._attributes = {};\n if (this.config.copyAttributes) {\n if (typeof this.config.copyAttributes === 'string') {\n this.config.copyAttributes = this.config.copyAttributes.split(' ');\n }\n }\n else {\n this.config.copyAttributes = [];\n }\n\n this.config.copyAttributes.forEach((attr) => {\n this.config._attributes[attr] = $(this.element).attr(attr);\n });\n }\n\n /**\n * Custom event listeners for popouts and singletons\n * @private\n */\n _setConfirmationListeners() {\n const self = this;\n\n if (!this.config.selector) {\n // cancel original event\n $(this.element).on(this.config.trigger, (e, ack) => {\n if (!ack) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n });\n\n // manage singleton\n $(this.element).on(Event.SHOWN, function () {\n if (self.config.singleton) {\n // close all other popover already initialized\n $(self.config._selector).not($(this)).filter(function () {\n return $(this).data(DATA_KEY) !== undefined;\n }).confirmation('hide');\n }\n });\n }\n else {\n // cancel original event\n $(this.element).on(this.config.trigger, this.config.selector, (e, ack) => {\n if (!ack) {\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n });\n }\n\n if (!this._isDelegate) {\n // manage popout\n this.eventBody = false;\n this.uid = this.element.id || Confirmation.getUID(`${NAME}_group`);\n\n $(this.element).on(Event.SHOWN, () => {\n if (self.config.popout && !self.eventBody) {\n self.eventBody = $('body').on(`${Event.CLICK}.${self.uid}`, (e) => {\n if ($(self.config._selector).is(e.target)) {\n return;\n }\n // close all popover already initialized\n $(self.config._selector).filter(function () {\n return $(this).data(DATA_KEY) !== undefined;\n }).confirmation('hide');\n\n $('body').off(`${Event.CLICK}.${self.uid}`);\n self.eventBody = false;\n });\n }\n });\n }\n }\n\n /**\n * Init the standard ok/cancel buttons\n * @param $tip\n * @private\n */\n _setStandardButtons($tip) {\n const self = this;\n\n const btnApply = $tip.find(Selector.BTN_APPLY)\n .addClass(this.config.btnOkClass)\n .html(this.config.btnOkLabel)\n .attr(this.config._attributes);\n\n if (this.config.btnOkIconClass || this.config.btnOkIconContent) {\n btnApply.prepend($('')\n .addClass(this.config.btnOkIconClass || '')\n .text(this.config.btnOkIconContent || ''));\n }\n\n btnApply.off('click')\n .one('click', function (e) {\n if ($(this).attr('href') === '#') {\n e.preventDefault();\n }\n\n self.config.onConfirm.call(self.element);\n $(self.element).trigger(Event.CONFIRMED);\n $(self.element).trigger(self.config.confirmationEvent, [true]);\n\n self.hide();\n });\n\n const btnDismiss = $tip.find(Selector.BTN_DISMISS)\n .addClass(this.config.btnCancelClass)\n .html(this.config.btnCancelLabel);\n\n if (this.config.btnCancelIconClass || this.config.btnCancelIconContent) {\n btnDismiss.prepend($('')\n .addClass(this.config.btnCancelIconClass || '')\n .text(this.config.btnCancelIconContent || ''));\n }\n\n btnDismiss.off('click')\n .one('click', (e) => {\n e.preventDefault();\n\n self.config.onCancel.call(self.element);\n $(self.element).trigger(Event.CANCELED);\n\n self.hide();\n });\n }\n\n /**\n * Init the custom buttons\n * @param $tip\n * @private\n */\n _setCustomButtons($tip) {\n const self = this;\n const $group = $tip.find(Selector.BUTTONS).empty();\n\n this.config.buttons.forEach((button) => {\n const btn = $('')\n .addClass(BTN_CLASS_DEFAULT)\n .addClass(button.class || 'btn btn-secondary')\n .html(button.label || '')\n .attr(button.attr || {});\n\n if (button.iconClass || button.iconContent) {\n btn.prepend($('')\n .addClass(button.iconClass || '')\n .text(button.iconContent || ''));\n }\n\n btn.one('click', function (e) {\n if ($(this).attr('href') === '#') {\n e.preventDefault();\n }\n\n if (button.onClick) {\n button.onClick.call($(self.element));\n }\n\n if (button.cancel) {\n self.config.onCancel.call(self.element, button.value);\n $(self.element).trigger(Event.CANCELED, [button.value]);\n }\n else {\n self.config.onConfirm.call(self.element, button.value);\n $(self.element).trigger(Event.CONFIRMED, [button.value]);\n }\n\n self.hide();\n });\n\n $group.append(btn);\n });\n }\n\n /**\n * Install the keyboatd event handler\n * @private\n */\n _setupKeyupEvent() {\n activeConfirmation = this;\n $(window)\n .off(Event.KEYUP)\n .on(Event.KEYUP, this._onKeyup.bind(this));\n }\n\n /**\n * Remove the keyboard event handler\n * @private\n */\n _cleanKeyupEvent() {\n if (activeConfirmation === this) {\n activeConfirmation = undefined;\n $(window).off(Event.KEYUP);\n }\n }\n\n /**\n * Event handler for keyboard navigation\n * @param event\n * @private\n */\n _onKeyup(event) {\n if (!this.tip) {\n this._cleanKeyupEvent();\n return;\n }\n\n const $tip = $(this.getTipElement());\n const key = event.key || Keymap[event.keyCode || event.which];\n\n const $group = $tip.find(Selector.BUTTONS);\n const $active = $group.find('.active');\n let $next;\n\n switch (key) {\n case 'Escape':\n this.hide();\n break;\n\n case 'ArrowRight':\n if ($active.length && $active.next().length) {\n $next = $active.next();\n }\n else {\n $next = $group.children().first();\n }\n $active.removeClass('active');\n $next.addClass('active').focus();\n break;\n\n case 'ArrowLeft':\n if ($active.length && $active.prev().length) {\n $next = $active.prev();\n }\n else {\n $next = $group.children().last();\n }\n $active.removeClass('active');\n $next.addClass('active').focus();\n break;\n\n default:\n break;\n }\n }\n\n // Static\n\n /**\n * Generates an uui, copied from Bootrap's utils\n * @param {string} prefix\n * @returns {string}\n */\n static getUID(prefix) {\n let uid = prefix;\n do {\n // eslint-disable-next-line no-bitwise\n uid += ~~(Math.random() * 1000000); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(uid));\n return uid;\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY);\n\n const _config = typeof config === 'object' ? config : {};\n _config.rootSelector = $(this).selector || _config.rootSelector; // this.selector removed in jQuery > 3\n\n if (!data && /destroy|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Confirmation(this, _config);\n $(this).data(DATA_KEY, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`);\n }\n data[config]();\n }\n });\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Confirmation._jQueryInterface;\n$.fn[NAME].Constructor = Confirmation;\n$.fn[NAME].noConflict = function () {\n $.fn[NAME] = JQUERY_NO_CONFLICT;\n return Confirmation._jQueryInterface;\n};\n\nexport default Confirmation;\n"]} \ No newline at end of file diff --git a/package.json b/package.json index 3a94b67..9b90c1f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bootstrap-confirmation2", - "version": "4.1.0", - "homepage": "http://bootstrap-confirmation.js.org", + "version": "4.2.0", + "homepage": "https://bootstrap-confirmation.js.org", "description": "Bootstrap plugin for on-place confirm boxes using Popover", "license": "Apache-2.0", "authors": [ @@ -12,7 +12,7 @@ { "name": "Damien \"Mistic\" Sorel", "email": "contact@git.strangeplanet.fr", - "homepage": "http://www.strangeplanet.fr" + "homepage": "https://www.strangeplanet.fr" } ], "main": "dist/bootstrap-confirmation.js", @@ -26,7 +26,7 @@ "popup" ], "peerDependencies": { - "bootstrap": ">=4.0.0", + "bootstrap": "^4.0.0", "jquery": "1.9.1 - 3", "popper.js": "^1.12.9" }, @@ -46,8 +46,7 @@ "popper.js": "^1.12.9", "rollup": "^2.0.2", "rollup-plugin-babel": "^4.2.0", - "rollup-plugin-replace": "^2.0.0", - "uglify-js": "^3.5.15" + "rollup-plugin-replace": "^2.0.0" }, "repository": { "type": "git", @@ -58,9 +57,7 @@ }, "scripts": { "compile": "rollup --config rollup.config.js --file dist/bootstrap-confirmation.js src/confirmation.js", - "dist": "npm run compile && npm run minify", "lint": "eslint src", - "minify": "uglifyjs --compress typeofs=false --mangle --comments \"/^!/\" --source-map \"content=dist/bootstrap-confirmation.js.map,includeSources,url=bootstrap-confirmation.min.js.map\" --output dist/bootstrap-confirmation.min.js dist/bootstrap-confirmation.js", "server": "live-server --watch=dist,example --open=example", "start": "npm run compile && npm-run-all --parallel watch server", "test": "npm run lint", diff --git a/rollup.config.js b/rollup.config.js index 7e60ccb..fc73b73 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -8,6 +8,7 @@ export default { format : 'umd', name : 'bootstrap-confirmation', sourcemap: true, + interop : false, exports : 'none', globals : { 'jquery': 'jQuery' @@ -15,7 +16,7 @@ export default { banner : `/*! * Bootstrap Confirmation (v${pkg.version}) * @copyright 2013 Nimit Suwannagate - * @copyright 2014-2018 Damien "Mistic" Sorel + * @copyright 2014-${(new Date()).getFullYear()} Damien "Mistic" Sorel * @licence Apache License, Version 2.0 */` },