ods-component-lib 1.18.169 → 1.18.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.
- package/dist/components/antd/modal/OdsAdvanceModal.d.ts +7 -0
- package/dist/index.js +22 -14
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +22 -14
- package/dist/index.modern.js.map +1 -1
- package/dist/stories/OdsAdvanceModal/OdsAdvanceModal.stories.d.ts +42 -0
- package/dist/stories/OdsAdvanceModal/Samples/BasicOdsAdvanceModal.sample.d.ts +8 -0
- package/dist/stories/OdsModal/Samples/OdsModal.Sample.d.ts +1 -0
- package/dist/stories/OdsPivotGrid/OdsPivotGrid.stories.d.ts +15 -0
- package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.Constants.d.ts +2 -0
- package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.MockData.d.ts +7 -0
- package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.Sample.d.ts +1 -0
- package/dist/stories/OdsTimePicker/Samples/TimeRangePicker.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34488,7 +34488,7 @@ var DynamicIcon = function DynamicIcon(_ref) {
|
|
|
34488
34488
|
};
|
|
34489
34489
|
|
|
34490
34490
|
var OdsServerSideDatagrid = function OdsServerSideDatagrid(props) {
|
|
34491
|
-
var _props$columnResizing, _props$pagerProps$vis, _props$pagerProps, _props$pagerProps$sho, _props$pagerProps2, _props$pagerProps$sho2, _props$pagerProps3, _props$pagerProps$dis, _props$pagerProps4, _props$pagerProps$inf, _props$pagerProps5, _props$exportProps;
|
|
34491
|
+
var _props$dataGridRef, _props$dataGridRef$da, _props$dataGridRef$da2, _props$dataGridRef$da3, _props$columnResizing, _props$pagerProps$vis, _props$pagerProps, _props$pagerProps$sho, _props$pagerProps2, _props$pagerProps$sho2, _props$pagerProps3, _props$pagerProps$dis, _props$pagerProps4, _props$pagerProps$inf, _props$pagerProps5, _props$exportProps;
|
|
34492
34492
|
var rowCount = React.useRef(0);
|
|
34493
34493
|
var _useState = React.useState(50),
|
|
34494
34494
|
currentPageSize = _useState[0],
|
|
@@ -34499,17 +34499,22 @@ var OdsServerSideDatagrid = function OdsServerSideDatagrid(props) {
|
|
|
34499
34499
|
var _useState3 = React.useState(false),
|
|
34500
34500
|
filterApplied = _useState3[0],
|
|
34501
34501
|
setFilterApplied = _useState3[1];
|
|
34502
|
-
var
|
|
34503
|
-
|
|
34504
|
-
|
|
34505
|
-
|
|
34506
|
-
|
|
34502
|
+
var _useState4 = React.useState(0),
|
|
34503
|
+
totalUnfilteredCount = _useState4[0],
|
|
34504
|
+
setTotalUnfilteredCount = _useState4[1];
|
|
34505
|
+
var _useState5 = React.useState(0),
|
|
34506
|
+
totalFilteredCount = _useState5[0],
|
|
34507
|
+
setTotalFilteredCount = _useState5[1];
|
|
34508
|
+
var _useState6 = React.useState(false),
|
|
34509
|
+
updateTrigger = _useState6[0],
|
|
34510
|
+
setUpdateTrigger = _useState6[1];
|
|
34507
34511
|
var lastPageIndexRef = React.useRef(null);
|
|
34508
34512
|
var _useStyles = useStyles$1(),
|
|
34509
34513
|
gridStyle = _useStyles.styles;
|
|
34514
|
+
React.useEffect(function () {}, [updateTrigger, totalUnfilteredCount, totalFilteredCount, filterApplied]);
|
|
34510
34515
|
var renderTotal = React.useCallback(function () {
|
|
34511
34516
|
var _props$customSummary, _props$customSummary2, _props$customSummary3, _props$customSummary4;
|
|
34512
|
-
var totalLoaded = filterApplied ? totalFilteredCount
|
|
34517
|
+
var totalLoaded = filterApplied ? totalFilteredCount : totalUnfilteredCount;
|
|
34513
34518
|
var loadedPage = currentPage;
|
|
34514
34519
|
var totalRecords = props.totalRecordCount;
|
|
34515
34520
|
var totalPageCount = Math.ceil(totalRecords / currentPageSize);
|
|
@@ -34517,11 +34522,11 @@ var OdsServerSideDatagrid = function OdsServerSideDatagrid(props) {
|
|
|
34517
34522
|
return "";
|
|
34518
34523
|
}
|
|
34519
34524
|
var filteredDisplayText = filterApplied ? totalLoaded + " " + ((_props$customSummary = props.customSummary) === null || _props$customSummary === void 0 ? void 0 : _props$customSummary.summaryFilteredDataLabel) + " - " : "";
|
|
34520
|
-
var loadedDisplayText = totalUnfilteredCount
|
|
34525
|
+
var loadedDisplayText = totalUnfilteredCount + " " + ((_props$customSummary2 = props.customSummary) === null || _props$customSummary2 === void 0 ? void 0 : _props$customSummary2.summaryLoadedDataLabel) + " - ";
|
|
34521
34526
|
var result = "" + filteredDisplayText + loadedDisplayText + totalRecords + " " + ((_props$customSummary3 = props.customSummary) === null || _props$customSummary3 === void 0 ? void 0 : _props$customSummary3.summaryTotalDataLabel);
|
|
34522
34527
|
result += " - " + ((_props$customSummary4 = props.customSummary) === null || _props$customSummary4 === void 0 ? void 0 : _props$customSummary4.summaryTotalPageCountLabel) + " " + loadedPage + " / " + totalPageCount;
|
|
34523
34528
|
return result;
|
|
34524
|
-
}, [currentPage, currentPageSize, filterApplied, props.customSummary, props.totalRecordCount, totalUnfilteredCount, props.dataSource]);
|
|
34529
|
+
}, [currentPage, currentPageSize, filterApplied, props.customSummary, props.totalRecordCount, totalUnfilteredCount, props.dataSource, (_props$dataGridRef = props.dataGridRef) === null || _props$dataGridRef === void 0 ? void 0 : (_props$dataGridRef$da = _props$dataGridRef.dataGridInstance) === null || _props$dataGridRef$da === void 0 ? void 0 : (_props$dataGridRef$da2 = _props$dataGridRef$da.getDataSource()) === null || _props$dataGridRef$da2 === void 0 ? void 0 : (_props$dataGridRef$da3 = _props$dataGridRef$da2.items()) === null || _props$dataGridRef$da3 === void 0 ? void 0 : _props$dataGridRef$da3.length]);
|
|
34525
34530
|
var handleContentReady = React.useCallback(function (e) {
|
|
34526
34531
|
var _dataGridInstance$get;
|
|
34527
34532
|
var dataGridInstance = e.component;
|
|
@@ -34529,11 +34534,11 @@ var OdsServerSideDatagrid = function OdsServerSideDatagrid(props) {
|
|
|
34529
34534
|
var currentTotalCount = currentPageIndex == 0 ? 50 : dataGridInstance.totalCount();
|
|
34530
34535
|
var newData = dataGridInstance === null || dataGridInstance === void 0 ? void 0 : (_dataGridInstance$get = dataGridInstance.getDataSource()) === null || _dataGridInstance$get === void 0 ? void 0 : _dataGridInstance$get.items();
|
|
34531
34536
|
if (filterApplied) {
|
|
34532
|
-
|
|
34537
|
+
setTotalFilteredCount(currentTotalCount);
|
|
34533
34538
|
} else {
|
|
34534
|
-
|
|
34539
|
+
setTotalUnfilteredCount(currentTotalCount);
|
|
34535
34540
|
}
|
|
34536
|
-
if ((!filterApplied && currentPageIndex == 1 && currentTotalCount != totalUnfilteredCount
|
|
34541
|
+
if ((!filterApplied && currentPageIndex == 1 && currentTotalCount != totalUnfilteredCount || lastPageIndexRef.current !== currentPageIndex) && newData && newData.length > 0) {
|
|
34537
34542
|
setCurrentPage(currentPageIndex);
|
|
34538
34543
|
setCurrentPageSize(dataGridInstance.pageSize());
|
|
34539
34544
|
rowCount.current = currentTotalCount;
|
|
@@ -34559,7 +34564,7 @@ var OdsServerSideDatagrid = function OdsServerSideDatagrid(props) {
|
|
|
34559
34564
|
if (active) {
|
|
34560
34565
|
setTimeout(function () {
|
|
34561
34566
|
dataGrid.refresh().done(function () {
|
|
34562
|
-
|
|
34567
|
+
setTotalFilteredCount(dataGrid.totalCount());
|
|
34563
34568
|
setUpdateTrigger(function (prev) {
|
|
34564
34569
|
return !prev;
|
|
34565
34570
|
});
|
|
@@ -34571,7 +34576,9 @@ var OdsServerSideDatagrid = function OdsServerSideDatagrid(props) {
|
|
|
34571
34576
|
props.sortingProps.onOptionChanged(e);
|
|
34572
34577
|
}
|
|
34573
34578
|
}, [props.dataGridRef]);
|
|
34574
|
-
|
|
34579
|
+
var handleSelectionChanged = function handleSelectionChanged(event) {
|
|
34580
|
+
props.onSelectionChanged && props.onSelectionChanged(event);
|
|
34581
|
+
};
|
|
34575
34582
|
var actionButtons = React.useMemo(function () {
|
|
34576
34583
|
if (props.actionButtonGroup) {
|
|
34577
34584
|
if (props.actionButtonGroup.length > 3 && !props.edit) {
|
|
@@ -34742,6 +34749,7 @@ var OdsServerSideDatagrid = function OdsServerSideDatagrid(props) {
|
|
|
34742
34749
|
},
|
|
34743
34750
|
onContentReady: handleContentReady,
|
|
34744
34751
|
onOptionChanged: handleOptionChanged,
|
|
34752
|
+
onSelectionChanged: handleSelectionChanged,
|
|
34745
34753
|
width: "100%",
|
|
34746
34754
|
language: props.language,
|
|
34747
34755
|
onToolbarPreparing: props.onToolbarPreparing,
|