From c7af7ce08ab7dcb8a711feb20d428f170f0a7a34 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Fri, 2 Apr 2021 23:52:47 +0200 Subject: [PATCH] Version 4.2.1 --- dist/bootstrap-confirmation.js | 116 ++++++++++++++++++----------- dist/bootstrap-confirmation.js.map | 2 +- package.json | 4 +- 3 files changed, 76 insertions(+), 46 deletions(-) diff --git a/dist/bootstrap-confirmation.js b/dist/bootstrap-confirmation.js index d5553e4..b848910 100644 --- a/dist/bootstrap-confirmation.js +++ b/dist/bootstrap-confirmation.js @@ -1,7 +1,7 @@ /*! - * Bootstrap Confirmation (v4.2.0) + * Bootstrap Confirmation (v4.2.1) * @copyright 2013 Nimit Suwannagate - * @copyright 2014-2020 Damien "Mistic" Sorel + * @copyright 2014-2021 Damien "Mistic" Sorel * @licence Apache License, Version 2.0 */ (function (global, factory) { @@ -47,7 +47,17 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; - subClass.__proto__ = superClass; + + _setPrototypeOf(subClass, superClass); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); } if (typeof $.fn.popover === 'undefined' || $.fn.popover.Constructor.VERSION.split('.').shift() !== '4') { @@ -63,7 +73,7 @@ */ var NAME = 'confirmation'; - var VERSION = '4.2.0'; + var VERSION = '4.2.1'; var DATA_KEY = "bs." + NAME; var EVENT_KEY = "." + DATA_KEY; var JQUERY_NO_CONFLICT = $.fn[NAME]; @@ -160,45 +170,7 @@ var Confirmation = /*#__PURE__*/function (_Popover) { _inheritsLoose(Confirmation, _Popover); - _createClass(Confirmation, null, [{ - key: "VERSION", - // Getters - get: function get() { - return VERSION; - } - }, { - key: "Default", - get: function get() { - return Default; - } - }, { - key: "NAME", - get: function get() { - return NAME; - } - }, { - key: "DATA_KEY", - get: function get() { - return DATA_KEY; - } - }, { - key: "Event", - get: function get() { - return Event; - } - }, { - key: "EVENT_KEY", - get: function get() { - return EVENT_KEY; - } - }, { - key: "DefaultType", - get: function get() { - return DefaultType; - } // Constructor - - }]); - + // Constructor function Confirmation(element, config) { var _this; @@ -286,6 +258,26 @@ _Popover.prototype.hide.call(this, callback); } // Private + /** + * Build configuration object + * Bootstrap standard is to give priority to JS config over data attributes, + * but for Confirmation we prefer data attributes + * @param config + * @return {*} + * @private + */ + ; + + _proto._getConfig = function _getConfig(config) { + config = _Popover.prototype._getConfig.call(this, config); + var dataAttributes = $(this.element).data(); + Object.keys(dataAttributes).forEach(function (dataAttr) { + if (dataAttr.indexOf('btn') !== 0) { + delete dataAttributes[dataAttr]; + } + }); + return _extends({}, config, dataAttributes); + } /** * Copy the value of `copyAttributes` on the config object * @private @@ -550,6 +542,44 @@ }); }; + _createClass(Confirmation, null, [{ + key: "VERSION", + get: // Getters + function get() { + return VERSION; + } + }, { + key: "Default", + get: function get() { + return Default; + } + }, { + key: "NAME", + get: function get() { + return NAME; + } + }, { + key: "DATA_KEY", + get: function get() { + return DATA_KEY; + } + }, { + key: "Event", + get: function get() { + return Event; + } + }, { + key: "EVENT_KEY", + get: function get() { + return EVENT_KEY; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType; + } + }]); + return Confirmation; }(Popover); /** diff --git a/dist/bootstrap-confirmation.js.map b/dist/bootstrap-confirmation.js.map index 2224e95..9af85b0 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 || (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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,IAAaG,kBAAb;EACA,SAAOqD,YAAY,CAACqF,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 * Build configuration object\n * Bootstrap standard is to give priority to JS config over data attributes,\n * but for Confirmation we prefer data attributes\n * @param config\n * @return {*}\n * @private\n */\n _getConfig(config) {\n config = super._getConfig(config);\n\n const dataAttributes = $(this.element).data();\n Object.keys(dataAttributes)\n .forEach((dataAttr) => {\n if (dataAttr.indexOf('btn') !== 0) {\n delete dataAttributes[dataAttr];\n }\n });\n\n return {\n ...config,\n ...dataAttributes,\n };\n }\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","_getConfig","dataAttributes","data","Object","keys","forEach","dataAttr","indexOf","attr","self","on","e","ack","preventDefault","stopPropagation","stopImmediatePropagation","not","filter","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;EACA;EACA;EACA;EACA;;EAEA,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,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newline at end of file diff --git a/package.json b/package.json index 9b90c1f..10b9bc8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap-confirmation2", - "version": "4.2.0", + "version": "4.2.1", "homepage": "https://bootstrap-confirmation.js.org", "description": "Bootstrap plugin for on-place confirm boxes using Popover", "license": "Apache-2.0", @@ -28,7 +28,7 @@ "peerDependencies": { "bootstrap": "^4.0.0", "jquery": "1.9.1 - 3", - "popper.js": "^1.12.9" + "popper.js": "^1.16.1" }, "devDependencies": { "@babel/core": "^7.5.0",