This commit is contained in:
2024-06-26 00:48:19 +03:00
parent 69c8e0e86c
commit 3228b3cb49
14 changed files with 42 additions and 39 deletions
+1
View File
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
__PluginManager__.register("collapse",(function(t,e,s){var i=t("bsCore"),{defineJQueryPlugin:n,getElement:a,getSelectorFromElement:r,getElementFromSelector:l,reflow:o,typeCheckConfig:g}=i.util.index,{Data:h,EventHandler:c,Manipulator:_,SelectorEngine:d}=i.dom,f=i.BaseComponent;const m="collapse",p="bs.collapse",u=`.${p}`,A={toggle:!0,parent:""},y={toggle:"boolean",parent:"(string|element)"},b=`show${u}`,L=`shown${u}`,C=`hide${u}`,$=`hidden${u}`,T=`click${u}.data-api`,v="show",w="collapse",E="collapsing",x="collapsed",D="width",I='[data-bs-toggle="collapse"]';class P extends f{constructor(t,e){super(t),this._isTransitioning=!1,this._config=this._getConfig(e),this._triggerArray=d.find(`${I}[href="#${this._element.id}"],${I}[data-bs-target="#${this._element.id}"]`);const s=d.find(I);for(let t=0,e=s.length;t<e;t++){const e=s[t],i=r(e),n=d.find(i).filter((t=>t===this._element));null!==i&&n.length&&(this._selector=i,this._triggerArray.push(e))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}static get Default(){return A}static get NAME(){return m}toggle(){this._element.classList.contains(v)?this.hide():this.show()}show(){if(this._isTransitioning||this._element.classList.contains(v))return;let t,e;this._parent&&(t=d.find(".show, .collapsing",this._parent).filter((t=>"string"==typeof this._config.parent?t.getAttribute("data-bs-parent")===this._config.parent:t.classList.contains(w))),0===t.length&&(t=null));const s=d.findOne(this._selector);if(t){const i=t.find((t=>s!==t));if(e=i?P.getInstance(i):null,e&&e._isTransitioning)return}if(c.trigger(this._element,b).defaultPrevented)return;t&&t.forEach((t=>{s!==t&&P.collapseInterface(t,"hide"),e||h.set(t,p,null)}));const i=this._getDimension();this._element.classList.remove(w),this._element.classList.add(E),this._element.style[i]=0,this._triggerArray.length&&this._triggerArray.forEach((t=>{t.classList.remove(x),t.setAttribute("aria-expanded",!0)})),this.setTransitioning(!0);const n=`scroll${i[0].toUpperCase()+i.slice(1)}`;this._element.style[i]=`${this._element[n]}px`,this._queueCallback((()=>{this._element.classList.remove(E),this._element.classList.add(w,v),this._element.style[i]="",this.setTransitioning(!1),c.trigger(this._element,L)}),this._element,"true"===this._element.getAttribute("data-bs-animated"))}hide(){if(this._isTransitioning||!this._element.classList.contains(v))return;if(c.trigger(this._element,C).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,o(this._element),this._element.classList.add(E),this._element.classList.remove(w,v);const e=this._triggerArray.length;if(e>0)for(let t=0;t<e;t++){const e=this._triggerArray[t],s=l(e);s&&!s.classList.contains(v)&&(e.classList.add(x),e.setAttribute("aria-expanded",!1))}this.setTransitioning(!0);this._element.style[t]="",this._queueCallback((()=>{this.setTransitioning(!1),this._element.classList.remove(E),this._element.classList.add(w),c.trigger(this._element,$)}),this._element,"true"===this._element.getAttribute("data-bs-animated"))}setTransitioning(t){this._isTransitioning=t}_getConfig(t){return(t={...A,...t}).toggle=Boolean(t.toggle),g(m,t,y),t}_getDimension(){return this._element.classList.contains(D)?D:"height"}_getParent(){let{parent:t}=this._config;t=a(t);const e=`${I}[data-bs-parent="${t}"]`;return d.find(e,t).forEach((t=>{const e=l(t);this._addAriaAndCollapsedClass(e,[t])})),t}_addAriaAndCollapsedClass(t,e){if(!t||!e.length)return;const s=t.classList.contains(v);e.forEach((t=>{s?t.classList.remove(x):t.classList.add(x),t.setAttribute("aria-expanded",s)}))}static collapseInterface(t,e){let s=P.getInstance(t);const i={...A,..._.getDataAttributes(t),..."object"==typeof e&&e?e:{}};if(!s&&i.toggle&&"string"==typeof e&&/show|hide/.test(e)&&(i.toggle=!1),s||(s=new P(t,i)),"string"==typeof e){if(void 0===s[e])throw new TypeError(`No method named "${e}"`);s[e]()}}static jQueryInterface(t){return this.each((function(){P.collapseInterface(this,t)}))}}return c.on(document,T,I,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();const e=_.getDataAttributes(this),s=r(this);d.find(s).forEach((t=>{const s=P.getInstance(t);let i;s?(null===s._parent&&"string"==typeof e.parent&&(s._config.parent=e.parent,s._parent=s._getParent()),i="toggle"):i=e,P.collapseInterface(t,i)}))})),n(P),s.exports=P,s.exports}));
+1
View File
@@ -0,0 +1 @@
__PluginManager__.register("cookie",(function(e,t,r){var n={read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},o=function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e};return r.exports=function e(t,r){function n(e,n,i){if("undefined"!=typeof document){"number"==typeof(i=o({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+c}}var i=Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},o=0;o<r.length;o++){var i=r[o].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(n[u]=t.read(c,u),e===u)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){n(e,"",o({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,o({},this.attributes,t))},withConverter:function(t){return e(o({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}});return i}(n,{path:"/"}),r.exports}));
+23 -13
View File
@@ -33,6 +33,7 @@ kit.config = kit.config || {};
ES: 'ES', // CMAScript2020 or ES11
UMD: 'UMD', // https://github.com/umdjs/umd
HMD: 'HMD', // HandlerMD - function(require, exports, module, global){module.exports = {}; return {};}
default: 'default',
};
/**
* @memberOf kit
@@ -54,7 +55,7 @@ kit.config = kit.config || {};
isSetTimestamp: true,
path: '',
module: '', // file.js
type: 'ES',
type: 'default',
handler: undefined,
onRegister: function(plugin){},
onLoad: function(plugin){},
@@ -190,7 +191,7 @@ kit.config = kit.config || {};
config.autoRequire = config.hasOwnProperty('autoRequire')?!!config.autoRequire:false;
config.loadJsAfterModule = config.hasOwnProperty('loadJsAfterModule')?!!config.loadJsAfterModule:false;
config.isSetTimestamp = config.hasOwnProperty('isSetTimestamp')?!!config.isSetTimestamp:true;
config.type = config.type || 'ES';
config.type = config.type || 'default';
if(typeof config.deps === 'string') {
config.deps = [config.deps];
@@ -321,6 +322,16 @@ kit.config = kit.config || {};
return function (){
return self.getScriptPromise(src);
};
} else if(typeof config.module === 'string' && config.module !== '' && config.type === 'default') {
if (isAssetLoaded(src)) {
self.config.debug && console.warn(`Plugin ${self.id}: Скрипт ${src} уже загружен!`);
return;
}
else {
return function (){
return self.getScriptPromise(src);
};
}
}
return;
};
@@ -420,29 +431,28 @@ kit.config = kit.config || {};
};
var module = self.module;
var exports = self.module.exports;
var installer = function(){
var __exports = undefined;
if(self.config.type === 'ES' && typeof self.config.module === 'string' && self.config.module !== '') {
__exports = (typeof exports === 'object' && exports.default !== undefined)
?exports.default
:exports;
__exports = (typeof self.module.exports === 'object' && self.module.exports.default !== undefined)
?self.module.exports.default
:self.module.exports;
} else if(self.config.type === 'UMD' && typeof self.config.module === 'string' && self.config.module !== '') {
(function(require, exports, module, global){
var self = global;
eval(module.code);
}.bind(global))
.call(global, require, exports, module, global);
__exports = (typeof exports === 'object' && exports.default !== undefined)
?exports.default
:exports;
.call(global, require, self.module.exports, module, global);
__exports = (typeof self.module.exports === 'object' && self.module.exports.default !== undefined)
?self.module.exports.default
:self.module.exports;
} else if(self.config.type === 'HMD' && typeof self.config.handler === 'function') {
__exports = self.config.handler.bind(global)
.call(global, require, exports, module, global);
if(__exports === undefined && exports){
__exports = exports;
.call(global, require, self.module.exports, module, global);
if(__exports === undefined && self.module.exports){
__exports = self.module.exports;
}
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+10 -11
View File
@@ -27,7 +27,7 @@ var __PluginManagerConfigHandler__ = function() {
},
support: {
path: root + '/support',
module: '/support.js',
module: '/support.min.js',
type: 'HMD',
},
jqueryIniter: {
@@ -87,7 +87,6 @@ var __PluginManagerConfigHandler__ = function() {
type: 'UMD',
alias: ['$', 'jQuery'],
onRegister: function (plugin) {
console.log('reg jq');
var initer = kit.require('jqueryIniter');
initer.onRegister(plugin);
},
@@ -105,7 +104,7 @@ var __PluginManagerConfigHandler__ = function() {
},
bsCore: {
path: root + '/bsCore',
module: '/bsCore.js',
module: '/bsCore.min.js',
type: 'HMD',
css: [
'/bsCore.css'
@@ -198,7 +197,7 @@ var __PluginManagerConfigHandler__ = function() {
},
Modal: {
path: root + '/modal',
module: '/modal.js',
module: '/modal.min.js',
type: 'HMD',
css: [
'/modal.css',
@@ -223,7 +222,7 @@ var __PluginManagerConfigHandler__ = function() {
},
collapse: {
path: root + '/collapse',
module: '/collapse.js',
module: '/collapse.min.js',
type: 'HMD',
css: [
'/collapse.css',
@@ -241,7 +240,7 @@ var __PluginManagerConfigHandler__ = function() {
},
cookie: {
path: root + '/cookie',
module: '/cookie.js',
module: '/cookie.min.js',
type: 'HMD',
},
animations: {
@@ -258,7 +257,7 @@ var __PluginManagerConfigHandler__ = function() {
},
dataStructures: {
path: root + '/dataStructures',
module: '/dataStructures.js',
module: '/dataStructures.min.js',
type: 'HMD',
},
userAction: {
@@ -382,7 +381,7 @@ var __PluginManagerConfigHandler__ = function() {
css: [
'/jquery.bxslider.min.css',
],
type: 'import',
type: 'default',
deps: ['jQuery'],
},
selectric: {
@@ -391,7 +390,7 @@ var __PluginManagerConfigHandler__ = function() {
css: [
'/selectric.css',
],
type: 'import',
type: 'UMD',
alias: ['jquerySelectric'],
deps: ['jQuery'],
},
@@ -401,7 +400,7 @@ var __PluginManagerConfigHandler__ = function() {
css: [
'/jBox.min.css',
],
type: 'import',
type: 'UMD',
deps: ['jQuery'],
},
intlTelInput: {
@@ -410,7 +409,7 @@ var __PluginManagerConfigHandler__ = function() {
css: [
'/css/intlTelInput.min.css',
],
type: 'import',
type: 'UMD',
alias: ['intl-tel-input'],
},
autoComplete: {
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
__PluginManager__.register("dataStructures",function(t,e,i,o){function n(t,e,i=1e3){this.context=t||window,this.callback=e,this.interval=i}n.prototype.start=function(){this.intervalId=setInterval(function(){this.callback.apply(this.context,arguments)}.bind(this),this.interval)},n.prototype.stop=function(){this.intervalId&&clearInterval(this.intervalId)};const s={StackExecutionLimiter:(r=function(t,e,i=1e3){this.counter=0,this.timerId=0,this.timeout=0,this.arguments=null,this.context=null,this.executeBeforeTimeout=!1,this.setContext(t),this.setCallback(e),this.setTimeout(i)},r.prototype.setCallback=function(t){this.callback=t},r.prototype.setContext=function(t){this.context=t||window},r.prototype.setTimeout=function(t){this.timeout=t},r.prototype.exec=function(){this.arguments=arguments,this.counter++,0===this.timerId&&(this.executeBeforeTimeout?this.__execBeforeTimeout(this.counter):this.__execAfterDelay())},r.prototype.__execBeforeTimeout=function(t){this.timerId=setTimeout(function(){if(this.counter>t)return this.__execBeforeTimeout(this.counter),null;this.timerId=0}.bind(this),this.timeout),this.callback.apply(this.context,this.arguments)},r.prototype.__execAfterDelay=function(){this.timerId=setTimeout(function(){this.callback.apply(this.context,this.arguments),this.timerId=0}.bind(this),this.timeout)},r.prototype.reset=function(){clearTimeout(this.timerId),this.timerId=0,this.counter=0},r),Interval:n};var r;return i.exports=s});
File diff suppressed because one or more lines are too long
+1 -4
View File
@@ -1,6 +1,4 @@
/** @module jBox */
__PluginManager__.register('jBox', function(require, exports, module, global){
/**
* jBox is a jQuery plugin that makes it easy to create customizable tooltips, modal windows, image galleries and more.
@@ -2329,5 +2327,4 @@ function jBoxWrapper(jQuery) {
return jBox;
}));
//# sourceMappingURL=jBox.js.map
});
//# sourceMappingURL=jBox.js.map
-3
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long