@canvas-components/react-pivot-table 0.1.9 → 0.2.2
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/README.md +118 -0
- package/assets/react-pivot-table-demo.gif +0 -0
- package/dist/index.cjs +26 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
package/dist/index.js
CHANGED
|
@@ -952,13 +952,21 @@ function buildPivotChartOption(params) {
|
|
|
952
952
|
show: true,
|
|
953
953
|
left: 12,
|
|
954
954
|
right: 14,
|
|
955
|
-
top:
|
|
955
|
+
top: 40,
|
|
956
956
|
bottom: 18,
|
|
957
957
|
containLabel: true,
|
|
958
958
|
backgroundColor: "#ffffff",
|
|
959
959
|
borderColor: "#e6e9ed",
|
|
960
960
|
borderWidth: 1
|
|
961
961
|
},
|
|
962
|
+
legend: {
|
|
963
|
+
show: true,
|
|
964
|
+
orient: "horizontal",
|
|
965
|
+
left: "center",
|
|
966
|
+
top: "top",
|
|
967
|
+
itemGap: 12,
|
|
968
|
+
textStyle: { color: "#646a73", fontSize: 11 }
|
|
969
|
+
},
|
|
962
970
|
xAxis: horizontal ? valueAxis : categoryAxis,
|
|
963
971
|
yAxis: horizontal ? categoryAxis : valueAxis,
|
|
964
972
|
tooltip: {
|
|
@@ -1592,7 +1600,12 @@ function toSharedValue(value) {
|
|
|
1592
1600
|
secondConditionValue: stringifyConditionValue(value.secondCondition?.value),
|
|
1593
1601
|
secondConditionSecondValue: stringifyConditionValue(
|
|
1594
1602
|
value.secondCondition?.secondValue
|
|
1595
|
-
)
|
|
1603
|
+
),
|
|
1604
|
+
conditions: value.conditions?.map((condition) => ({
|
|
1605
|
+
operator: toSharedOperator(condition.operator),
|
|
1606
|
+
value: stringifyConditionValue(condition.value),
|
|
1607
|
+
secondValue: stringifyConditionValue(condition.secondValue)
|
|
1608
|
+
}))
|
|
1596
1609
|
};
|
|
1597
1610
|
}
|
|
1598
1611
|
function toPivotFilter(value) {
|
|
@@ -1608,6 +1621,13 @@ function toPivotFilter(value) {
|
|
|
1608
1621
|
value.secondConditionValue,
|
|
1609
1622
|
value.secondConditionSecondValue
|
|
1610
1623
|
),
|
|
1624
|
+
conditions: value.conditions?.map(
|
|
1625
|
+
(condition) => toPivotCondition(
|
|
1626
|
+
condition.operator,
|
|
1627
|
+
condition.value,
|
|
1628
|
+
condition.secondValue
|
|
1629
|
+
)
|
|
1630
|
+
),
|
|
1611
1631
|
conditionRelation: value.conditionRelation
|
|
1612
1632
|
};
|
|
1613
1633
|
}
|
|
@@ -1691,7 +1711,10 @@ var defaultFilterTexts = {
|
|
|
1691
1711
|
relationAndLabel: "\u4E14",
|
|
1692
1712
|
relationOrLabel: "\u6216",
|
|
1693
1713
|
resetAction: "\u91CD\u7F6E",
|
|
1694
|
-
applyAction: "\u786E\u5B9A"
|
|
1714
|
+
applyAction: "\u786E\u5B9A",
|
|
1715
|
+
conditionLabel: "\u6761\u4EF6",
|
|
1716
|
+
addConditionAction: "\u65B0\u589E\u6761\u4EF6",
|
|
1717
|
+
deleteConditionAction: "\u5220\u9664\u6761\u4EF6"
|
|
1695
1718
|
};
|
|
1696
1719
|
function inferFieldAggregator(records, dataIndex) {
|
|
1697
1720
|
const value = records.map((record) => getValueByDataIndex(record, dataIndex)).find((item) => item != null);
|