@osimatic/helpers-js 1.1.10 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/array.js +6 -0
- package/multiple_action_in_table.js +7 -0
- package/package.json +1 -1
- package/paging.js +8 -0
package/array.js
CHANGED
|
@@ -63,6 +63,12 @@ Object.filter = (obj, predicate) => {
|
|
|
63
63
|
.reduce( (res, key) => (res[key] = obj[key], res), {} );
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
+
Object.filterKeys = (obj, predicate) => {
|
|
67
|
+
return Object.keys(obj)
|
|
68
|
+
.filter( key => predicate(key) )
|
|
69
|
+
.reduce( (res, key) => (res[key] = obj[key], res), {} );
|
|
70
|
+
};
|
|
71
|
+
|
|
66
72
|
Object.renameKeys = function(obj, keysMap) {
|
|
67
73
|
return Object.keys(obj).reduce(
|
|
68
74
|
(acc, key) => ({
|
|
@@ -165,6 +165,13 @@ class MultipleActionInDivList {
|
|
|
165
165
|
let allCheckbox = contentDiv.find('input.action_multiple_checkbox');
|
|
166
166
|
let allCheckboxChecked = contentDiv.find('input.action_multiple_checkbox:checked');
|
|
167
167
|
let checkboxSelectAll = contentDiv.find('input.action_multiple_check_all');
|
|
168
|
+
|
|
169
|
+
if (allCheckbox.length === 0) {
|
|
170
|
+
checkboxSelectAll.addClass('hide');
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
checkboxSelectAll.removeClass('hide');
|
|
168
175
|
if (allCheckbox.length === allCheckboxChecked.length) {
|
|
169
176
|
checkboxSelectAll.prop('checked', true);
|
|
170
177
|
}
|
package/package.json
CHANGED
package/paging.js
CHANGED
|
@@ -135,6 +135,14 @@ class Navigation {
|
|
|
135
135
|
a.addClass('active');
|
|
136
136
|
tabContent.find(a.attr('href')).addClass('active').addClass('show');
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
static showTab(a) {
|
|
140
|
+
if (typeof bootstrap == 'undefined') {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
let tab = new bootstrap.Tab(a[0]);
|
|
144
|
+
tab.show();
|
|
145
|
+
}
|
|
138
146
|
}
|
|
139
147
|
|
|
140
148
|
module.exports = { Pagination, Navigation };
|