@pisell/private-materials 3.0.170 → 3.0.171

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.
@@ -35,7 +35,7 @@ var translationOriginal = function translationOriginal(text) {
35
35
  var formatCapacityToChildrenData = function formatCapacityToChildrenData(data) {
36
36
  var map = {};
37
37
  data.forEach(function (item) {
38
- var name = translationOriginal(item.name) || "default";
38
+ var name = translationOriginal(item.name) || 'default';
39
39
  if (!map[name]) {
40
40
  map[name] = {
41
41
  label: !item.id ? locales.getText('pisell2.booking.dashboard.default') : translationOriginal(item.name) || '',
@@ -44,7 +44,9 @@ var formatCapacityToChildrenData = function formatCapacityToChildrenData(data) {
44
44
  }
45
45
  map[name].value = (map[name].value || 0) + (item.value || 0);
46
46
  });
47
- return Object.values(map).sort(function (a, b) {
47
+ return Object.values(map).filter(function (item) {
48
+ return !!item.value;
49
+ }).sort(function (a, b) {
48
50
  return b.label.localeCompare(a.label);
49
51
  });
50
52
  };
@@ -53,7 +53,7 @@ var formatCapacityToChildrenData = (data) => {
53
53
  }
54
54
  map[name].value = (map[name].value || 0) + (item.value || 0);
55
55
  });
56
- return Object.values(map).sort((a, b) => b.label.localeCompare(a.label));
56
+ return Object.values(map).filter((item) => !!item.value).sort((a, b) => b.label.localeCompare(a.label));
57
57
  };
58
58
  import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
59
59
  var BookingDashboard = (props) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.170",
3
+ "version": "3.0.171",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,8 +59,8 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
- "@pisell/utils": "1.0.42",
63
62
  "@pisell/icon": "0.0.11",
63
+ "@pisell/utils": "1.0.42",
64
64
  "@pisell/materials": "3.0.50",
65
65
  "@pisell/date-picker": "1.0.100"
66
66
  },