bootstrap-vue-editable-table
Version:
A Bootstrap Vue editable table for editing cells using built-in Bootstrap form elements
1,096 lines (883 loc) • 567 kB
JavaScript
import Vue from 'vue';
var e=function(){return (e=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},t={kebab:/-(\w)/g,styleProp:/:(.*)/,styleList:/;(?![^(]*\))/g};function r(e,t){return t?t.toUpperCase():""}function s(e){for(var s,a={},c=0,o=e.split(t.styleList);c<o.length;c++){var n=o[c].split(t.styleProp),i=n[0],l=n[1];(i=i.trim())&&("string"==typeof l&&(l=l.trim()),a[(s=i,s.replace(t.kebab,r))]=l);}return a}function a(){for(var t,r,a={},c=arguments.length;c--;)for(var o=0,n=Object.keys(arguments[c]);o<n.length;o++)switch(t=n[o]){case"class":case"style":case"directives":if(Array.isArray(a[t])||(a[t]=[]),"style"===t){var i=void 0;i=Array.isArray(arguments[c].style)?arguments[c].style:[arguments[c].style];for(var l=0;l<i.length;l++){var y=i[l];"string"==typeof y&&(i[l]=s(y));}arguments[c].style=i;}a[t]=a[t].concat(arguments[c][t]);break;case"staticClass":if(!arguments[c][t])break;void 0===a[t]&&(a[t]=""),a[t]&&(a[t]+=" "),a[t]+=arguments[c][t].trim();break;case"on":case"nativeOn":a[t]||(a[t]={});for(var p=0,f=Object.keys(arguments[c][t]||{});p<f.length;p++)r=f[p],a[t][r]?a[t][r]=[].concat(a[t][r],arguments[c][t][r]):a[t][r]=arguments[c][t][r];break;case"attrs":case"props":case"domProps":case"scopedSlots":case"staticStyle":case"hook":case"transition":a[t]||(a[t]={}),a[t]=e({},arguments[c][t],a[t]);break;case"slot":case"key":case"ref":case"tag":case"show":case"keepAlive":default:a[t]||(a[t]=arguments[c][t]);}return a}
function ownKeys$D(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$D(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$D(Object(source), !0).forEach(function (key) { _defineProperty$K(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$D(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty$K(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
function _typeof$2(obj) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$2(obj); }
var COMPONENT_UID_KEY = '_uid';
var isVue3 = Vue.version.startsWith('3');
var REF_FOR_KEY = isVue3 ? 'ref_for' : 'refInFor';
var ALLOWED_FIELDS_IN_DATA = ['class', 'staticClass', 'style', 'attrs', 'props', 'domProps', 'on', 'nativeOn', 'directives', 'scopedSlots', 'slot', 'key', 'ref', 'refInFor'];
var extend = Vue.extend.bind(Vue);
if (isVue3) {
var originalExtend = Vue.extend;
var KNOWN_COMPONENTS = ['router-link', 'transition', 'transition-group'];
var originalVModelDynamicCreated = Vue.vModelDynamic.created;
var originalVModelDynamicBeforeUpdate = Vue.vModelDynamic.beforeUpdate; // See https://github.com/vuejs/vue-next/pull/4121 for details
Vue.vModelDynamic.created = function (el, binding, vnode) {
originalVModelDynamicCreated.call(this, el, binding, vnode);
if (!el._assign) {
el._assign = function () {};
}
};
Vue.vModelDynamic.beforeUpdate = function (el, binding, vnode) {
originalVModelDynamicBeforeUpdate.call(this, el, binding, vnode);
if (!el._assign) {
el._assign = function () {};
}
};
extend = function patchedBootstrapVueExtend(definition) {
if (_typeof$2(definition) === 'object' && definition.render && !definition.__alreadyPatched) {
var originalRender = definition.render;
definition.__alreadyPatched = true;
definition.render = function (h) {
var patchedH = function patchedH(tag, dataObjOrChildren, rawSlots) {
var slots = rawSlots === undefined ? [] : [Array.isArray(rawSlots) ? rawSlots.filter(Boolean) : rawSlots];
var isTag = typeof tag === 'string' && !KNOWN_COMPONENTS.includes(tag);
var isSecondArgumentDataObject = dataObjOrChildren && _typeof$2(dataObjOrChildren) === 'object' && !Array.isArray(dataObjOrChildren);
if (!isSecondArgumentDataObject) {
return h.apply(void 0, [tag, dataObjOrChildren].concat(slots));
}
var attrs = dataObjOrChildren.attrs,
props = dataObjOrChildren.props,
restData = _objectWithoutProperties(dataObjOrChildren, ["attrs", "props"]);
var normalizedData = _objectSpread$D(_objectSpread$D({}, restData), {}, {
attrs: attrs,
props: isTag ? {} : props
});
if (tag === 'router-link' && !normalizedData.slots && !normalizedData.scopedSlots) {
// terrible workaround to fix router-link rendering with compat vue-router
normalizedData.scopedSlots = {
$hasNormal: function $hasNormal() {}
};
}
return h.apply(void 0, [tag, normalizedData].concat(slots));
};
if (definition.functional) {
var _ctx$children, _ctx$children$default;
var ctx = arguments[1];
var patchedCtx = _objectSpread$D({}, ctx);
patchedCtx.data = {
attrs: _objectSpread$D({}, ctx.data.attrs || {}),
props: _objectSpread$D({}, ctx.data.props || {})
};
Object.keys(ctx.data || {}).forEach(function (key) {
if (ALLOWED_FIELDS_IN_DATA.includes(key)) {
patchedCtx.data[key] = ctx.data[key];
} else if (key in ctx.props) {
patchedCtx.data.props[key] = ctx.data[key];
} else if (!key.startsWith('on')) {
patchedCtx.data.attrs[key] = ctx.data[key];
}
});
var IGNORED_CHILDREN_KEYS = ['_ctx'];
var children = ((_ctx$children = ctx.children) === null || _ctx$children === void 0 ? void 0 : (_ctx$children$default = _ctx$children.default) === null || _ctx$children$default === void 0 ? void 0 : _ctx$children$default.call(_ctx$children)) || ctx.children;
if (children && Object.keys(patchedCtx.children).filter(function (k) {
return !IGNORED_CHILDREN_KEYS.includes(k);
}).length === 0) {
delete patchedCtx.children;
} else {
patchedCtx.children = children;
}
patchedCtx.data.on = ctx.listeners;
return originalRender.call(this, patchedH, patchedCtx);
}
return originalRender.call(this, patchedH);
};
}
return originalExtend.call(this, definition);
}.bind(Vue);
}
Vue.nextTick;
var HAS_WINDOW_SUPPORT = typeof window !== 'undefined';
var HAS_DOCUMENT_SUPPORT = typeof document !== 'undefined';
var HAS_NAVIGATOR_SUPPORT = typeof navigator !== 'undefined';
var IS_BROWSER = HAS_WINDOW_SUPPORT && HAS_DOCUMENT_SUPPORT && HAS_NAVIGATOR_SUPPORT;
var WINDOW = HAS_WINDOW_SUPPORT ? window : {};
var DOCUMENT = HAS_DOCUMENT_SUPPORT ? document : {};
var NAVIGATOR = HAS_NAVIGATOR_SUPPORT ? navigator : {};
var USER_AGENT = (NAVIGATOR.userAgent || '').toLowerCase();
USER_AGENT.indexOf('jsdom') > 0;
/msie|trident/.test(USER_AGENT); // Determine if the browser supports the option passive for events
var HAS_PASSIVE_EVENT_SUPPORT = function () {
var passiveEventSupported = false;
if (IS_BROWSER) {
try {
var options = {
// This function will be called when the browser
// attempts to access the passive property
get passive() {
/* istanbul ignore next: will never be called in JSDOM */
passiveEventSupported = true;
}
};
WINDOW.addEventListener('test', options, options);
WINDOW.removeEventListener('test', options, options);
} catch (_unused) {
/* istanbul ignore next: will never be called in JSDOM */
passiveEventSupported = false;
}
}
return passiveEventSupported;
}();
var HAS_TOUCH_SUPPORT = IS_BROWSER && ('ontouchstart' in DOCUMENT.documentElement || NAVIGATOR.maxTouchPoints > 0);
IS_BROWSER && Boolean(WINDOW.PointerEvent || WINDOW.MSPointerEvent);
/* istanbul ignore next: JSDOM only checks for 'IntersectionObserver' */
IS_BROWSER && 'IntersectionObserver' in WINDOW && 'IntersectionObserverEntry' in WINDOW && // Edge 15 and UC Browser lack support for `isIntersecting`
// but we an use `intersectionRatio > 0` instead
// 'isIntersecting' in window.IntersectionObserverEntry.prototype &&
'intersectionRatio' in WINDOW.IntersectionObserverEntry.prototype;
var PROP_NAME = '$bvConfig';
var DEFAULT_BREAKPOINT = ['xs', 'sm', 'md', 'lg', 'xl'];
// --- General ---
var RX_ARRAY_NOTATION = /\[(\d+)]/g;
var RX_BV_PREFIX = /^(BV?)/;
var RX_DIGITS = /^\d+$/;
var RX_HTML_TAGS = /(<([^>]+)>)/gi;
var RX_HYPHENATE = /\B([A-Z])/g;
var RX_LOWER_UPPER = /([a-z])([A-Z])/g;
var RX_NUMBER = /^[0-9]*\.?[0-9]+$/;
var RX_REGEXP_REPLACE = /[-/\\^$*+?.()|[\]{}]/g;
var RX_SPACES = /[\s\uFEFF\xA0]+/g;
var RX_START_SPACE_WORD = /(\s|^)(\w)/g;
var RX_UNDERSCORE = /_/g;
var RX_UN_KEBAB = /-(\w)/g; // --- Date ---
// Loose YYYY-MM-DD matching, ignores any appended time inforation
// Matches '1999-12-20', '1999-1-1', '1999-01-20T22:51:49.118Z', '1999-01-02 13:00:00'
var RX_DATE = /^\d+-\d\d?-\d\d?(?:\s|T|$)/; // Used to split off the date parts of the YYYY-MM-DD string
var RX_DATE_SPLIT = /-|\s|T/; // Time string RegEx (optional seconds)
var RX_ENCODED_COMMA = /%2C/g;
var RX_ENCODE_REVERSE = /[!'()*]/g;
var RX_ICON_PREFIX = /^BIcon/; // --- Locale ---
var RX_STRIP_LOCALE_MODS = /-u-.+/;
function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _possibleConstructorReturn(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct$1(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf$1(Wrapper, Class); }; return _wrapNativeSuper(Class); }
function _construct$1(Parent, args, Class) { if (_isNativeReflectConstruct$1()) { _construct$1 = Reflect.construct; } else { _construct$1 = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf$1(instance, Class.prototype); return instance; }; } return _construct$1.apply(null, arguments); }
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
/* istanbul ignore next */
var Element = HAS_WINDOW_SUPPORT ? WINDOW.Element : /*#__PURE__*/function (_Object) {
_inherits(Element, _Object);
var _super = _createSuper(Element);
function Element() {
_classCallCheck$1(this, Element);
return _super.apply(this, arguments);
}
return Element;
}( /*#__PURE__*/_wrapNativeSuper(Object));
/* istanbul ignore next */
var HTMLElement = HAS_WINDOW_SUPPORT ? WINDOW.HTMLElement : /*#__PURE__*/function (_Element) {
_inherits(HTMLElement, _Element);
var _super2 = _createSuper(HTMLElement);
function HTMLElement() {
_classCallCheck$1(this, HTMLElement);
return _super2.apply(this, arguments);
}
return HTMLElement;
}(Element);
/* istanbul ignore next */
var SVGElement = HAS_WINDOW_SUPPORT ? WINDOW.SVGElement : /*#__PURE__*/function (_Element2) {
_inherits(SVGElement, _Element2);
var _super3 = _createSuper(SVGElement);
function SVGElement() {
_classCallCheck$1(this, SVGElement);
return _super3.apply(this, arguments);
}
return SVGElement;
}(Element);
/* istanbul ignore next */
HAS_WINDOW_SUPPORT ? WINDOW.File : /*#__PURE__*/function (_Object2) {
_inherits(File, _Object2);
var _super4 = _createSuper(File);
function File() {
_classCallCheck$1(this, File);
return _super4.apply(this, arguments);
}
return File;
}( /*#__PURE__*/_wrapNativeSuper(Object));
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
var toType = function toType(value) {
return _typeof(value);
};
var toRawType = function toRawType(value) {
return Object.prototype.toString.call(value).slice(8, -1);
};
var isUndefined = function isUndefined(value) {
return value === undefined;
};
var isNull = function isNull(value) {
return value === null;
};
var isUndefinedOrNull = function isUndefinedOrNull(value) {
return isUndefined(value) || isNull(value);
};
var isFunction$1 = function isFunction(value) {
return toType(value) === 'function';
};
var isBoolean = function isBoolean(value) {
return toType(value) === 'boolean';
};
var isString = function isString(value) {
return toType(value) === 'string';
};
var isNumber = function isNumber(value) {
return toType(value) === 'number';
};
var isNumeric$1 = function isNumeric(value) {
return RX_NUMBER.test(String(value));
};
var isArray = function isArray(value) {
return Array.isArray(value);
}; // Quick object check
// This is primarily used to tell Objects from primitive values
// when we know the value is a JSON-compliant type
// Note object could be a complex type like array, Date, etc.
var isObject = function isObject(obj) {
return obj !== null && _typeof(obj) === 'object';
}; // Strict object type check
// Only returns true for plain JavaScript objects
var isPlainObject = function isPlainObject(obj) {
return Object.prototype.toString.call(obj) === '[object Object]';
};
var isDate = function isDate(value) {
return value instanceof Date;
};
var isEvent = function isEvent(value) {
return value instanceof Event;
};
var isRegExp = function isRegExp(value) {
return toRawType(value) === 'RegExp';
};
var isPromise = function isPromise(value) {
return !isUndefinedOrNull(value) && isFunction$1(value.then) && isFunction$1(value.catch);
};
function ownKeys$C(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$C(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$C(Object(source), !0).forEach(function (key) { _defineProperty$J(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$C(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty$J(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var assign = function assign() {
return Object.assign.apply(Object, arguments);
};
var create = function create(proto, optionalProps) {
return Object.create(proto, optionalProps);
};
var defineProperties = function defineProperties(obj, props) {
return Object.defineProperties(obj, props);
};
var defineProperty$1 = function defineProperty(obj, prop, descriptor) {
return Object.defineProperty(obj, prop, descriptor);
};
var keys = function keys(obj) {
return Object.keys(obj);
}; // --- "Instance" ---
var hasOwnProperty = function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
};
// Shallow copy an object
var clone = function clone(obj) {
return _objectSpread$C({}, obj);
}; // Return a shallow copy of object with the specified properties only
// See: https://gist.github.com/bisubus/2da8af7e801ffd813fab7ac221aa7afc
var pick = function pick(obj, props) {
return keys(obj).filter(function (key) {
return props.indexOf(key) !== -1;
}).reduce(function (result, key) {
return _objectSpread$C(_objectSpread$C({}, result), {}, _defineProperty$J({}, key, obj[key]));
}, {});
}; // Return a shallow copy of object with the specified properties omitted
// See: https://gist.github.com/bisubus/2da8af7e801ffd813fab7ac221aa7afc
var omit = function omit(obj, props) {
return keys(obj).filter(function (key) {
return props.indexOf(key) === -1;
}).reduce(function (result, key) {
return _objectSpread$C(_objectSpread$C({}, result), {}, _defineProperty$J({}, key, obj[key]));
}, {});
}; // Merges two object deeply together
// See: https://gist.github.com/Salakar/1d7137de9cb8b704e48a
var mergeDeep = function mergeDeep(target, source) {
if (isObject(target) && isObject(source)) {
keys(source).forEach(function (key) {
if (isObject(source[key])) {
if (!target[key] || !isObject(target[key])) {
target[key] = source[key];
}
mergeDeep(target[key], source[key]);
} else {
assign(target, _defineProperty$J({}, key, source[key]));
}
});
}
return target;
}; // Returns a shallow copy of the object with keys in sorted order
var sortKeys = function sortKeys(obj) {
return keys(obj).sort().reduce(function (result, key) {
return _objectSpread$C(_objectSpread$C({}, result), {}, _defineProperty$J({}, key, obj[key]));
}, {});
}; // Convenience method to create a read-only descriptor
var readonlyDescriptor = function readonlyDescriptor() {
return {
enumerable: true,
configurable: false,
writable: false
};
};
function ownKeys$B(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$B(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$B(Object(source), !0).forEach(function (key) { _defineProperty$I(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$B(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty$I(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toConsumableArray$4(arr) { return _arrayWithoutHoles$4(arr) || _iterableToArray$4(arr) || _unsupportedIterableToArray$5(arr) || _nonIterableSpread$4(); }
function _nonIterableSpread$4() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray$5(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$5(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen); }
function _iterableToArray$4(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles$4(arr) { if (Array.isArray(arr)) return _arrayLikeToArray$5(arr); }
function _arrayLikeToArray$5(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var cloneDeep = function cloneDeep(obj) {
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : obj;
if (isArray(obj)) {
return obj.reduce(function (result, val) {
return [].concat(_toConsumableArray$4(result), [cloneDeep(val, val)]);
}, []);
}
if (isPlainObject(obj)) {
return keys(obj).reduce(function (result, key) {
return _objectSpread$B(_objectSpread$B({}, result), {}, _defineProperty$I({}, key, cloneDeep(obj[key], obj[key])));
}, {});
}
return defaultValue;
};
var identity = function identity(x) {
return x;
};
/**
* Get property defined by dot/array notation in string, returns undefined if not found
*
* @link https://gist.github.com/jeneg/9767afdcca45601ea44930ea03e0febf#gistcomment-1935901
*
* @param {Object} obj
* @param {string|Array} path
* @return {*}
*/
var getRaw = function getRaw(obj, path) {
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
// Handle array of path values
path = isArray(path) ? path.join('.') : path; // If no path or no object passed
if (!path || !isObject(obj)) {
return defaultValue;
} // Handle edge case where user has dot(s) in top-level item field key
// See https://github.com/bootstrap-vue/bootstrap-vue/issues/2762
// Switched to `in` operator vs `hasOwnProperty` to handle obj.prototype getters
// https://github.com/bootstrap-vue/bootstrap-vue/issues/3463
if (path in obj) {
return obj[path];
} // Handle string array notation (numeric indices only)
path = String(path).replace(RX_ARRAY_NOTATION, '.$1');
var steps = path.split('.').filter(identity); // Handle case where someone passes a string of only dots
if (steps.length === 0) {
return defaultValue;
} // Traverse path in object to find result
// Switched to `in` operator vs `hasOwnProperty` to handle obj.prototype getters
// https://github.com/bootstrap-vue/bootstrap-vue/issues/3463
return steps.every(function (step) {
return isObject(obj) && step in obj && !isUndefinedOrNull(obj = obj[step]);
}) ? obj : isNull(obj) ? null : defaultValue;
};
/**
* Get property defined by dot/array notation in string.
*
* @link https://gist.github.com/jeneg/9767afdcca45601ea44930ea03e0febf#gistcomment-1935901
*
* @param {Object} obj
* @param {string|Array} path
* @param {*} defaultValue (optional)
* @return {*}
*/
var get = function get(obj, path) {
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var value = getRaw(obj, path);
return isUndefinedOrNull(value) ? defaultValue : value;
};
/**
* Utilities to get information about the current environment
*/
var getEnv = function getEnv(key) {
var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var env = typeof process !== 'undefined' && process ? process.env || {} : {};
if (!key) {
/* istanbul ignore next */
return env;
}
return env[key] || fallback;
};
var getNoWarn = function getNoWarn() {
return getEnv('BOOTSTRAP_VUE_NO_WARN') || getEnv('NODE_ENV') === 'production';
};
/**
* Log a warning message to the console with BootstrapVue formatting
* @param {string} message
*/
var warn = function warn(message)
/* istanbul ignore next */
{
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
if (!getNoWarn()) {
console.warn("[BootstrapVue warn]: ".concat(source ? "".concat(source, " - ") : '').concat(message));
}
};
// Component names
var NAME_BUTTON = 'BButton';
var NAME_CALENDAR = 'BCalendar';
var NAME_DROPDOWN = 'BDropdown';
var NAME_FORM_CHECKBOX = 'BFormCheckbox';
var NAME_FORM_DATEPICKER = 'BFormDatepicker';
var NAME_FORM_INPUT = 'BFormInput';
var NAME_FORM_RATING = 'BFormRating';
var NAME_FORM_SELECT = 'BFormSelect';
var NAME_FORM_SELECT_OPTION = 'BFormSelectOption';
var NAME_FORM_SELECT_OPTION_GROUP = 'BFormSelectOptionGroup';
var NAME_ICON = 'BIcon';
var NAME_ICON_BASE = 'BIconBase';
var NAME_LINK = 'BLink';
var NAME_MODAL = 'BModal';
var NAME_TABLE = 'BTable';
var NAME_TABLE_CELL = 'BTableCell';
var NAME_TBODY = 'BTbody';
var NAME_TFOOT = 'BTfoot';
var NAME_TH = 'BTh';
var NAME_THEAD = 'BThead';
var NAME_TOOLTIP = 'BTooltip';
var NAME_TR = 'BTr'; // Helper component names
var NAME_FORM_BUTTON_LABEL_CONTROL = 'BVFormBtnLabelControl';
var NAME_FORM_RATING_STAR = 'BVFormRatingStar';
var NAME_POPPER = 'BVPopper';
var NAME_TOOLTIP_HELPER = 'BVTooltip';
var NAME_TOOLTIP_TEMPLATE = 'BVTooltipTemplate';
var NAME_TRANSITION = 'BVTransition';
var EVENT_NAME_BLUR = 'blur';
var EVENT_NAME_CHANGE = 'change';
var EVENT_NAME_CLICK = 'click';
var EVENT_NAME_CLOSE = 'close';
var EVENT_NAME_CONTEXT = 'context';
var EVENT_NAME_CONTEXT_CHANGED = 'context-changed';
var EVENT_NAME_DISABLE = 'disable';
var EVENT_NAME_DISABLED = 'disabled';
var EVENT_NAME_ENABLE = 'enable';
var EVENT_NAME_ENABLED = 'enabled';
var EVENT_NAME_FILTERED = 'filtered';
var EVENT_NAME_FOCUSIN = 'focusin';
var EVENT_NAME_FOCUSOUT = 'focusout';
var EVENT_NAME_HEAD_CLICKED = 'head-clicked';
var EVENT_NAME_HIDDEN = 'hidden';
var EVENT_NAME_HIDE = 'hide';
var EVENT_NAME_INPUT = 'input';
var EVENT_NAME_MOUSEENTER = 'mouseenter';
var EVENT_NAME_MOUSELEAVE = 'mouseleave';
var EVENT_NAME_OPEN = 'open';
var EVENT_NAME_REFRESH = 'refresh';
var EVENT_NAME_REFRESHED = 'refreshed';
var EVENT_NAME_ROW_CLICKED = 'row-clicked';
var EVENT_NAME_ROW_CONTEXTMENU = 'row-contextmenu';
var EVENT_NAME_ROW_DBLCLICKED = 'row-dblclicked';
var EVENT_NAME_ROW_HOVERED = 'row-hovered';
var EVENT_NAME_ROW_MIDDLE_CLICKED = 'row-middle-clicked';
var EVENT_NAME_ROW_SELECTED = 'row-selected';
var EVENT_NAME_ROW_UNHOVERED = 'row-unhovered';
var EVENT_NAME_SELECTED = 'selected';
var EVENT_NAME_SHOW = 'show';
var EVENT_NAME_SHOWN = 'shown';
var EVENT_NAME_SORT_CHANGED = 'sort-changed';
var EVENT_NAME_TOGGLE = 'toggle';
var EVENT_NAME_UPDATE = 'update';
var HOOK_EVENT_NAME_BEFORE_DESTROY = isVue3 ? 'vnodeBeforeUnmount' : 'hook:beforeDestroy';
var HOOK_EVENT_NAME_DESTROYED = isVue3 ? 'vNodeUnmounted' : 'hook:destroyed';
var MODEL_EVENT_NAME_PREFIX = 'update:';
var ROOT_EVENT_NAME_PREFIX = 'bv';
var ROOT_EVENT_NAME_SEPARATOR = '::';
var EVENT_OPTIONS_NO_CAPTURE = {
passive: true,
capture: false
};
// General types
var PROP_TYPE_ANY = undefined;
var PROP_TYPE_ARRAY = Array;
var PROP_TYPE_BOOLEAN = Boolean;
var PROP_TYPE_DATE = Date;
var PROP_TYPE_FUNCTION = Function;
var PROP_TYPE_NUMBER = Number;
var PROP_TYPE_OBJECT = Object;
var PROP_TYPE_REG_EXP = RegExp;
var PROP_TYPE_STRING = String; // Multiple types
var PROP_TYPE_ARRAY_FUNCTION = [PROP_TYPE_ARRAY, PROP_TYPE_FUNCTION];
var PROP_TYPE_ARRAY_OBJECT = [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT];
var PROP_TYPE_ARRAY_OBJECT_STRING = [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING];
var PROP_TYPE_ARRAY_STRING = [PROP_TYPE_ARRAY, PROP_TYPE_STRING];
var PROP_TYPE_BOOLEAN_STRING = [PROP_TYPE_BOOLEAN, PROP_TYPE_STRING];
var PROP_TYPE_DATE_STRING = [PROP_TYPE_DATE, PROP_TYPE_STRING];
var PROP_TYPE_NUMBER_STRING = [PROP_TYPE_NUMBER, PROP_TYPE_STRING];
var PROP_TYPE_NUMBER_OBJECT_STRING = [PROP_TYPE_NUMBER, PROP_TYPE_OBJECT, PROP_TYPE_STRING];
var PROP_TYPE_OBJECT_FUNCTION = [PROP_TYPE_OBJECT, PROP_TYPE_FUNCTION];
var PROP_TYPE_OBJECT_STRING = [PROP_TYPE_OBJECT, PROP_TYPE_STRING];
var SLOT_NAME_BOTTOM_ROW = 'bottom-row';
var SLOT_NAME_BUTTON_CONTENT = 'button-content';
var SLOT_NAME_CUSTOM_FOOT = 'custom-foot';
var SLOT_NAME_DEFAULT = 'default';
var SLOT_NAME_EMPTY = 'empty';
var SLOT_NAME_EMPTYFILTERED = 'emptyfiltered';
var SLOT_NAME_FIRST = 'first';
var SLOT_NAME_ICON_CLEAR = 'icon-clear';
var SLOT_NAME_ICON_EMPTY = 'icon-empty';
var SLOT_NAME_ICON_FULL = 'icon-full';
var SLOT_NAME_ICON_HALF = 'icon-half';
var SLOT_NAME_NAV_NEXT_DECADE = 'nav-next-decade';
var SLOT_NAME_NAV_NEXT_MONTH = 'nav-next-month';
var SLOT_NAME_NAV_NEXT_YEAR = 'nav-next-year';
var SLOT_NAME_NAV_PEV_DECADE = 'nav-prev-decade';
var SLOT_NAME_NAV_PEV_MONTH = 'nav-prev-month';
var SLOT_NAME_NAV_PEV_YEAR = 'nav-prev-year';
var SLOT_NAME_NAV_THIS_MONTH = 'nav-this-month';
var SLOT_NAME_ROW_DETAILS = 'row-details';
var SLOT_NAME_TABLE_BUSY = 'table-busy';
var SLOT_NAME_TABLE_CAPTION = 'table-caption';
var SLOT_NAME_TABLE_COLGROUP = 'table-colgroup';
var SLOT_NAME_THEAD_TOP = 'thead-top';
var SLOT_NAME_TOP_ROW = 'top-row';
var from = function from() {
return Array.from.apply(Array, arguments);
}; // --- Instance ---
var arrayIncludes = function arrayIncludes(array, value) {
return array.indexOf(value) !== -1;
};
var concat = function concat() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return Array.prototype.concat.apply([], args);
}; // --- Utilities ---
var createArray = function createArray(length, fillFn) {
var mapFn = isFunction$1(fillFn) ? fillFn : function () {
return fillFn;
};
return Array.apply(null, {
length: length
}).map(mapFn);
};
// In functional components, `slots` is a function so it must be called
// first before passing to the below methods. `scopedSlots` is always an
// object and may be undefined (for Vue < 2.6.x)
/**
* Returns true if either scoped or unscoped named slot exists
*
* @param {String, Array} name or name[]
* @param {Object} scopedSlots
* @param {Object} slots
* @returns {Array|undefined} VNodes
*/
var hasNormalizedSlot = function hasNormalizedSlot(names) {
var $scopedSlots = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var $slots = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
// Ensure names is an array
names = concat(names).filter(identity); // Returns true if the either a $scopedSlot or $slot exists with the specified name
return names.some(function (name) {
return $scopedSlots[name] || $slots[name];
});
};
/**
* Returns VNodes for named slot either scoped or unscoped
*
* @param {String, Array} name or name[]
* @param {String} scope
* @param {Object} scopedSlots
* @param {Object} slots
* @returns {Array|undefined} VNodes
*/
var normalizeSlot = function normalizeSlot(names) {
var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var $scopedSlots = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var $slots = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
// Ensure names is an array
names = concat(names).filter(identity);
var slot;
for (var i = 0; i < names.length && !slot; i++) {
var name = names[i];
slot = $scopedSlots[name] || $slots[name];
} // Note: in Vue 2.6.x, all named slots are also scoped slots
return isFunction$1(slot) ? slot(scope) : slot;
};
var normalizeSlotMixin = extend({
methods: {
// Returns `true` if the either a `$scopedSlot` or `$slot` exists with the specified name
// `name` can be a string name or an array of names
hasNormalizedSlot: function hasNormalizedSlot$1() {
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SLOT_NAME_DEFAULT;
var scopedSlots = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.$scopedSlots;
var slots = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.$slots;
return hasNormalizedSlot(name, scopedSlots, slots);
},
// Returns an array of rendered VNodes if slot found, otherwise `undefined`
// `name` can be a string name or an array of names
normalizeSlot: function normalizeSlot$1() {
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SLOT_NAME_DEFAULT;
var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var scopedSlots = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.$scopedSlots;
var slots = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.$slots;
var vNodes = normalizeSlot(name, scope, scopedSlots, slots);
return vNodes ? concat(vNodes) : vNodes;
}
}
});
// Number utilities
// Converts a value (string, number, etc.) to an integer number
// Assumes radix base 10
var toInteger = function toInteger(value) {
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;
var integer = parseInt(value, 10);
return isNaN(integer) ? defaultValue : integer;
}; // Converts a value (string, number, etc.) to a number
var toFloat = function toFloat(value) {
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;
var float = parseFloat(value);
return isNaN(float) ? defaultValue : float;
}; // Converts a value (string, number, etc.) to a string
// String utilities
// Converts PascalCase or camelCase to kebab-case
var kebabCase = function kebabCase(str) {
return str.replace(RX_HYPHENATE, '-$1').toLowerCase();
}; // Converts a kebab-case or camelCase string to PascalCase
var pascalCase = function pascalCase(str) {
str = kebabCase(str).replace(RX_UN_KEBAB, function (_, c) {
return c ? c.toUpperCase() : '';
});
return str.charAt(0).toUpperCase() + str.slice(1);
}; // Converts a string, including strings in camelCase or snake_case, into Start Case
// It keeps original single quote and hyphen in the word
// https://github.com/UrbanCompass/to-start-case
var startCase = function startCase(str) {
return str.replace(RX_UNDERSCORE, ' ').replace(RX_LOWER_UPPER, function (str, $1, $2) {
return $1 + ' ' + $2;
}).replace(RX_START_SPACE_WORD, function (str, $1, $2) {
return $1 + $2.toUpperCase();
});
}; // Lowercases the first letter of a string and returns a new string
var escapeRegExp = function escapeRegExp(str) {
return str.replace(RX_REGEXP_REPLACE, '\\$&');
}; // Convert a value to a string that can be rendered
// `undefined`/`null` will be converted to `''`
// Plain objects and arrays will be JSON stringified
var toString = function toString(val) {
var spaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
return isUndefinedOrNull(val) ? '' : isArray(val) || isPlainObject(val) && val.toString === Object.prototype.toString ? JSON.stringify(val, null, spaces) : String(val);
}; // Remove leading white space from a string
var trim = function trim(str) {
return toString(str).trim();
}; // Lower case a string
var ELEMENT_PROTO = Element.prototype;
// See: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
/* istanbul ignore next */
var matchesEl = ELEMENT_PROTO.matches || ELEMENT_PROTO.msMatchesSelector || ELEMENT_PROTO.webkitMatchesSelector; // See: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
/* istanbul ignore next */
var closestEl = ELEMENT_PROTO.closest || function (sel) {
var el = this;
do {
// Use our "patched" matches function
if (matches(el, sel)) {
return el;
}
el = el.parentElement || el.parentNode;
} while (!isNull(el) && el.nodeType === Node.ELEMENT_NODE);
return null;
}; // `requestAnimationFrame()` convenience method
/* istanbul ignore next: JSDOM always returns the first option */
var requestAF = (WINDOW.requestAnimationFrame || WINDOW.webkitRequestAnimationFrame || WINDOW.mozRequestAnimationFrame || WINDOW.msRequestAnimationFrame || WINDOW.oRequestAnimationFrame || // Fallback, but not a true polyfill
// Only needed for Opera Mini
/* istanbul ignore next */
function (cb) {
return setTimeout(cb, 16);
}).bind(WINDOW);
WINDOW.MutationObserver || WINDOW.WebKitMutationObserver || WINDOW.MozMutationObserver || null; // --- Utils ---
var isElement = function isElement(el) {
return !!(el && el.nodeType === Node.ELEMENT_NODE);
}; // Get the currently active HTML element
var getActiveElement = function getActiveElement() {
var excludes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var activeElement = DOCUMENT.activeElement;
return activeElement && !excludes.some(function (el) {
return el === activeElement;
}) ? activeElement : null;
}; // Returns `true` if a tag's name equals `name`
var isTag = function isTag(tag, name) {
return toString(tag).toLowerCase() === toString(name).toLowerCase();
}; // Determine if an HTML element is the currently active element
var isActiveElement = function isActiveElement(el) {
return isElement(el) && el === getActiveElement();
}; // Determine if an HTML element is visible - Faster than CSS check
var isVisible = function isVisible(el) {
if (!isElement(el) || !el.parentNode || !contains(DOCUMENT.body, el)) {
// Note this can fail for shadow dom elements since they
// are not a direct descendant of document.body
return false;
}
if (getStyle(el, 'display') === 'none') {
// We do this check to help with vue-test-utils when using v-show
/* istanbul ignore next */
return false;
} // All browsers support getBoundingClientRect(), except JSDOM as it returns all 0's for values :(
// So any tests that need isVisible will fail in JSDOM
// Except when we override the getBCR prototype in some tests
var bcr = getBCR(el);
return !!(bcr && bcr.height > 0 && bcr.width > 0);
}; // Determine if an element is disabled
var isDisabled = function isDisabled(el) {
return !isElement(el) || el.disabled || hasAttr(el, 'disabled') || hasClass(el, 'disabled');
}; // Cause/wait-for an element to reflow its content (adjusting its height/width)
var selectAll = function selectAll(selector, root) {
return from((isElement(root) ? root : DOCUMENT).querySelectorAll(selector));
}; // Select a single element, returns `null` if not found
var select = function select(selector, root) {
return (isElement(root) ? root : DOCUMENT).querySelector(selector) || null;
}; // Determine if an element matches a selector
var matches = function matches(el, selector) {
return isElement(el) ? matchesEl.call(el, selector) : false;
}; // Finds closest element matching selector. Returns `null` if not found
var closest = function closest(selector, root) {
var includeRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
if (!isElement(root)) {
return null;
}
var el = closestEl.call(root, selector); // Native closest behaviour when `includeRoot` is truthy,
// else emulate jQuery closest and return `null` if match is
// the passed in root element when `includeRoot` is falsey
return includeRoot ? el : el === root ? null : el;
}; // Returns true if the parent element contains the child element
var contains = function contains(parent, child) {
return parent && isFunction$1(parent.contains) ? parent.contains(child) : false;
}; // Get an element given an ID
var getById = function getById(id) {
return DOCUMENT.getElementById(/^#/.test(id) ? id.slice(1) : id) || null;
}; // Add a class to an element
var addClass = function addClass(el, className) {
// We are checking for `el.classList` existence here since IE 11
// returns `undefined` for some elements (e.g. SVG elements)
// See https://github.com/bootstrap-vue/bootstrap-vue/issues/2713
if (className && isElement(el) && el.classList) {
el.classList.add(className);
}
}; // Remove a class from an element
var removeClass = function removeClass(el, className) {
// We are checking for `el.classList` existence here since IE 11
// returns `undefined` for some elements (e.g. SVG elements)
// See https://github.com/bootstrap-vue/bootstrap-vue/issues/2713
if (className && isElement(el) && el.classList) {
el.classList.remove(className);
}
}; // Test if an element has a class
var hasClass = function hasClass(el, className) {
// We are checking for `el.classList` existence here since IE 11
// returns `undefined` for some elements (e.g. SVG elements)
// See https://github.com/bootstrap-vue/bootstrap-vue/issues/2713
if (className && isElement(el) && el.classList) {
return el.classList.contains(className);
}
return false;
}; // Set an attribute on an element
var setAttr = function setAttr(el, attr, value) {
if (attr && isElement(el)) {
el.setAttribute(attr, value);
}
}; // Remove an attribute from an element
var removeAttr = function removeAttr(el, attr) {
if (attr && isElement(el)) {
el.removeAttribute(attr);
}
}; // Get an attribute value from an element
// Returns `null` if not found
var getAttr = function getAttr(el, attr) {
return attr && isElement(el) ? el.getAttribute(attr) : null;
}; // Determine if an attribute exists on an element
// Returns `true` or `false`, or `null` if element not found
var hasAttr = function hasAttr(el, attr) {
return attr && isElement(el) ? el.hasAttribute(attr) : null;
}; // Set an style property on an element
// Returns `null` if not found
var getStyle = function getStyle(el, prop) {
return prop && isElement(el) ? el.style[prop] || null : null;
}; // Return the Bounding Client Rect of an element
// Returns `null` if not an element
/* istanbul ignore next: getBoundingClientRect() doesn't work in JSDOM */
var getBCR = function getBCR(el) {
return isElement(el) ? el.getBoundingClientRect() : null;
}; // Get computed style object for an element
/* istanbul ignore next: getComputedStyle() doesn't work in JSDOM */
var getCS = function getCS(el) {
var getComputedStyle = WINDOW.getComputedStyle;
return getComputedStyle && isElement(el) ? getComputedStyle(el) : {};
}; // Returns a `Selection` object representing the range of text selected
// Returns `null` if no window support is given
/* istanbul ignore next: getSelection() doesn't work in JSDOM */
var getSel = function getSel() {
var getSelection = WINDOW.getSelection;
return getSelection ? WINDOW.getSelection() : null;
}; // Return an element's offset with respect to document element
var attemptFocus = function attemptFocus(el) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
try {
el.focus(options);
} catch (_unused) {}
return isActiveElement(el);
}; // Attempt to blur an element, and return `true` if successful
var attemptBlur = function attemptBlur(el) {
try {
el.blur();
} catch (_unused2) {}
return !isActiveElement(el);
};
var memoize = function memoize(fn) {
var cache = create(null);
return function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var argsKey = JSON.stringify(args);
return cache[argsKey] = cache[argsKey] || fn.apply(null, args);
};
};
var VueProto = Vue.prototype; // --- Getter methods ---
var getConfigValue = function getConfigValue(key) {
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
var bvConfig = VueProto[PROP_NAME];
return bvConfig ? bvConfig.getConfigValue(key, defaultValue) : cloneDeep(defaultValue);
}; // Method to grab a config value for a particular component
var getComponentConfig = function getComponentConfig(key) {
var propKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
// Return the particular config value for key if specified,
// otherwise we return the full config (or an empty object if not found)
return propKey ? getConfigValue("".concat(key, ".").concat(propKey), defaultValue) : getConfigValue(key, {});
}; // Get all breakpoint names
var getBreakpoints = function getBreakpoints() {
return getConfigValue('breakpoints', DEFAULT_BREAKPOINT);
}; // Private method for caching breakpoint names
var _getBreakpointsCached = memoize(function () {
return getBreakpoints();
}); // Get all breakpoint names (cached)
var getBreakpointsCached = function getBreakpointsCached() {
return cloneDeep(_getBreakpointsCached());
}; // Get breakpoints with the smallest breakpoint set as ''
// Useful for components that create breakpoint specific props
memoize(function () {
var breakpoints = getBreakpointsCached();
breakpoints[0] = '';
return breakpoints;
}); // Get breakpoints with the largest breakpoint set as ''
function ownKeys$A(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$A(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$A(Object(source), !0).forEach(function (key) { _defineProperty$H(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$A(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
function _defineProperty$H(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var makeProp = function makeProp() {
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PROP_TYPE_ANY;
var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
var requiredOrValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] :