mirror of
https://github.com/tabler/tabler.git
synced 2025-12-22 01:44:25 +04:00
Release 1.0.0-beta13
This commit is contained in:
219
demo/dist/js/tabler.js
vendored
219
demo/dist/js/tabler.js
vendored
@@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* Tabler v1.0.0-beta12 (https://tabler.io)
|
||||
* @version 1.0.0-beta12
|
||||
* Tabler v1.0.0-beta13 (https://tabler.io)
|
||||
* @version 1.0.0-beta13
|
||||
* @link https://tabler.io
|
||||
* Copyright 2018-2022 The Tabler Authors
|
||||
* Copyright 2018-2022 codecalm.net Paweł Kuna
|
||||
@@ -80,13 +80,13 @@
|
||||
if (superClass) _setPrototypeOf(subClass, superClass);
|
||||
}
|
||||
function _getPrototypeOf(o) {
|
||||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
||||
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
||||
return o.__proto__ || Object.getPrototypeOf(o);
|
||||
};
|
||||
return _getPrototypeOf(o);
|
||||
}
|
||||
function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
return o;
|
||||
};
|
||||
@@ -167,7 +167,7 @@
|
||||
}
|
||||
function _get() {
|
||||
if (typeof Reflect !== "undefined" && Reflect.get) {
|
||||
_get = Reflect.get;
|
||||
_get = Reflect.get.bind();
|
||||
} else {
|
||||
_get = function _get(target, property, receiver) {
|
||||
var base = _superPropBase(target, property);
|
||||
@@ -222,9 +222,18 @@
|
||||
function _slicedToArray(arr, i) {
|
||||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
||||
}
|
||||
function _toConsumableArray(arr) {
|
||||
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
||||
}
|
||||
function _arrayWithoutHoles(arr) {
|
||||
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
||||
}
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
function _iterableToArray(iter) {
|
||||
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
||||
}
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
||||
if (_i == null) return;
|
||||
@@ -262,6 +271,9 @@
|
||||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
||||
return arr2;
|
||||
}
|
||||
function _nonIterableSpread() {
|
||||
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 _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||||
}
|
||||
@@ -662,7 +674,7 @@
|
||||
if (!isString(str)) throw new Error('value should be string');
|
||||
var details = new ChangeDetails();
|
||||
var checkTail = isString(tail) ? new ContinuousTailDetails(String(tail)) : tail;
|
||||
if (flags && flags.tail) flags._beforeTailState = this.state;
|
||||
if (flags !== null && flags !== void 0 && flags.tail) flags._beforeTailState = this.state;
|
||||
for (var ci = 0; ci < str.length; ++ci) {
|
||||
details.aggregate(this._appendChar(str[ci], flags, checkTail));
|
||||
}
|
||||
@@ -737,6 +749,9 @@
|
||||
}, {
|
||||
key: "splice",
|
||||
value: function splice(start, deleteCount, inserted, removeDirection) {
|
||||
var flags = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
||||
input: true
|
||||
};
|
||||
var tailPos = start + deleteCount;
|
||||
var tail = this.extractTail(tailPos);
|
||||
var oldRawValue;
|
||||
@@ -762,15 +777,19 @@
|
||||
tail.unshift();
|
||||
}
|
||||
}
|
||||
return details.aggregate(this.append(inserted, {
|
||||
input: true
|
||||
}, tail));
|
||||
return details.aggregate(this.append(inserted, flags, tail));
|
||||
}
|
||||
}, {
|
||||
key: "maskEquals",
|
||||
value: function maskEquals(mask) {
|
||||
return this.mask === mask;
|
||||
}
|
||||
}, {
|
||||
key: "typedValueEquals",
|
||||
value: function typedValueEquals(value) {
|
||||
var tval = this.typedValue;
|
||||
return value === tval || Masked.EMPTY_VALUES.includes(value) && Masked.EMPTY_VALUES.includes(tval) || this.doFormat(value) === this.doFormat(this.typedValue);
|
||||
}
|
||||
}]);
|
||||
return Masked;
|
||||
}();
|
||||
@@ -782,6 +801,7 @@
|
||||
return v;
|
||||
}
|
||||
};
|
||||
Masked.EMPTY_VALUES = [undefined, null, ''];
|
||||
IMask.Masked = Masked;
|
||||
|
||||
function maskedClass(mask) {
|
||||
@@ -1036,7 +1056,7 @@
|
||||
var details = new ChangeDetails();
|
||||
if (this._value) return details;
|
||||
var appended = this.char === ch;
|
||||
var isResolved = appended && (this.isUnmasking || flags.input || flags.raw) && !this.eager && !flags.tail;
|
||||
var isResolved = appended && (this.isUnmasking || flags.input || flags.raw) && (!flags.raw || !this.eager) && !flags.tail;
|
||||
if (isResolved) details.rawInserted = this.char;
|
||||
this._value = details.inserted = this.char;
|
||||
this._isRawInput = isResolved && (flags.raw || flags.input);
|
||||
@@ -1045,7 +1065,9 @@
|
||||
}, {
|
||||
key: "_appendEager",
|
||||
value: function _appendEager() {
|
||||
return this._appendChar(this.char);
|
||||
return this._appendChar(this.char, {
|
||||
tail: true
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "_appendPlaceholder",
|
||||
@@ -1614,11 +1636,11 @@
|
||||
var details = new ChangeDetails();
|
||||
if (!blockIter) return details;
|
||||
for (var bi = blockIter.index;; ++bi) {
|
||||
var _flags$_beforeTailSta;
|
||||
var _flags$_beforeTailSta, _flags$_beforeTailSta2;
|
||||
var _block = this._blocks[bi];
|
||||
if (!_block) break;
|
||||
var blockDetails = _block._appendChar(ch, Object.assign({}, flags, {
|
||||
_beforeTailState: (_flags$_beforeTailSta = flags._beforeTailState) === null || _flags$_beforeTailSta === void 0 ? void 0 : _flags$_beforeTailSta._blocks[bi]
|
||||
_beforeTailState: (_flags$_beforeTailSta = flags._beforeTailState) === null || _flags$_beforeTailSta === void 0 ? void 0 : (_flags$_beforeTailSta2 = _flags$_beforeTailSta._blocks) === null || _flags$_beforeTailSta2 === void 0 ? void 0 : _flags$_beforeTailSta2[bi]
|
||||
}));
|
||||
var skip = blockDetails.skip;
|
||||
details.aggregate(blockDetails);
|
||||
@@ -2279,6 +2301,7 @@
|
||||
return this._value;
|
||||
},
|
||||
set: function set(str) {
|
||||
if (this.value === str) return;
|
||||
this.masked.value = str;
|
||||
this.updateControl();
|
||||
this.alignCursor();
|
||||
@@ -2289,6 +2312,7 @@
|
||||
return this._unmaskedValue;
|
||||
},
|
||||
set: function set(str) {
|
||||
if (this.unmaskedValue === str) return;
|
||||
this.masked.unmaskedValue = str;
|
||||
this.updateControl();
|
||||
this.alignCursor();
|
||||
@@ -2299,6 +2323,7 @@
|
||||
return this.masked.typedValue;
|
||||
},
|
||||
set: function set(val) {
|
||||
if (this.masked.typedValueEquals(val)) return;
|
||||
this.masked.typedValue = val;
|
||||
this.updateControl();
|
||||
this.alignCursor();
|
||||
@@ -2460,7 +2485,10 @@
|
||||
this.el.value, this.cursorPos,
|
||||
this.value, this._selection);
|
||||
var oldRawValue = this.masked.rawInputValue;
|
||||
var offset = this.masked.splice(details.startChangePos, details.removed.length, details.inserted, details.removeDirection).offset;
|
||||
var offset = this.masked.splice(details.startChangePos, details.removed.length, details.inserted, details.removeDirection, {
|
||||
input: true,
|
||||
raw: true
|
||||
}).offset;
|
||||
var removeDirection = oldRawValue === this.masked.rawInputValue ? details.removeDirection : DIRECTION.NONE;
|
||||
var cursorPos = this.masked.nearestInputPos(details.startChangePos + offset, removeDirection);
|
||||
if (removeDirection !== DIRECTION.NONE) cursorPos = this.masked.nearestInputPos(cursorPos, DIRECTION.NONE);
|
||||
@@ -2784,6 +2812,11 @@
|
||||
get: function get() {
|
||||
return this.signed || this.min != null && this.min < 0 || this.max != null && this.max < 0;
|
||||
}
|
||||
}, {
|
||||
key: "typedValueEquals",
|
||||
value: function typedValueEquals(value) {
|
||||
return (_get(_getPrototypeOf(MaskedNumber.prototype), "typedValueEquals", this).call(this, value) || MaskedNumber.EMPTY_VALUES.includes(value) && MaskedNumber.EMPTY_VALUES.includes(this.typedValue)) && !(value === 0 && this.value === '');
|
||||
}
|
||||
}]);
|
||||
return MaskedNumber;
|
||||
}(Masked);
|
||||
@@ -2796,6 +2829,7 @@
|
||||
normalizeZeros: true,
|
||||
padFractionalZeros: false
|
||||
};
|
||||
MaskedNumber.EMPTY_VALUES = [].concat(_toConsumableArray(Masked.EMPTY_VALUES), [0]);
|
||||
IMask.MaskedNumber = MaskedNumber;
|
||||
|
||||
var MaskedFunction = function (_Masked) {
|
||||
@@ -2844,7 +2878,7 @@
|
||||
var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var details = this._applyDispatch(ch, flags);
|
||||
if (this.currentMask) {
|
||||
details.aggregate(this.currentMask._appendChar(ch, flags));
|
||||
details.aggregate(this.currentMask._appendChar(ch, this.currentMaskFlags(flags)));
|
||||
}
|
||||
return details;
|
||||
}
|
||||
@@ -2860,7 +2894,7 @@
|
||||
var tailValue = inputValue.slice(insertValue.length);
|
||||
var prevMask = this.currentMask;
|
||||
var details = new ChangeDetails();
|
||||
var prevMaskState = prevMask && prevMask.state;
|
||||
var prevMaskState = prevMask === null || prevMask === void 0 ? void 0 : prevMask.state;
|
||||
this.currentMask = this.doDispatch(appended, Object.assign({}, flags));
|
||||
if (this.currentMask) {
|
||||
if (this.currentMask !== prevMask) {
|
||||
@@ -2901,6 +2935,14 @@
|
||||
}
|
||||
return details;
|
||||
}
|
||||
}, {
|
||||
key: "currentMaskFlags",
|
||||
value: function currentMaskFlags(flags) {
|
||||
var _flags$_beforeTailSta, _flags$_beforeTailSta2;
|
||||
return Object.assign({}, flags, {
|
||||
_beforeTailState: ((_flags$_beforeTailSta = flags._beforeTailState) === null || _flags$_beforeTailSta === void 0 ? void 0 : _flags$_beforeTailSta.currentMaskRef) === this.currentMask && ((_flags$_beforeTailSta2 = flags._beforeTailState) === null || _flags$_beforeTailSta2 === void 0 ? void 0 : _flags$_beforeTailSta2.currentMask) || flags._beforeTailState
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "doDispatch",
|
||||
value: function doDispatch(appended) {
|
||||
@@ -2909,18 +2951,32 @@
|
||||
}
|
||||
}, {
|
||||
key: "doValidate",
|
||||
value: function doValidate() {
|
||||
var _get2, _this$currentMask;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
value: function doValidate(flags) {
|
||||
return _get(_getPrototypeOf(MaskedDynamic.prototype), "doValidate", this).call(this, flags) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(flags)));
|
||||
}
|
||||
}, {
|
||||
key: "doPrepare",
|
||||
value: function doPrepare(str) {
|
||||
var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var _normalizePrepare = normalizePrepare(_get(_getPrototypeOf(MaskedDynamic.prototype), "doPrepare", this).call(this, str, flags)),
|
||||
_normalizePrepare2 = _slicedToArray(_normalizePrepare, 2),
|
||||
s = _normalizePrepare2[0],
|
||||
details = _normalizePrepare2[1];
|
||||
if (this.currentMask) {
|
||||
var currentDetails;
|
||||
var _normalizePrepare3 = normalizePrepare(_get(_getPrototypeOf(MaskedDynamic.prototype), "doPrepare", this).call(this, s, this.currentMaskFlags(flags)));
|
||||
var _normalizePrepare4 = _slicedToArray(_normalizePrepare3, 2);
|
||||
s = _normalizePrepare4[0];
|
||||
currentDetails = _normalizePrepare4[1];
|
||||
details = details.aggregate(currentDetails);
|
||||
}
|
||||
return (_get2 = _get(_getPrototypeOf(MaskedDynamic.prototype), "doValidate", this)).call.apply(_get2, [this].concat(args)) && (!this.currentMask || (_this$currentMask = this.currentMask).doValidate.apply(_this$currentMask, args));
|
||||
return [s, details];
|
||||
}
|
||||
}, {
|
||||
key: "reset",
|
||||
value: function reset() {
|
||||
var _this$currentMask2;
|
||||
(_this$currentMask2 = this.currentMask) === null || _this$currentMask2 === void 0 ? void 0 : _this$currentMask2.reset();
|
||||
var _this$currentMask;
|
||||
(_this$currentMask = this.currentMask) === null || _this$currentMask === void 0 ? void 0 : _this$currentMask.reset();
|
||||
this.compiledMasks.forEach(function (m) {
|
||||
return m.reset();
|
||||
});
|
||||
@@ -2958,22 +3014,22 @@
|
||||
}, {
|
||||
key: "isComplete",
|
||||
get: function get() {
|
||||
var _this$currentMask3;
|
||||
return Boolean((_this$currentMask3 = this.currentMask) === null || _this$currentMask3 === void 0 ? void 0 : _this$currentMask3.isComplete);
|
||||
var _this$currentMask2;
|
||||
return Boolean((_this$currentMask2 = this.currentMask) === null || _this$currentMask2 === void 0 ? void 0 : _this$currentMask2.isComplete);
|
||||
}
|
||||
}, {
|
||||
key: "isFilled",
|
||||
get: function get() {
|
||||
var _this$currentMask4;
|
||||
return Boolean((_this$currentMask4 = this.currentMask) === null || _this$currentMask4 === void 0 ? void 0 : _this$currentMask4.isFilled);
|
||||
var _this$currentMask3;
|
||||
return Boolean((_this$currentMask3 = this.currentMask) === null || _this$currentMask3 === void 0 ? void 0 : _this$currentMask3.isFilled);
|
||||
}
|
||||
}, {
|
||||
key: "remove",
|
||||
value: function remove() {
|
||||
var details = new ChangeDetails();
|
||||
if (this.currentMask) {
|
||||
var _this$currentMask5;
|
||||
details.aggregate((_this$currentMask5 = this.currentMask).remove.apply(_this$currentMask5, arguments))
|
||||
var _this$currentMask4;
|
||||
details.aggregate((_this$currentMask4 = this.currentMask).remove.apply(_this$currentMask4, arguments))
|
||||
.aggregate(this._applyDispatch());
|
||||
}
|
||||
return details;
|
||||
@@ -2981,13 +3037,14 @@
|
||||
}, {
|
||||
key: "state",
|
||||
get: function get() {
|
||||
var _this$currentMask5;
|
||||
return Object.assign({}, _get(_getPrototypeOf(MaskedDynamic.prototype), "state", this), {
|
||||
_rawInputValue: this.rawInputValue,
|
||||
compiledMasks: this.compiledMasks.map(function (m) {
|
||||
return m.state;
|
||||
}),
|
||||
currentMaskRef: this.currentMask,
|
||||
currentMask: this.currentMask && this.currentMask.state
|
||||
currentMask: (_this$currentMask5 = this.currentMask) === null || _this$currentMask5 === void 0 ? void 0 : _this$currentMask5.state
|
||||
});
|
||||
},
|
||||
set: function set(state) {
|
||||
@@ -3013,11 +3070,11 @@
|
||||
}, {
|
||||
key: "extractTail",
|
||||
value: function extractTail() {
|
||||
var _this$currentMask7, _get3;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
var _this$currentMask7, _get2;
|
||||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||||
args[_key] = arguments[_key];
|
||||
}
|
||||
return this.currentMask ? (_this$currentMask7 = this.currentMask).extractTail.apply(_this$currentMask7, args) : (_get3 = _get(_getPrototypeOf(MaskedDynamic.prototype), "extractTail", this)).call.apply(_get3, [this].concat(args));
|
||||
return this.currentMask ? (_this$currentMask7 = this.currentMask).extractTail.apply(_this$currentMask7, args) : (_get2 = _get(_getPrototypeOf(MaskedDynamic.prototype), "extractTail", this)).call.apply(_get2, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "doCommit",
|
||||
@@ -3028,11 +3085,11 @@
|
||||
}, {
|
||||
key: "nearestInputPos",
|
||||
value: function nearestInputPos() {
|
||||
var _this$currentMask8, _get4;
|
||||
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
var _this$currentMask8, _get3;
|
||||
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
return this.currentMask ? (_this$currentMask8 = this.currentMask).nearestInputPos.apply(_this$currentMask8, args) : (_get4 = _get(_getPrototypeOf(MaskedDynamic.prototype), "nearestInputPos", this)).call.apply(_get4, [this].concat(args));
|
||||
return this.currentMask ? (_this$currentMask8 = this.currentMask).nearestInputPos.apply(_this$currentMask8, args) : (_get3 = _get(_getPrototypeOf(MaskedDynamic.prototype), "nearestInputPos", this)).call.apply(_get3, [this].concat(args));
|
||||
}
|
||||
}, {
|
||||
key: "overwrite",
|
||||
@@ -3058,6 +3115,12 @@
|
||||
return m.maskEquals((_mask$mi = mask[mi]) === null || _mask$mi === void 0 ? void 0 : _mask$mi.mask);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "typedValueEquals",
|
||||
value: function typedValueEquals(value) {
|
||||
var _this$currentMask9;
|
||||
return Boolean((_this$currentMask9 = this.currentMask) === null || _this$currentMask9 === void 0 ? void 0 : _this$currentMask9.typedValueEquals(value));
|
||||
}
|
||||
}]);
|
||||
return MaskedDynamic;
|
||||
}(Masked);
|
||||
@@ -3070,7 +3133,7 @@
|
||||
m.append(inputValue, {
|
||||
raw: true
|
||||
});
|
||||
m.append(appended, flags);
|
||||
m.append(appended, masked.currentMaskFlags(flags));
|
||||
var weight = m.rawInputValue.length;
|
||||
return {
|
||||
weight: weight,
|
||||
@@ -4658,7 +4721,7 @@
|
||||
});
|
||||
|
||||
/*!
|
||||
* Bootstrap v5.2.1 (https://getbootstrap.com/)
|
||||
* Bootstrap v5.2.2 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@@ -5189,7 +5252,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
const VERSION = '5.2.1';
|
||||
const VERSION = '5.2.2';
|
||||
class BaseComponent extends Config {
|
||||
constructor(element, config) {
|
||||
super();
|
||||
@@ -6033,7 +6096,7 @@
|
||||
super(element, config);
|
||||
this._popper = null;
|
||||
this._parent = this._element.parentNode;
|
||||
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0];
|
||||
this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent);
|
||||
this._inNavbar = this._detectNavbar();
|
||||
}
|
||||
static get Default() {
|
||||
@@ -6257,7 +6320,7 @@
|
||||
return;
|
||||
}
|
||||
event.preventDefault();
|
||||
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0];
|
||||
const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode);
|
||||
const instance = Dropdown.getOrCreateInstance(getToggleButton);
|
||||
if (isUpOrDownEvent) {
|
||||
event.stopPropagation();
|
||||
@@ -6679,7 +6742,7 @@
|
||||
});
|
||||
EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => {
|
||||
EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => {
|
||||
if (this._dialog.contains(event.target) || this._dialog.contains(event2.target)) {
|
||||
if (this._element !== event.target || this._element !== event2.target) {
|
||||
return;
|
||||
}
|
||||
if (this._config.backdrop === 'static') {
|
||||
@@ -7238,6 +7301,9 @@
|
||||
this._newContent = null;
|
||||
this.tip = null;
|
||||
this._setListeners();
|
||||
if (!this._config.selector) {
|
||||
this._fixTitle();
|
||||
}
|
||||
}
|
||||
static get Default() {
|
||||
return Default$3;
|
||||
@@ -7257,20 +7323,11 @@
|
||||
toggleEnabled() {
|
||||
this._isEnabled = !this._isEnabled;
|
||||
}
|
||||
toggle(event) {
|
||||
toggle() {
|
||||
if (!this._isEnabled) {
|
||||
return;
|
||||
}
|
||||
if (event) {
|
||||
const context = this._initializeOnDelegatedTarget(event);
|
||||
context._activeTrigger.click = !context._activeTrigger.click;
|
||||
if (context._isWithActiveTrigger()) {
|
||||
context._enter();
|
||||
} else {
|
||||
context._leave();
|
||||
}
|
||||
return;
|
||||
}
|
||||
this._activeTrigger.click = !this._activeTrigger.click;
|
||||
if (this._isShown()) {
|
||||
this._leave();
|
||||
return;
|
||||
@@ -7283,8 +7340,8 @@
|
||||
if (this.tip) {
|
||||
this.tip.remove();
|
||||
}
|
||||
if (this._config.originalTitle) {
|
||||
this._element.setAttribute('title', this._config.originalTitle);
|
||||
if (this._element.getAttribute('data-bs-original-title')) {
|
||||
this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title'));
|
||||
}
|
||||
this._disposePopper();
|
||||
super.dispose();
|
||||
@@ -7419,7 +7476,7 @@
|
||||
};
|
||||
}
|
||||
_getTitle() {
|
||||
return this._resolvePossibleFunction(this._config.title) || this._config.originalTitle;
|
||||
return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title');
|
||||
}
|
||||
_initializeOnDelegatedTarget(event) {
|
||||
return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig());
|
||||
@@ -7490,7 +7547,10 @@
|
||||
const triggers = this._config.trigger.split(' ');
|
||||
for (const trigger of triggers) {
|
||||
if (trigger === 'click') {
|
||||
EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => this.toggle(event));
|
||||
EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => {
|
||||
const context = this._initializeOnDelegatedTarget(event);
|
||||
context.toggle();
|
||||
});
|
||||
} else if (trigger !== TRIGGER_MANUAL) {
|
||||
const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1);
|
||||
const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1);
|
||||
@@ -7512,23 +7572,16 @@
|
||||
}
|
||||
};
|
||||
EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler);
|
||||
if (this._config.selector) {
|
||||
this._config = { ...this._config,
|
||||
trigger: 'manual',
|
||||
selector: ''
|
||||
};
|
||||
} else {
|
||||
this._fixTitle();
|
||||
}
|
||||
}
|
||||
_fixTitle() {
|
||||
const title = this._config.originalTitle;
|
||||
const title = this._element.getAttribute('title');
|
||||
if (!title) {
|
||||
return;
|
||||
}
|
||||
if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) {
|
||||
this._element.setAttribute('aria-label', title);
|
||||
}
|
||||
this._element.setAttribute('data-bs-original-title', title);
|
||||
this._element.removeAttribute('title');
|
||||
}
|
||||
_enter() {
|
||||
@@ -7584,7 +7637,6 @@
|
||||
hide: config.delay
|
||||
};
|
||||
}
|
||||
config.originalTitle = this._element.getAttribute('title') || '';
|
||||
if (typeof config.title === 'number') {
|
||||
config.title = config.title.toString();
|
||||
}
|
||||
@@ -7600,6 +7652,8 @@
|
||||
config[key] = this._config[key];
|
||||
}
|
||||
}
|
||||
config.selector = false;
|
||||
config.trigger = 'manual';
|
||||
return config;
|
||||
}
|
||||
_disposePopper() {
|
||||
@@ -7892,7 +7946,6 @@
|
||||
const CLASS_DROPDOWN = 'dropdown';
|
||||
const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
|
||||
const SELECTOR_DROPDOWN_MENU = '.dropdown-menu';
|
||||
const SELECTOR_DROPDOWN_ITEM = '.dropdown-item';
|
||||
const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)';
|
||||
const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]';
|
||||
const SELECTOR_OUTER = '.nav-item, .list-group-item';
|
||||
@@ -7942,7 +7995,6 @@
|
||||
element.classList.add(CLASS_NAME_SHOW$1);
|
||||
return;
|
||||
}
|
||||
element.focus();
|
||||
element.removeAttribute('tabindex');
|
||||
element.setAttribute('aria-selected', true);
|
||||
this._toggleDropDown(element, true);
|
||||
@@ -7982,6 +8034,9 @@
|
||||
const isNext = [ARROW_RIGHT_KEY, ARROW_DOWN_KEY].includes(event.key);
|
||||
const nextActiveElement = getNextActiveElement(this._getChildren().filter(element => !isDisabled(element)), event.target, isNext, true);
|
||||
if (nextActiveElement) {
|
||||
nextActiveElement.focus({
|
||||
preventScroll: true
|
||||
});
|
||||
Tab.getOrCreateInstance(nextActiveElement).show();
|
||||
}
|
||||
}
|
||||
@@ -8034,7 +8089,6 @@
|
||||
};
|
||||
toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE);
|
||||
toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW$1);
|
||||
toggle(SELECTOR_DROPDOWN_ITEM, CLASS_NAME_ACTIVE);
|
||||
outerElem.setAttribute('aria-expanded', open);
|
||||
}
|
||||
_setAttributeIfNotExists(element, attribute, value) {
|
||||
@@ -8181,12 +8235,16 @@
|
||||
switch (event.type) {
|
||||
case 'mouseover':
|
||||
case 'mouseout':
|
||||
this._hasMouseInteraction = isInteracting;
|
||||
break;
|
||||
{
|
||||
this._hasMouseInteraction = isInteracting;
|
||||
break;
|
||||
}
|
||||
case 'focusin':
|
||||
case 'focusout':
|
||||
this._hasKeyboardInteraction = isInteracting;
|
||||
break;
|
||||
{
|
||||
this._hasKeyboardInteraction = isInteracting;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isInteracting) {
|
||||
this._clearTimeout();
|
||||
@@ -8241,7 +8299,10 @@
|
||||
|
||||
var dropdownTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="dropdown"]'));
|
||||
dropdownTriggerList.map(function (dropdownTriggerEl) {
|
||||
return new Dropdown(dropdownTriggerEl);
|
||||
var options = {
|
||||
boundary: dropdownTriggerEl.getAttribute('data-bs-boundary') === 'viewport' ? document.querySelector('.btn') : 'clippingParents'
|
||||
};
|
||||
return new Dropdown(dropdownTriggerEl, options);
|
||||
});
|
||||
|
||||
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
||||
@@ -8320,7 +8381,7 @@
|
||||
getColor: getColor
|
||||
});
|
||||
|
||||
window.bootstrap = bootstrap;
|
||||
window.tabler = tabler;
|
||||
globalThis.bootstrap = bootstrap;
|
||||
globalThis.tabler = tabler;
|
||||
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user