@fileverse-dev/fortune-react 1.1.16 → 1.1.18
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.
|
@@ -9,30 +9,30 @@ import "./index.css";
|
|
|
9
9
|
import SheetItem from "./SheetItem";
|
|
10
10
|
import ZoomControl from "../ZoomControl";
|
|
11
11
|
var STATS = [{
|
|
12
|
+
label: "Sum",
|
|
13
|
+
value: "sum"
|
|
14
|
+
}, {
|
|
12
15
|
label: "Avg",
|
|
13
16
|
value: "average"
|
|
14
17
|
}, {
|
|
15
|
-
label: "
|
|
16
|
-
value: "
|
|
18
|
+
label: "Min",
|
|
19
|
+
value: "min"
|
|
17
20
|
}, {
|
|
18
21
|
label: "Max",
|
|
19
22
|
value: "max"
|
|
20
23
|
}, {
|
|
21
|
-
label: "
|
|
22
|
-
value: "
|
|
24
|
+
label: "Count",
|
|
25
|
+
value: "count"
|
|
23
26
|
}, {
|
|
24
27
|
label: "Cells",
|
|
25
28
|
value: "numberC"
|
|
26
|
-
}, {
|
|
27
|
-
label: "Sum",
|
|
28
|
-
value: "sum"
|
|
29
29
|
}];
|
|
30
30
|
var STATS_LABELS = {
|
|
31
31
|
average: "Avg",
|
|
32
32
|
count: "Count",
|
|
33
33
|
max: "Max",
|
|
34
34
|
min: "Min",
|
|
35
|
-
numberC: "
|
|
35
|
+
numberC: "Count Numbers",
|
|
36
36
|
sum: "Sum"
|
|
37
37
|
};
|
|
38
38
|
var SheetTab = function SheetTab() {
|
|
@@ -125,6 +125,11 @@ var SheetTab = function SheetTab() {
|
|
|
125
125
|
var _a;
|
|
126
126
|
(_a = settings.onSheetCountChange) === null || _a === void 0 ? void 0 : _a.call(settings, context.luckysheetfile.length);
|
|
127
127
|
}, [context.luckysheetfile.length]);
|
|
128
|
+
var statsFilter = STATS.filter(function (stat) {
|
|
129
|
+
var statsValue = String(calInfo[stat.value]);
|
|
130
|
+
return !statsValue.includes('NaN') && !statsValue.includes('Infinity');
|
|
131
|
+
});
|
|
132
|
+
var finalStats = statsFilter.length != 6 ? [] : statsFilter;
|
|
128
133
|
return /*#__PURE__*/React.createElement("div", null, showDisclaimer && (/*#__PURE__*/React.createElement("div", {
|
|
129
134
|
className: "w-full",
|
|
130
135
|
id: "denomination-warning",
|
|
@@ -242,9 +247,11 @@ var SheetTab = function SheetTab() {
|
|
|
242
247
|
style: {
|
|
243
248
|
height: "24px !important"
|
|
244
249
|
}
|
|
245
|
-
}, calInfo.count > 0 && (/*#__PURE__*/React.createElement("p", {
|
|
250
|
+
}, calInfo.count > 0 && (statsFilter.length == 6 ? /*#__PURE__*/React.createElement("p", {
|
|
251
|
+
className: "text-body-sm"
|
|
252
|
+
}, STATS_LABELS[selectedStat], ":", " ", calInfo[selectedStat]) : /*#__PURE__*/React.createElement("p", {
|
|
246
253
|
className: "text-body-sm"
|
|
247
|
-
}, STATS_LABELS[
|
|
254
|
+
}, STATS_LABELS["count"], ":", " ", calInfo["count"])))), /*#__PURE__*/React.createElement(PopoverContent, {
|
|
248
255
|
align: "end",
|
|
249
256
|
alignOffset: 0,
|
|
250
257
|
className: "stats-content color-border-default shadow-elevation-3",
|
|
@@ -259,7 +266,7 @@ var SheetTab = function SheetTab() {
|
|
|
259
266
|
style: {
|
|
260
267
|
paddingRight: "15px"
|
|
261
268
|
}
|
|
262
|
-
},
|
|
269
|
+
}, finalStats.map(function (option) {
|
|
263
270
|
return /*#__PURE__*/React.createElement(Button, {
|
|
264
271
|
variant: "ghost",
|
|
265
272
|
key: option.value,
|
|
@@ -277,7 +284,7 @@ var SheetTab = function SheetTab() {
|
|
|
277
284
|
}))), /*#__PURE__*/React.createElement("p", {
|
|
278
285
|
className: "text-body-sm color-text-secondary",
|
|
279
286
|
style: {
|
|
280
|
-
marginLeft: selectedStat === option.value ? 0 :
|
|
287
|
+
marginLeft: selectedStat === option.value ? 0 : "24px",
|
|
281
288
|
fontSize: "14px"
|
|
282
289
|
}
|
|
283
290
|
}, option.label, ":", " "), /*#__PURE__*/React.createElement("div", {
|
|
@@ -285,7 +292,7 @@ var SheetTab = function SheetTab() {
|
|
|
285
292
|
}, /*#__PURE__*/React.createElement("p", {
|
|
286
293
|
className: "font-body-sm-bold color-text-default",
|
|
287
294
|
style: {
|
|
288
|
-
marginLeft: selectedStat === option.value ? 0 :
|
|
295
|
+
marginLeft: selectedStat === option.value ? 0 : "24px",
|
|
289
296
|
fontSize: "14px",
|
|
290
297
|
fontWeight: 500
|
|
291
298
|
}
|
|
@@ -18,30 +18,30 @@ var _ZoomControl = _interopRequireDefault(require("../ZoomControl"));
|
|
|
18
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
var STATS = [{
|
|
21
|
+
label: "Sum",
|
|
22
|
+
value: "sum"
|
|
23
|
+
}, {
|
|
21
24
|
label: "Avg",
|
|
22
25
|
value: "average"
|
|
23
26
|
}, {
|
|
24
|
-
label: "
|
|
25
|
-
value: "
|
|
27
|
+
label: "Min",
|
|
28
|
+
value: "min"
|
|
26
29
|
}, {
|
|
27
30
|
label: "Max",
|
|
28
31
|
value: "max"
|
|
29
32
|
}, {
|
|
30
|
-
label: "
|
|
31
|
-
value: "
|
|
33
|
+
label: "Count",
|
|
34
|
+
value: "count"
|
|
32
35
|
}, {
|
|
33
36
|
label: "Cells",
|
|
34
37
|
value: "numberC"
|
|
35
|
-
}, {
|
|
36
|
-
label: "Sum",
|
|
37
|
-
value: "sum"
|
|
38
38
|
}];
|
|
39
39
|
var STATS_LABELS = {
|
|
40
40
|
average: "Avg",
|
|
41
41
|
count: "Count",
|
|
42
42
|
max: "Max",
|
|
43
43
|
min: "Min",
|
|
44
|
-
numberC: "
|
|
44
|
+
numberC: "Count Numbers",
|
|
45
45
|
sum: "Sum"
|
|
46
46
|
};
|
|
47
47
|
var SheetTab = function SheetTab() {
|
|
@@ -134,6 +134,11 @@ var SheetTab = function SheetTab() {
|
|
|
134
134
|
var _a;
|
|
135
135
|
(_a = settings.onSheetCountChange) === null || _a === void 0 ? void 0 : _a.call(settings, context.luckysheetfile.length);
|
|
136
136
|
}, [context.luckysheetfile.length]);
|
|
137
|
+
var statsFilter = STATS.filter(function (stat) {
|
|
138
|
+
var statsValue = String(calInfo[stat.value]);
|
|
139
|
+
return !statsValue.includes('NaN') && !statsValue.includes('Infinity');
|
|
140
|
+
});
|
|
141
|
+
var finalStats = statsFilter.length != 6 ? [] : statsFilter;
|
|
137
142
|
return /*#__PURE__*/_react.default.createElement("div", null, showDisclaimer && (/*#__PURE__*/_react.default.createElement("div", {
|
|
138
143
|
className: "w-full",
|
|
139
144
|
id: "denomination-warning",
|
|
@@ -251,9 +256,11 @@ var SheetTab = function SheetTab() {
|
|
|
251
256
|
style: {
|
|
252
257
|
height: "24px !important"
|
|
253
258
|
}
|
|
254
|
-
}, calInfo.count > 0 && (/*#__PURE__*/_react.default.createElement("p", {
|
|
259
|
+
}, calInfo.count > 0 && (statsFilter.length == 6 ? /*#__PURE__*/_react.default.createElement("p", {
|
|
260
|
+
className: "text-body-sm"
|
|
261
|
+
}, STATS_LABELS[selectedStat], ":", " ", calInfo[selectedStat]) : /*#__PURE__*/_react.default.createElement("p", {
|
|
255
262
|
className: "text-body-sm"
|
|
256
|
-
}, STATS_LABELS[
|
|
263
|
+
}, STATS_LABELS["count"], ":", " ", calInfo["count"])))), /*#__PURE__*/_react.default.createElement(_ui.PopoverContent, {
|
|
257
264
|
align: "end",
|
|
258
265
|
alignOffset: 0,
|
|
259
266
|
className: "stats-content color-border-default shadow-elevation-3",
|
|
@@ -268,7 +275,7 @@ var SheetTab = function SheetTab() {
|
|
|
268
275
|
style: {
|
|
269
276
|
paddingRight: "15px"
|
|
270
277
|
}
|
|
271
|
-
},
|
|
278
|
+
}, finalStats.map(function (option) {
|
|
272
279
|
return /*#__PURE__*/_react.default.createElement(_ui.Button, {
|
|
273
280
|
variant: "ghost",
|
|
274
281
|
key: option.value,
|
|
@@ -286,7 +293,7 @@ var SheetTab = function SheetTab() {
|
|
|
286
293
|
}))), /*#__PURE__*/_react.default.createElement("p", {
|
|
287
294
|
className: "text-body-sm color-text-secondary",
|
|
288
295
|
style: {
|
|
289
|
-
marginLeft: selectedStat === option.value ? 0 :
|
|
296
|
+
marginLeft: selectedStat === option.value ? 0 : "24px",
|
|
290
297
|
fontSize: "14px"
|
|
291
298
|
}
|
|
292
299
|
}, option.label, ":", " "), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -294,7 +301,7 @@ var SheetTab = function SheetTab() {
|
|
|
294
301
|
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
295
302
|
className: "font-body-sm-bold color-text-default",
|
|
296
303
|
style: {
|
|
297
|
-
marginLeft: selectedStat === option.value ? 0 :
|
|
304
|
+
marginLeft: selectedStat === option.value ? 0 : "24px",
|
|
298
305
|
fontSize: "14px",
|
|
299
306
|
fontWeight: 500
|
|
300
307
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-react",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.18",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tsc": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@fileverse-dev/fortune-core": "1.1.
|
|
19
|
+
"@fileverse-dev/fortune-core": "1.1.18",
|
|
20
20
|
"@fileverse/ui": "^4.1.7-patch-21",
|
|
21
21
|
"@tippyjs/react": "^4.2.6",
|
|
22
22
|
"@types/regenerator-runtime": "^0.13.6",
|