mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -100,7 +100,7 @@ kit.PluginManager.register('Viewer', function(module, exports, require, global)
|
||||
|
||||
this.__aminationTrapHide = new AnimationTrap(this.node, function (options) {
|
||||
if(options.onHideBefore !== false) {
|
||||
this.onHideBefore.eachCall(window, options);
|
||||
this.onHideBefore.eachCall(this.node, options);
|
||||
}
|
||||
removeAnimation.call(this, this.animShowClass);
|
||||
addAnimation.call(this, this.animHideClass);
|
||||
@@ -111,14 +111,14 @@ kit.PluginManager.register('Viewer', function(module, exports, require, global)
|
||||
this.node.classList.add('hide');
|
||||
this.node.classList.remove('show');
|
||||
if(options.onHide !== false) {
|
||||
this.onHide.eachCall(window, options);
|
||||
this.onHide.eachCall(this.node, options);
|
||||
}
|
||||
this.node.style.display = 'none';
|
||||
}.bind(this));
|
||||
|
||||
this.__aminationTrapShow = new AnimationTrap(this.node, function (options = {}) {
|
||||
if(options.onShowBefore !== false) {
|
||||
this.onShowBefore.eachCall(window, options);
|
||||
this.onShowBefore.eachCall(this.node, options);
|
||||
}
|
||||
this.node.classList.remove('hide');
|
||||
this.node.classList.add('show');
|
||||
@@ -132,7 +132,7 @@ kit.PluginManager.register('Viewer', function(module, exports, require, global)
|
||||
removeAnimation.call(this, this.animHideClass);
|
||||
addAnimation.call(this, this.animShowClass);
|
||||
if(options.onShow !== false) {
|
||||
this.onShow.eachCall(window, options);
|
||||
this.onShow.eachCall(this.node, options);
|
||||
}
|
||||
}.bind(this), function (options = {}) {
|
||||
|
||||
|
||||
+49
-20
@@ -27,6 +27,10 @@ kit.PluginManager.register('align',function(module, exports, require) {
|
||||
}
|
||||
var metrics = {};
|
||||
if(this.node instanceof HTMLElement) {
|
||||
|
||||
var pr = getBoundingClientRect(this.node.offsetParent);
|
||||
var nr = getBoundingClientRect(this.node);
|
||||
|
||||
metrics = {
|
||||
offsetHeight: this.node.offsetHeight,
|
||||
offsetWidth: this.node.offsetWidth,
|
||||
@@ -36,39 +40,39 @@ kit.PluginManager.register('align',function(module, exports, require) {
|
||||
offsetTop: this.node.offsetTop,
|
||||
clientLeft: this.node.clientLeft,
|
||||
clientTop: this.node.clientTop,
|
||||
clientRight: this.node.offsetWidth - this.node.clientWidth,
|
||||
clientBottom: this.node.offsetHeight - this.node.clientHeight,
|
||||
clientRight: this.node.offsetWidth - this.node.clientWidth - this.node.clientLeft,
|
||||
clientBottom: this.node.offsetHeight - this.node.clientHeight - this.node.clientTop,
|
||||
|
||||
offsetRight: document.body.offsetWidth - this.node.offsetLeft - this.node.offsetWidth,
|
||||
offsetBottom: window.innerHeight - this.node.offsetTop - this.node.offsetHeight,
|
||||
offsetRight: pr.right - nr.right,
|
||||
offsetBottom: pr.bottom - nr.bottom,
|
||||
};
|
||||
metrics = Object.assign({}, getBoundingClientRect(this.node), metrics);
|
||||
metrics = Object.assign({}, nr, metrics);
|
||||
}
|
||||
if(this.node instanceof Window) {
|
||||
metrics = {
|
||||
offsetHeight: window.innerHeight,
|
||||
offsetWidth: document.body.offsetWidth,
|
||||
clientHeight: window.innerHeight,
|
||||
offsetWidth: window.innerWidth,
|
||||
clientHeight: document.body.offsetHeight,
|
||||
clientWidth: document.body.offsetWidth,
|
||||
offsetLeft: 0,
|
||||
offsetTop: 0,
|
||||
offsetLeft: window.pageXOffset,
|
||||
offsetTop: window.pageYOffset,
|
||||
clientLeft: 0,
|
||||
clientTop: 0,
|
||||
clientRight: 0,
|
||||
clientBottom: 0,
|
||||
clientRight: window.innerWidth - document.body.offsetWidth,
|
||||
clientBottom: window.innerHeight - document.body.offsetHeight,
|
||||
|
||||
offsetRight: 0,
|
||||
offsetBottom: 0,
|
||||
offsetRight: document.body.scrollWidth - document.body.offsetWidth - window.pageXOffset,
|
||||
offsetBottom: document.body.scrollHeight - document.body.offsetHeight - window.pageYOffset,
|
||||
};
|
||||
metrics = Object.assign({
|
||||
left: 0,
|
||||
top: 0,
|
||||
right: document.body.offsetWidth,
|
||||
bottom: window.innerHeight,
|
||||
bottom: document.body.offsetHeight,
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: document.body.offsetWidth,
|
||||
height: window.innerHeight,
|
||||
height: document.body.offsetHeight,
|
||||
}, metrics)
|
||||
}
|
||||
Object.assign(this, metrics);
|
||||
@@ -173,7 +177,7 @@ kit.PluginManager.register('align',function(module, exports, require) {
|
||||
|
||||
this.style = {
|
||||
start: function (extra) {
|
||||
this.nodeMetricsLine.node.style[this.map.style.start()] = '' + ((!this.valid && extra)?this.shiftExtra:this.shift) + 'px';
|
||||
this.nodeMetricsLine.node.style[this.map.style.start()] = '' + (extra?this.shiftExtra:this.shift) + 'px';
|
||||
}.bind(this),
|
||||
end: function (extra) {
|
||||
this.nodeMetricsLine.node.style[this.map.style.end()] = 'unset';
|
||||
@@ -233,7 +237,7 @@ kit.PluginManager.register('align',function(module, exports, require) {
|
||||
};
|
||||
|
||||
var getShiftWhenHidingNodeUnderLimiterStart = function(shift) {
|
||||
var d = this.parentMetricsLine.start + shift - this.limiterMetricsLine.start;
|
||||
var d = this.parentMetricsLine.start + shift - Math.min(this.limiterMetricsLine.start, this.parentMetricsLine.end);
|
||||
if(d < 0) {
|
||||
shift = shift - d;
|
||||
}
|
||||
@@ -253,7 +257,13 @@ kit.PluginManager.register('align',function(module, exports, require) {
|
||||
return (this.parentMetricsLine.start + this.shift) >= this.limiterMetricsLine.start;
|
||||
}.bind(this),
|
||||
shiftExtra: function () {
|
||||
return getShiftWhenHidingNodeUnderLimiterStart(this.shift - this.applicability);
|
||||
var shift = getShiftWhenHidingNodeUnderLimiterStart(this.shift);
|
||||
var applicability = 0;
|
||||
if(!this.valid) {
|
||||
applicability = (this.parentMetricsLine.start + shift) - this.limiterMetricsLine.start;
|
||||
shift = getShiftWhenHidingNodeUnderLimiterStart(shift - applicability);
|
||||
}
|
||||
return shift;
|
||||
}.bind(this),
|
||||
},
|
||||
end: {
|
||||
@@ -267,7 +277,13 @@ kit.PluginManager.register('align',function(module, exports, require) {
|
||||
return this.limiterMetricsLine.end >= (this.parentMetricsLine.start + this.nodeMetricsLine.length + this.shift);
|
||||
}.bind(this),
|
||||
shiftExtra: function () {
|
||||
return getShiftWhenHidingNodeUnderLimiterStart(this.shift + this.applicability);
|
||||
var shift = getShiftWhenHidingNodeUnderLimiterStart(this.shift);
|
||||
var applicability = 0;
|
||||
if(!this.valid) {
|
||||
applicability = this.limiterMetricsLine.end - (this.parentMetricsLine.start + this.nodeMetricsLine.length + shift);
|
||||
shift = getShiftWhenHidingNodeUnderLimiterStart(shift + applicability);
|
||||
}
|
||||
return shift;
|
||||
}.bind(this),
|
||||
},
|
||||
/**
|
||||
@@ -284,7 +300,13 @@ kit.PluginManager.register('align',function(module, exports, require) {
|
||||
return this.limiterMetricsLine.end >= (this.parentMetricsLine.start + this.nodeMetricsLine.length + this.shift);
|
||||
}.bind(this),
|
||||
shiftExtra: function () {
|
||||
return getShiftWhenHidingNodeUnderLimiterStart(this.shift + this.applicability);
|
||||
var shift = getShiftWhenHidingNodeUnderLimiterStart(this.shift);
|
||||
var applicability = 0;
|
||||
if(!this.valid) {
|
||||
applicability = this.limiterMetricsLine.end - (this.parentMetricsLine.start + this.nodeMetricsLine.length + shift);
|
||||
shift = getShiftWhenHidingNodeUnderLimiterStart(shift + applicability);
|
||||
}
|
||||
return shift;
|
||||
}.bind(this),
|
||||
},
|
||||
},
|
||||
@@ -569,6 +591,13 @@ kit.PluginManager.register('align',function(module, exports, require) {
|
||||
if(!['absolute', 'relative'].includes(this.__nodeComputedStyle.position)) {
|
||||
this.node.style.position = 'absolute';
|
||||
}
|
||||
|
||||
if(!this.__parentNodeComputedStyle) {
|
||||
this.__parentNodeComputedStyle = getComputedStyle(this.parentNode);
|
||||
}
|
||||
if(!['absolute', 'relative', 'fixed'].includes(this.__parentNodeComputedStyle.position)) {
|
||||
this.parentNode.style.position = 'relative';
|
||||
}
|
||||
};
|
||||
|
||||
AlignClass.prototype.setEx = function(axis, align, direction){
|
||||
|
||||
@@ -42,4 +42,59 @@
|
||||
transform: scale(0.5);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.anim-fade-in {
|
||||
-webkit-animation: fade-in 0.15s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||
animation: fade-in 0.15s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||
}
|
||||
@-webkit-keyframes fade-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes fade-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.anim-fade-in-top {
|
||||
-webkit-animation: fade-in-top 0.15s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||
animation: fade-in-top 0.15s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
|
||||
}
|
||||
@-webkit-keyframes fade-in-top {
|
||||
0% {
|
||||
-webkit-transform: translateY(-50px);
|
||||
transform: translateY(-50px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes fade-in-top {
|
||||
0% {
|
||||
-webkit-transform: translateY(-50px);
|
||||
transform: translateY(-50px);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: translateY(0);
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.anim-fade-out {
|
||||
-webkit-animation: fade-out 0.15s ease-out both;
|
||||
animation: fade-out 0.15s ease-out both;
|
||||
}
|
||||
@-webkit-keyframes fade-out{0%{opacity:1}100%{opacity:0}}@keyframes fade-out{0%{opacity:1}100%{opacity:0}}
|
||||
.anim-fade-out-top{-webkit-animation:fade-out-top .15s cubic-bezier(.25,.46,.45,.94) both;animation:fade-out-top .15s cubic-bezier(.25,.46,.45,.94) both}
|
||||
@-webkit-keyframes fade-out-top{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform:translateY(-50px);transform:translateY(-50px);opacity:0}}@keyframes fade-out-top{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}100%{-webkit-transform:translateY(-50px);transform:translateY(-50px);opacity:0}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* https://animista.net/
|
||||
* @link https://animista.net/
|
||||
* @module animations
|
||||
**/
|
||||
kit.PluginManager.register('animations',function(module, exports, require, global) {
|
||||
@@ -10,9 +10,13 @@ kit.PluginManager.register('animations',function(module, exports, require, globa
|
||||
var animations = {
|
||||
scaleIn: 'anim-scale-in',
|
||||
scaleOut: 'anim-scale-out',
|
||||
fadeIn: 'anim-fade-in',
|
||||
fadeInTop: 'anim-fade-in-top',
|
||||
fadeOut: 'anim-fade-out',
|
||||
fadeOutTop: 'anim-fade-out-top',
|
||||
};
|
||||
|
||||
Object.assign(animations, global.animations || {});
|
||||
//Object.assign(animations, global.animations || {});
|
||||
|
||||
return module.exports = animations;
|
||||
});
|
||||
|
||||
@@ -77,6 +77,16 @@ __PluginManager__.registerPlugins({
|
||||
},
|
||||
deps: ['popper', 'bsCore'],
|
||||
},
|
||||
Tooltip2: {
|
||||
path: __pmConfig__.assetsPath + '/tooltip2',
|
||||
module: '/tooltip2.js',
|
||||
type: 'loader',
|
||||
css: '/tooltip2.css',
|
||||
onInstall: function(){
|
||||
|
||||
},
|
||||
deps: ['Viewer', 'support', 'ActionCollection', 'Action', 'userAction', 'align'],
|
||||
},
|
||||
Popover: {
|
||||
path: __pmConfig__.assetsPath + '/popover',
|
||||
module: '/popover.js',
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* @property {kitToolkit} toolkit
|
||||
* @property {kitModal} Modal
|
||||
* @property {kitConfig} config
|
||||
* @property {kitTooltip} tooltip
|
||||
* @property {kitPopover} Popover
|
||||
* @property {kitPopper} popper
|
||||
*/
|
||||
|
||||
@@ -11,6 +11,7 @@ __PluginManager__.register('dataStructures', function(module, exports, require,
|
||||
this.timeout = 0;
|
||||
this.arguments = null;
|
||||
this.context = null;
|
||||
this.executeBeforeTimeout = false;
|
||||
this.setContext(context);
|
||||
this.setCallback(callback);
|
||||
this.setTimeout(timeout);
|
||||
@@ -29,22 +30,33 @@ __PluginManager__.register('dataStructures', function(module, exports, require,
|
||||
this.counter++;
|
||||
|
||||
if(this.timerId === 0) {
|
||||
this.__exec(this.counter);
|
||||
if(this.executeBeforeTimeout) {
|
||||
this.__execBeforeTimeout(this.counter);
|
||||
} else {
|
||||
this.__execAfterDelay();
|
||||
}
|
||||
}
|
||||
};
|
||||
stack.prototype.__exec = function (counter) {
|
||||
stack.prototype.__execBeforeTimeout = function (counter) {
|
||||
this.timerId = setTimeout((function(){
|
||||
if(this.counter > counter) {
|
||||
this.__exec(this.counter);
|
||||
this.__execBeforeTimeout(this.counter);
|
||||
return null;
|
||||
}
|
||||
this.timerId = 0;
|
||||
}).bind(this), this.timeout);
|
||||
this.callback.apply(this.context, this.arguments);
|
||||
};
|
||||
stack.prototype.__execAfterDelay = function () {
|
||||
this.timerId = setTimeout((function(){
|
||||
this.callback.apply(this.context, this.arguments);
|
||||
this.timerId = 0;
|
||||
}).bind(this), this.timeout);
|
||||
};
|
||||
stack.prototype.reset = function () {
|
||||
clearTimeout(this.timerId);
|
||||
this.timerId = 0;
|
||||
this.counter = 0;
|
||||
};
|
||||
return stack;
|
||||
})()
|
||||
|
||||
@@ -85,12 +85,16 @@ __PluginManager__.register('loggerService', function(module, exports, require, g
|
||||
|
||||
function setObjectValue(log, lvl, key, value, opClass, depth = 3, openDepth = 1, isRoot = true) {
|
||||
var rowChild, isObj = support.isObject(value), id = isObj?support.uniqueId():'',
|
||||
val = (isObj&&depth)?'<label for="'+id+'">'+value+'</label>':value, inp, j,
|
||||
valueString = ((isObj && typeof value.toString !== 'function') || typeof value === 'symbol')?(typeof value):value,
|
||||
val = (isObj&&depth)?'<label for="'+id+'">'+valueString+'</label>':valueString, inp, j,
|
||||
len = isObj?Object.keys(value).length:0;
|
||||
|
||||
if(!isRoot || (isRoot && !isObj)) {
|
||||
log.appendChild(getRowNode(lvl, key, '' + val + (isObj?(' ['+len+']'):''), opClass));
|
||||
}
|
||||
if(value === window || value === document) {
|
||||
return;
|
||||
}
|
||||
if(isObj&&depth) {
|
||||
!isRoot && ++lvl;
|
||||
depth = Math.max(0, depth - 1);
|
||||
|
||||
+5
-1
@@ -761,14 +761,18 @@ __PluginManager__.register('menu',function(module, exports, require, global) {
|
||||
);
|
||||
};
|
||||
|
||||
var reCalcAllMenuLimiter = new dataStructures.StackExecutionLimiter(this, reCalcAllMenu, 250);
|
||||
var reCalcAllMenuLimiter = new dataStructures.StackExecutionLimiter(this, reCalcAllMenu, 100);
|
||||
var globalHandlers = {
|
||||
resize: function(){
|
||||
reCalcAllMenuLimiter.exec();
|
||||
},
|
||||
scroll: function(){
|
||||
reCalcAllMenuLimiter.exec();
|
||||
},
|
||||
};
|
||||
|
||||
window.addEventListener('resize', globalHandlers.resize);
|
||||
window.addEventListener('scroll', globalHandlers.scroll);
|
||||
|
||||
/**
|
||||
* @memberOf kit
|
||||
|
||||
@@ -106,13 +106,17 @@
|
||||
margin-bottom: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.modal-body:empty {
|
||||
display: none;
|
||||
}
|
||||
.modal-body {
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.modal-footer:empty {
|
||||
display: none;
|
||||
}
|
||||
.modal-footer {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -131,9 +131,12 @@ __PluginManager__.register('support', function(module, exports, require, global)
|
||||
if(isNode(html)) {
|
||||
return html;
|
||||
}
|
||||
if(isString(html)) {
|
||||
html = html.trim();
|
||||
}
|
||||
var nodeWrap = document.createElement('div');
|
||||
nodeWrap.innerHTML = html;
|
||||
var r = nodeWrap.firstElementChild;
|
||||
var r = nodeWrap.firstChild;
|
||||
r.remove();
|
||||
return r;
|
||||
}
|
||||
@@ -141,8 +144,15 @@ __PluginManager__.register('support', function(module, exports, require, global)
|
||||
if(isNodeList(html)) {
|
||||
return html;
|
||||
}
|
||||
if(isString(html)) {
|
||||
html = html.trim();
|
||||
}
|
||||
var nodeWrap = document.createElement('div');
|
||||
nodeWrap.innerHTML = html;
|
||||
if(isNode(html)) {
|
||||
nodeWrap.append(html);
|
||||
} else {
|
||||
nodeWrap.innerHTML = html;
|
||||
}
|
||||
return nodeWrap.childNodes;
|
||||
}
|
||||
function setNodeData(node, key, value) {
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
}
|
||||
|
||||
.tooltip-inner {
|
||||
width: max-content;
|
||||
max-width: 200px;
|
||||
padding: 0.25rem 0.5rem;
|
||||
color: var(--popper-color);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
kit.PluginManager.register('tooltip',function(module, exports, require){
|
||||
/** @module Tooltip */
|
||||
kit.PluginManager.register('Tooltip',function(module, exports, require){
|
||||
|
||||
var Popper = require('popper');
|
||||
|
||||
@@ -115,7 +116,7 @@ kit.PluginManager.register('tooltip',function(module, exports, require){
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** @class kitTooltip */
|
||||
/** @memberOf kit */
|
||||
class Tooltip extends BaseComponent {
|
||||
constructor(element, config) {
|
||||
if (typeof Popper === 'undefined') {
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/** @module Tooltip2 */
|
||||
kit.PluginManager.register('Tooltip2',function(module, exports, require, global){
|
||||
|
||||
var Viewer = require('Viewer');
|
||||
var support = require('support');
|
||||
var ActionCollection = require('ActionCollection');
|
||||
var Action = require('Action');
|
||||
var userAction = require('userAction');
|
||||
var align = require('align');
|
||||
var animations = require('animations');
|
||||
|
||||
const PLUGIN_NAME = 'tooltip2';
|
||||
|
||||
const Default = {
|
||||
template: '<div class="tooltip" role="tooltip" style="display: none">' +
|
||||
//'<div class="tooltip-arrow" data-popper-arrow="true"></div>' +
|
||||
'<div class="tooltip-inner"></div>' +
|
||||
'</div>',
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf kit
|
||||
* @param masterNode
|
||||
* @param hintNode
|
||||
* @constructor
|
||||
*/
|
||||
var Tooltip2 = function(masterNode, hintNode) {
|
||||
var self = this;
|
||||
this.masterNode = support.getNode(masterNode);
|
||||
this.hintNode = support.getNode(hintNode);
|
||||
if(!this.hintNode) {
|
||||
this.hintNode = support.makeNode(Default.template);
|
||||
}
|
||||
this.hintNode.remove();
|
||||
this.masterNode.appendChild(this.hintNode);
|
||||
support.setNodeData(this.masterNode, PLUGIN_NAME, this);
|
||||
|
||||
this.align = new align.Class(this.hintNode, this.masterNode);
|
||||
this.align.offset = [0, 10];
|
||||
var hint = new userAction.Hint(this.masterNode, this.hintNode);
|
||||
this.viewer = hint.viewer;
|
||||
this.viewer.delayHide = 400;
|
||||
this.viewer.animShowClass = animations.fadeIn;
|
||||
this.viewer.animHideClass = animations.fadeOut;
|
||||
this.viewer.onShow.push(function () {
|
||||
self.render();
|
||||
});
|
||||
this.action = new ActionCollection([
|
||||
hint
|
||||
]);
|
||||
};
|
||||
|
||||
var __proto = Tooltip2.prototype;
|
||||
|
||||
__proto.setContent = function(html = ''){
|
||||
var titleNode = this.hintNode.querySelector('.tooltip-inner');
|
||||
support.innerHtml(titleNode, html);
|
||||
};
|
||||
|
||||
__proto.run = function(){
|
||||
this.action.run();
|
||||
};
|
||||
__proto.stop = function(){
|
||||
this.action.stop();
|
||||
};
|
||||
__proto.unset = function(){
|
||||
this.viewer.hide();
|
||||
this.stop();
|
||||
support.setNodeData(this.masterNode, PLUGIN_NAME, null);
|
||||
};
|
||||
__proto.render = function(){
|
||||
this.align.set('center', 'top', 'center', 'top');
|
||||
};
|
||||
|
||||
module.exports = Tooltip2;
|
||||
|
||||
return module.exports;
|
||||
});
|
||||
+4
-8
@@ -3,7 +3,7 @@
|
||||
use \Wt\Core\Templater\Tools as TemplaterTools;
|
||||
|
||||
?>
|
||||
<div class="modal fade <?=$arParams['WRAP_CLASS']?>" id="<?=$arParams['ID']?>" tabindex="-1" aria-labelledby="<?=$arParams['ID']?>" aria-hidden="true" <?=TemplaterTools::getAttrByArray($arParams['ATTR'])?>>
|
||||
<div class="modal fade <?=$arParams['WRAP_CLASS']?> <?=$arParams['CLASS']?>" id="<?=$arParams['ID']?>" tabindex="-1" aria-labelledby="<?=$arParams['ID']?>" aria-hidden="true" <?=TemplaterTools::getAttrByArray($arParams['ATTR'])?>>
|
||||
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -13,12 +13,8 @@ use \Wt\Core\Templater\Tools as TemplaterTools;
|
||||
</button>
|
||||
<?=$arParams['HEADER']?>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?=$arParams['BODY']?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<?=$arParams['FOOTER']?>
|
||||
</div>
|
||||
<div class="modal-body"><?=$arParams['BODY']?></div>
|
||||
<div class="modal-footer"><?=$arParams['FOOTER']?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -10,21 +10,21 @@
|
||||
<path
|
||||
style="stroke-width:2.68179"
|
||||
d="m 322.51429,5.8498896 c -4.60665,0 -8.34579,3.7391824 -8.34579,8.3459344 0,4.60675 3.7391,8.345933 8.34579,8.345933 92.04139,0 166.92272,74.882573 166.92272,166.925503 0,4.60673 3.73909,8.34594 8.34579,8.34594 4.61547,0 8.3458,-3.73916 8.3458,-8.34594 0,-101.247609 -82.36739,-183.6173704 -183.61431,-183.6173704 z"
|
||||
id="path10" />
|
||||
id="path10"></path>
|
||||
<path
|
||||
style="stroke-width:2.68179"
|
||||
d="M 322.2304,1.9527213e-4 C 314.55382,-0.04298171 307.82251,7.080711 308.33272,14.745677 c 0.0974,7.458867 6.93518,13.919695 14.38059,13.652639 13.43025,0.373605 24.71175,1.638057 36.46344,4.208957 37.50774,8.656542 71.45449,31.434371 93.91114,62.667685 13.32108,18.369972 22.68402,39.596582 27.22588,61.831772 2.22987,11.35091 3.21676,23.73529 3.33651,33.79512 0.59537,7.46541 7.86183,13.52147 15.31542,12.71244 7.36826,-0.4392 13.47819,-7.39857 13.00895,-14.75728 C 511.94785,151.83182 500.67534,114.92557 479.98651,84.218348 456.48018,49.028034 420.93456,22.025452 380.6067,9.1176343 361.78849,3.0193622 342.00783,-0.02369972 322.2304,1.9527213e-4 Z"
|
||||
id="path12" />
|
||||
id="path12"></path>
|
||||
<path
|
||||
style="stroke-width:2.68179"
|
||||
d="m 322.21991,50.572441 c -7.31068,-0.03138 -13.73855,6.659739 -13.40887,13.96432 -0.0376,7.203773 6.43912,13.581009 13.63934,13.445765 27.74689,-0.141333 55.31866,10.678284 75.61603,29.586974 21.1499,19.36034 34.34929,47.13986 35.76041,75.79968 0.30894,4.55553 -0.4577,9.54918 2.35289,13.51962 3.77186,6.18806 12.71179,8.20106 18.76397,4.21461 4.72172,-2.79633 7.04079,-8.49735 6.44582,-13.84492 -0.3699,-31.8522 -12.28233,-63.37121 -32.9784,-87.574618 -21.93864,-26.017201 -53.71776,-43.54196 -87.49754,-47.896593 -6.19357,-0.831017 -12.44551,-1.225887 -18.69365,-1.214838 z"
|
||||
id="path14" />
|
||||
id="path14"></path>
|
||||
<path
|
||||
style="stroke-width:2.68179"
|
||||
d="m 322.25134,100.64705 c -7.32027,-0.0448 -13.76483,6.65155 -13.4403,13.96432 -0.0453,7.21125 6.43899,13.57841 13.63934,13.45102 19.83997,-0.18933 39.31969,10.10387 50.50989,26.45619 7.36632,10.47117 11.14573,23.2862 11.00857,36.06375 0.40606,7.31344 7.4931,13.32948 14.77598,12.54484 7.13205,-0.40541 13.05287,-7.13761 12.58525,-14.25969 -0.011,-24.28028 -10.68138,-48.25272 -28.58824,-64.62644 -16.24744,-15.13561 -38.27616,-23.7645 -60.49049,-23.59399 z"
|
||||
id="path16" />
|
||||
id="path16"></path>
|
||||
<path
|
||||
style="stroke-width:2.68179"
|
||||
d="M 59.678285,0.54495347 C 41.692391,1.23984 24.227245,10.156814 13.244354,24.437804 2.7279853,37.61391 -1.799523,55.196007 0.65078892,71.84078 9.3419409,148.91489 36.584198,223.78936 79.274319,288.5357 c 38.954351,60.03543 91.314001,111.27301 152.055141,149.09912 64.11073,40.57653 137.64134,66.21622 213.10118,74.17023 18.80069,1.53902 38.03825,-6.11504 50.68468,-20.10216 10.96572,-11.80794 16.88468,-27.99986 16.36884,-44.0869 -0.0375,-24.96909 0.0748,-49.94167 -0.0558,-74.90856 -0.69998,-20.00518 -11.87598,-39.21441 -28.82859,-49.82672 -29.49382,-8.75915 -64.55903,-15.83833 -92.49745,-26.19884 -19.35274,-6.55776 -41.78585,-2.738 -57.88138,9.84817 -10.72223,9.46496 -19.7844,19.01817 -29.15585,28.373 -52.03227,-37.26328 -95.11309,-84.38713 -125.02712,-123.7373 -0.50512,-1.21211 -2.51762,-2.63848 -0.66422,-3.58013 8.25625,-8.34842 16.74001,-16.47932 24.85084,-24.96694 13.90125,-15.46477 19.12806,-38.14579 13.35325,-58.12766 C 207.0735,100.90579 200.36383,74.3419 197.29958,52.083164 194.07174,32.678395 180.88459,15.389046 163.19289,6.8695175 153.44469,2.0151543 142.45354,0.08255393 131.61586,0.48734803 107.63694,0.52569798 83.65601,0.41037977 59.678257,0.54500714 Z M 135.44367,27.907892 c 14.03097,-0.313907 27.65565,8.736272 32.81283,21.785234 2.73534,6.64759 2.69192,13.966761 4.16352,20.923698 3.52037,20.55106 9.16679,40.705746 16.4447,60.235176 4.09993,12.55121 0.18826,27.18159 -9.55651,36.07573 -10.21944,10.26551 -20.58112,20.39982 -30.71228,30.74676 -3.99341,4.69405 -4.02243,11.93451 -0.46456,16.88512 33.23928,57.95425 81.23632,107.31327 138.17244,142.25656 4.78301,2.77722 9.39039,5.94482 14.43567,8.22069 5.49904,2.04036 11.86015,-0.10856 15.51295,-4.56821 10.4618,-10.34743 20.74506,-20.88251 31.31861,-31.11255 9.75514,-8.50588 24.31033,-10.77299 36.23789,-5.79856 23.15467,8.56639 47.2965,14.35764 71.76119,17.59962 13.41386,2.34254 24.78841,13.25675 27.64217,26.57453 1.83567,27.93302 4.9892,58.6076 0.79001,83.92516 -0.60695,14.02657 -10.63948,26.95929 -24.0069,31.17609 -25.98593,4.11172 -56.17991,-4.40298 -78.66625,-10.12951 C 273.00654,441.75192 180.47224,380.9596 117.82254,296.06199 89.746619,252.17073 64.922631,210.98767 50.234517,167.66264 35.419637,119.78883 23.362881,78.882249 28.903109,52.672226 32.80697,39.421377 45.200637,29.199403 58.998936,28.084973 84.499569,27.730945 108.91373,27.907972 135.44374,27.907972 Z"
|
||||
id="path18" />
|
||||
id="path18"></path>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,5 @@
|
||||
<svg width="24" height="24" version="1.1" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m268 61.1c0.337 0 0.665-2e-3 1-2e-3 48.7 0 94.4 18.8 129 53.1 34.6 34.6 53.5 80.6 53.2 130-0.052 11 8.86 20 19.9 20.1h0.097c11 0 19.9-8.89 20-19.9 0.285-59.8-22.8-116-64.9-158-41.8-41.8-97.5-64.8-157-64.8-0.365 0-0.733 1e-3 -1.1 2e-3 -11 0.053-20 9.05-19.9 20.1 0.053 11 9 19.9 20 19.9z"></path>
|
||||
<path d="m202 405c-21.8-14.3-39.4-29.5-79.9-70.1s-81.3-124-81.6-196c-0.186-37.3 11-68.4 29.1-85.8s40.1-16.6 53.6-2.55c51.8 53.7 48 79 25.2 103l-37.1 37.4c-5.81 5.86-7.43 14.7-4.08 22.2 0.941 2.11 23.7 52.4 81.7 110s108 80.8 110 81.7c7.54 3.36 16.4 1.74 22.2-4.08l37.3-37.1c23.5-22.9 48.8-26.6 103 25.1 14.1 13.6 14.9 35.6-2.46 53.5s-48.1 29.2-81.7 29.1-67.8-8.15-103-23.3c-33-15.7-48.1-28.3-72.4-43.3zm56.6 80.1c40.6 17.5 79 26.5 114 26.6 0.375 1e-3 0.748 2e-3 1.12 2e-3 47.9-1e-3 88.6-15.4 110-38s28.7-41.6 28-61.4c-0.714-19.8-8.96-38.3-23.2-52-27.9-26.9-51.3-42.5-73.6-48.9-30.8-8.89-59.2-0.805-72 11.7-0.038 0.037-39.8 39.3-39.8 39.3-16.8-9.44-49.5-30.2-86.4-67.2s-57.9-69.8-67.4-86.7l26.8-27c0.038-0.038 0.075-0.076 0.113-0.115 24.8-25.4 32.9-53.9 24-84.6-6.45-22.3-22-45.7-48.9-73.6-13.8-14.3-32.2-22.5-52-23.2-19.8-0.713-38.8 6.18-61.6 28.1s-38.1 63-37.9 111c0.41 82.2 45.3 178 90.1 223 35.1 36.5 56.9 55.8 78.8 70.6 34.7 24 89.2 52.5 89.2 52.5z"></path>
|
||||
<path d="m369 143c-21.5-21.5-42-27.1-51.9-29.9-10.6-2.94-21.7 3.3-24.6 13.9-2.94 10.6 3.3 21.7 13.9 24.6 8.09 2.24 20.3 5.62 34.3 19.6 13.5 13.5 17.1 25.6 19.7 34.5s10.6 14.5 23 12.5 18.5-13.1 15.3-24.1-8.99-30.5-29.7-51.2z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -39,7 +39,7 @@ $items = array_fill(0, 40, [
|
||||
'id' => 1,
|
||||
'name' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit Ab accusamus aliquid, consequuntur corporis ducimus',
|
||||
'hover' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit Ab accusamus aliquid, consequuntur corporis ducimus',
|
||||
'picture' => app()->service()->templater()->get('kit:svg/shop/cardPictureEmpty'),
|
||||
'picture' => '<img src="https://picsum.photos/200/200">',
|
||||
'text_preview' => 'asdas asdas dasdasd',
|
||||
'tickets' => [
|
||||
[
|
||||
@@ -52,7 +52,9 @@ $items = array_fill(0, 40, [
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
/**
|
||||
* @todo card list
|
||||
*/
|
||||
?>
|
||||
<div class="kit-wrapper">
|
||||
<section class="section-product-list">
|
||||
|
||||
+6
-3
@@ -14,7 +14,7 @@ if(\Bitrix\Main\Loader::includeModule('wt.core')) {
|
||||
}
|
||||
$APPLICATION->ShowHead();
|
||||
?>
|
||||
|
||||
<div style="width: 2000px; height: 1000px"></div>
|
||||
<style type="text/css">
|
||||
.chat-message {
|
||||
border: 1px solid;
|
||||
@@ -103,12 +103,13 @@ $APPLICATION->ShowHead();
|
||||
|
||||
|
||||
</div>
|
||||
<div class="kit-logger"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
kit.ready(['menu', 'animations'], function () {
|
||||
|
||||
|
||||
console.log(new kit.align.metric.Rect(window));
|
||||
|
||||
console.log('menu init');
|
||||
/**
|
||||
@@ -307,7 +308,9 @@ kit.ready(['menu', 'animations'], function () {
|
||||
menuBuilder();
|
||||
})
|
||||
|
||||
|
||||
kit.ready(['testing'], function () {
|
||||
kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');kit.service.logger.notice('adf');
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");?>
|
||||
<?
|
||||
if(\Bitrix\Main\Loader::includeModule('wt.core')) {
|
||||
app()->service()->assets()->setPlugins([
|
||||
'kit:config',
|
||||
'kit:flex-kit',
|
||||
'kit:core',
|
||||
'kit:bsCore',
|
||||
'kit:collapse',
|
||||
'kit:site',
|
||||
'kit:toolkit',
|
||||
'kit:theme',
|
||||
])->render();
|
||||
}
|
||||
$APPLICATION->ShowHead();
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
kit.ready(['Tooltip2', 'testing', 'Tooltip', 'animations'], function () {
|
||||
|
||||
var unit = new kit.testing.Unit();
|
||||
|
||||
unit.logger.info('Тестирование tooltip kit');
|
||||
|
||||
var hint = new kit.Tooltip2('#master');
|
||||
hint.setContent('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad aut fugiat inventore, modi provident quia repellendus saepe sed sequi sit');
|
||||
hint.run();
|
||||
|
||||
|
||||
|
||||
unit.assertSame(true, !!hint, 'Проверка наличия класса');
|
||||
unit.assertSame(true, !!hint.viewer, 'Проверка наличия viewer');
|
||||
unit.assertSame(true, !!hint.align, 'Проверка наличия align');
|
||||
unit.assertSame(true, !!hint.action, 'Проверка наличия action');
|
||||
unit.assertSame(hint, hint.masterNode.kit['tooltip2'], 'set kit data');
|
||||
|
||||
var hint2 = new kit.Tooltip2('#master2');
|
||||
hint2.setContent('Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad aut fugiat inventore, modi provident quia repellendus saepe sed sequi sit');
|
||||
hint2.run();
|
||||
var x = 0;
|
||||
var n = 0;
|
||||
hint2.viewer.onShowBefore.push(function () {
|
||||
if(x) {
|
||||
return
|
||||
}
|
||||
x = setInterval(function () {
|
||||
hint2.setContent(++n);
|
||||
hint2.render();
|
||||
}.bind(this), 50);
|
||||
});
|
||||
hint2.viewer.onHideBefore.push(function () {
|
||||
clearInterval(x);x = 0;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="kit-wrapper">
|
||||
<div style="padding: 100px;"><div id="master" style="width: 40px;height: 40px;background-color: #0a51ae;"></div></div>
|
||||
<div style="padding: 100px;"><div id="master2" style="width: 40px;height: 40px;background-color: #0a51ae;"></div></div>
|
||||
|
||||
<div class="kit-logger"></div>
|
||||
</div>
|
||||
|
||||
<div style="width: 3000px; height: 3000px"></div>
|
||||
<?
|
||||
?>
|
||||
Reference in New Issue
Block a user