devextreme-planit-treegrid-react 1.1.7 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -360,7 +360,7 @@ var DxPlanitTreeGrid = /*#__PURE__*/ (0, _react.forwardRef)(function (props, ref
360
360
  for (var _i2 = 0, _Object$keys = Object.keys(map); _i2 < _Object$keys.length; _i2++) {
361
361
  var depth = _Object$keys[_i2];
362
362
  if (map[depth] !== columnIndex + 1) {
363
- console.error('그룹 데이터의 children 숫자가 columnIndex와 맞지 않습니다. 다시 한 번 확인 바랍니다.');
363
+ console.error('그룹 데이터의 colspan 숫자가 columnIndex와 맞지 않습니다. 다시 한 번 확인 바랍니다.');
364
364
  }
365
365
  }
366
366
  return true;
@@ -563,6 +563,11 @@ var DxPlanitTreeGrid = /*#__PURE__*/ (0, _react.forwardRef)(function (props, ref
563
563
  * @param dataSource
564
564
  */
565
565
  var checkDataSource = function checkDataSource(dataSource) {
566
+ if (!dataSource._fields) {
567
+ throw Error(
568
+ 'PivotGridDataSource 의 field 정보가 없습니다. 올바른 field 정보를 입력하세요. https://js.devexpress.com/Documentation/ApiReference/Data_Layer/PivotGridDataSource/Configuration/fields/'
569
+ );
570
+ }
566
571
  var isColumns = dataSource._fields.findIndex(function (field) {
567
572
  return field.area === 'column';
568
573
  });
@@ -698,67 +703,74 @@ var DxPlanitTreeGrid = /*#__PURE__*/ (0, _react.forwardRef)(function (props, ref
698
703
  };
699
704
  (0, _react.useEffect)(
700
705
  function () {
701
- resetSession();
702
- setGridDataSource(dataSource);
703
- checkDataSource(dataSource);
706
+ if (Object.keys(dataSource).length) {
707
+ resetSession();
708
+ setGridDataSource(dataSource);
709
+ checkDataSource(dataSource);
710
+ }
704
711
  },
705
712
  [dataSource]
706
713
  );
707
714
  return /*#__PURE__*/ _react.createElement(
708
- 'div',
715
+ _react.Fragment,
709
716
  null,
710
- /*#__PURE__*/ _react.createElement(_loadPanel.LoadPanel, {
711
- position: {
712
- of: id,
713
- },
714
- }),
715
- /*#__PURE__*/ _react.createElement(
716
- _pivotGrid.default,
717
- {
718
- id: id,
719
- ref: $tableRef,
720
- dataSource: gridDataSource,
721
- showColumnTotals: false,
722
- showColumnGrandTotals: true,
723
- showRowGrandTotals: false,
724
- width: width,
725
- height: height,
726
- allowExpandAll: allowExpandAll,
727
- allowFiltering: allowFiltering,
728
- allowSorting: allowSorting,
729
- allowSortingBySummary: allowSortingBySummary,
730
- dataFieldArea: dataFieldArea,
731
- disabled: disabled,
732
- elementAttr: elementAttr,
733
- encodeHtml: encodeHtml,
734
- hideEmptySummaryCells: hideEmptySummaryCells,
735
- hint: hint,
736
- rowHeaderLayout: rowHeaderLayout,
737
- rtlEnabled: rtlEnabled,
738
- showBorders: showBorders,
739
- showRowTotals: showRowTotals,
740
- showTotalsPrior: showTotalsPrior,
741
- tabIndex: tabIndex,
742
- visible: visible,
743
- wordWrapEnabled: wordWrapEnabled,
744
- onCellClick: onCellClickChild,
745
- onContentReady: onContentReadyChild,
746
- onCellPrepared: onCellPreparedChild,
747
- onContextMenuPreparing: onContextMenuPreparingChild,
748
- onDisposing: onDisposingChild,
749
- onExporting: onExportingChild,
750
- onInitialized: onInitializedChild,
751
- onOptionChanged: onOptionChangedChild,
752
- },
753
- /*#__PURE__*/ _react.createElement(_dataGrid.StateStoring, {
754
- enabled: stateStoringKey === null || stateStoringKey === void 0 ? void 0 : stateStoringKey.length,
755
- type: 'sessionStorage',
756
- storageKey: stateStoringKey,
757
- }),
758
- /*#__PURE__*/ _react.createElement(_pivotGrid.FieldChooser, {
759
- enabled: false,
760
- })
761
- )
717
+ Object.keys(gridDataSource).length &&
718
+ /*#__PURE__*/ _react.createElement(
719
+ 'div',
720
+ null,
721
+ /*#__PURE__*/ _react.createElement(_loadPanel.LoadPanel, {
722
+ position: {
723
+ of: id,
724
+ },
725
+ }),
726
+ /*#__PURE__*/ _react.createElement(
727
+ _pivotGrid.default,
728
+ {
729
+ id: id,
730
+ ref: $tableRef,
731
+ dataSource: gridDataSource,
732
+ showColumnTotals: false,
733
+ showColumnGrandTotals: true,
734
+ showRowGrandTotals: false,
735
+ width: width,
736
+ height: height,
737
+ allowExpandAll: allowExpandAll,
738
+ allowFiltering: allowFiltering,
739
+ allowSorting: allowSorting,
740
+ allowSortingBySummary: allowSortingBySummary,
741
+ dataFieldArea: dataFieldArea,
742
+ disabled: disabled,
743
+ elementAttr: elementAttr,
744
+ encodeHtml: encodeHtml,
745
+ hideEmptySummaryCells: hideEmptySummaryCells,
746
+ hint: hint,
747
+ rowHeaderLayout: rowHeaderLayout,
748
+ rtlEnabled: rtlEnabled,
749
+ showBorders: showBorders,
750
+ showRowTotals: showRowTotals,
751
+ showTotalsPrior: showTotalsPrior,
752
+ tabIndex: tabIndex,
753
+ visible: visible,
754
+ wordWrapEnabled: wordWrapEnabled,
755
+ onCellClick: onCellClickChild,
756
+ onContentReady: onContentReadyChild,
757
+ onCellPrepared: onCellPreparedChild,
758
+ onContextMenuPreparing: onContextMenuPreparingChild,
759
+ onDisposing: onDisposingChild,
760
+ onExporting: onExportingChild,
761
+ onInitialized: onInitializedChild,
762
+ onOptionChanged: onOptionChangedChild,
763
+ },
764
+ /*#__PURE__*/ _react.createElement(_dataGrid.StateStoring, {
765
+ enabled: stateStoringKey === null || stateStoringKey === void 0 ? void 0 : stateStoringKey.length,
766
+ type: 'sessionStorage',
767
+ storageKey: stateStoringKey,
768
+ }),
769
+ /*#__PURE__*/ _react.createElement(_pivotGrid.FieldChooser, {
770
+ enabled: false,
771
+ })
772
+ )
773
+ )
762
774
  );
763
775
  });
764
776
  var _default = DxPlanitTreeGrid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devextreme-planit-treegrid-react",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Devextreme의 DxPivotGrid를 Tree Grid처럼 보여주는 Wrapper입니다.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,8 +41,12 @@
41
41
  "not op_mini all"
42
42
  ],
43
43
  "dependencies": {
44
+ "react": "^18.2.0",
45
+ "react-dom": "^18.2.0",
46
+ "react-router-dom": "^6.4.3",
47
+ "react-scripts": "^5.0.1",
44
48
  "devextreme": "^22.1.6",
45
- "devextreme-planit-treegrid-react": "^1.1.6",
49
+ "devextreme-planit-treegrid-react": "^1.1.8",
46
50
  "devextreme-react": "^22.1.6",
47
51
  "exceljs": "^4.3.0",
48
52
  "file-saver": "^2.0.5",
@@ -50,12 +54,6 @@
50
54
  "uuid": "^9.0.0",
51
55
  "web-vitals": "^2.1.4"
52
56
  },
53
- "peerDependencies": {
54
- "react": "^18.2.0",
55
- "react-dom": "^18.2.0",
56
- "react-router-dom": "^6.4.3",
57
- "react-scripts": "^5.0.1"
58
- },
59
57
  "devDependencies": {
60
58
  "@babel/cli": "^7.0.0",
61
59
  "@babel/core": "^7.20.5",