Skip to content

Commit

Permalink
regenerate dist files after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
olifolkerd committed Jun 21, 2020
1 parent 07e71ea commit 9489e09
Show file tree
Hide file tree
Showing 10 changed files with 214 additions and 104 deletions.
28 changes: 21 additions & 7 deletions dist/js/modules/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ Edit.prototype.editors = {
input.addEventListener("keydown", function (e) {
switch (e.keyCode) {
case 13:
case 9:
// case 9:
onChange();
break;

Expand Down Expand Up @@ -861,8 +861,10 @@ Edit.prototype.editors = {

function processComplexListItem(item) {
var item = {
label: editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label) : item.label,
label: item.label,
value: item.value,
itemParams: item.itemParams,
elementAttributes: item.elementAttributes,
element: false
};

Expand Down Expand Up @@ -894,6 +896,8 @@ Edit.prototype.editors = {
item = {
label: value.label,
group: true,
itemParams: value.itemParams,
elementAttributes: value.elementAttributes,
element: false
};

Expand All @@ -908,7 +912,7 @@ Edit.prototype.editors = {
} else {

item = {
label: editorParams.listItemFormatter ? editorParams.listItemFormatter(value, value) : value,
label: value,
value: value,
element: false
};
Expand All @@ -928,7 +932,7 @@ Edit.prototype.editors = {
} else {
for (var key in inputValues) {
var item = {
label: editorParams.listItemFormatter ? editorParams.listItemFormatter(key, inputValues[key]) : inputValues[key],
label: inputValues[key],
value: key,
element: false
};
Expand Down Expand Up @@ -956,17 +960,17 @@ Edit.prototype.editors = {
while (listEl.firstChild) {
listEl.removeChild(listEl.firstChild);
}displayItems.forEach(function (item) {

var el = item.element;

if (!el) {

el = document.createElement("div");
item.label = editorParams.listItemFormatter ? editorParams.listItemFormatter(item.value, item.label, cell, el, item.itemParams) : item.label;
if (item.group) {
el = document.createElement("div");
el.classList.add("tabulator-edit-select-list-group");
el.tabIndex = 0;
el.innerHTML = item.label === "" ? " " : item.label;
} else {
el = document.createElement("div");
el.classList.add("tabulator-edit-select-list-item");
el.tabIndex = 0;
el.innerHTML = item.label === "" ? " " : item.label;
Expand All @@ -992,6 +996,16 @@ Edit.prototype.editors = {
}
}

if (item.elementAttributes && _typeof(item.elementAttributes) == "object") {
for (var key in item.elementAttributes) {
if (key.charAt(0) == "+") {
key = key.slice(1);
el.setAttribute(key, input.getAttribute(key) + item.elementAttributes["+" + key]);
} else {
el.setAttribute(key, item.elementAttributes[key]);
}
}
}
el.addEventListener("mousedown", function () {
blurable = false;

Expand Down
2 changes: 1 addition & 1 deletion dist/js/modules/edit.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/js/modules/group_rows.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ Group.prototype.addBindings = function () {
});
}

if (self.groupManager.table.options.groupContextMenu && self.groupManager.table.modExists("menu")) {
self.groupManager.table.modules.menu.initializeGroup.call(self.groupManager.table.modules.menu, self);
}

if (self.groupManager.table.options.groupTap) {

tap = false;
Expand Down
2 changes: 1 addition & 1 deletion dist/js/modules/group_rows.min.js

Large diffs are not rendered by default.

33 changes: 29 additions & 4 deletions dist/js/modules/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var Menu = function Menu(table) {
this.table = table; //hold Tabulator object
this.menuEl = false;
this.blurEvent = this.hideMenu.bind(this);
this.escEvent = this.escMenu.bind(this);
};

Menu.prototype.initializeColumnHeader = function (column) {
Expand Down Expand Up @@ -63,9 +64,21 @@ Menu.prototype.initializeRow = function (row) {
});
};

Menu.prototype.loadMenu = function (e, component, menu) {
Menu.prototype.initializeGroup = function (group) {
var _this4 = this;

group.getElement().addEventListener("contextmenu", function (e) {
var menu = typeof _this4.table.options.groupContextMenu == "function" ? _this4.table.options.groupContextMenu(group.getComponent()) : _this4.table.options.groupContextMenu;

e.preventDefault();

_this4.loadMenu(e, group, menu);
});
};

Menu.prototype.loadMenu = function (e, component, menu) {
var _this5 = this;

var docHeight = Math.max(document.body.offsetHeight, window.innerHeight);

//abort if no menu set
Expand Down Expand Up @@ -109,13 +122,13 @@ Menu.prototype.loadMenu = function (e, component, menu) {
});
} else {
itemEl.addEventListener("click", function (e) {
_this4.hideMenu();
_this5.hideMenu();
item.action(e, component.getComponent());
});
}
}

_this4.menuEl.appendChild(itemEl);
_this5.menuEl.appendChild(itemEl);
});

this.menuEl.style.top = e.pageY + "px";
Expand All @@ -125,9 +138,11 @@ Menu.prototype.loadMenu = function (e, component, menu) {
this.table.rowManager.element.addEventListener("scroll", this.blurEvent);

setTimeout(function () {
document.body.addEventListener("contextmenu", _this4.blurEvent);
document.body.addEventListener("contextmenu", _this5.blurEvent);
}, 100);

document.body.addEventListener("keydown", this.escEvent);

document.body.appendChild(this.menuEl);

//move menu to start on right edge if it is too close to the edge of the screen
Expand All @@ -143,11 +158,21 @@ Menu.prototype.loadMenu = function (e, component, menu) {
}
};

Menu.prototype.escMenu = function (e) {
if (e.keyCode == 27) {
this.hideMenu();
}
};

Menu.prototype.hideMenu = function () {
if (this.menuEl.parentNode) {
this.menuEl.parentNode.removeChild(this.menuEl);
}

if (this.escEvent) {
document.body.removeEventListener("keydown", this.escEvent);
}

if (this.blurEvent) {
document.body.removeEventListener("click", this.blurEvent);
document.body.removeEventListener("contextmenu", this.blurEvent);
Expand Down
2 changes: 1 addition & 1 deletion dist/js/modules/menu.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9489e09

Please sign in to comment.