@osimatic/helpers-js 1.1.10 → 1.1.11
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/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) => ({
|
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 };
|