devextreme-planit-treegrid-react 1.3.3 → 1.3.4
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/DxPlanitTreeGrid.js +306 -119
- package/package.json +2 -2
package/dist/DxPlanitTreeGrid.js
CHANGED
@@ -1,29 +1,136 @@
|
|
1
|
-
|
1
|
+
'use strict';
|
2
2
|
|
3
|
-
function _typeof(obj) {
|
4
|
-
|
5
|
-
|
3
|
+
function _typeof(obj) {
|
4
|
+
'@babel/helpers - typeof';
|
5
|
+
return (
|
6
|
+
(_typeof =
|
7
|
+
'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
|
8
|
+
? function (obj) {
|
9
|
+
return typeof obj;
|
10
|
+
}
|
11
|
+
: function (obj) {
|
12
|
+
return obj && 'function' == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
|
13
|
+
}),
|
14
|
+
_typeof(obj)
|
15
|
+
);
|
16
|
+
}
|
17
|
+
Object.defineProperty(exports, '__esModule', {
|
18
|
+
value: true,
|
6
19
|
});
|
7
20
|
exports.default = void 0;
|
8
|
-
var _react = require(
|
9
|
-
var _pivotGrid = _interopRequireWildcard(require(
|
10
|
-
var _excel_exporter = require(
|
11
|
-
var _exceljs = require(
|
12
|
-
var _fileSaver = _interopRequireDefault(require(
|
13
|
-
var _localization = require(
|
14
|
-
function _interopRequireDefault(obj) {
|
15
|
-
|
16
|
-
|
17
|
-
function
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
function
|
26
|
-
|
21
|
+
var _react = require('react');
|
22
|
+
var _pivotGrid = _interopRequireWildcard(require('devextreme-react/pivot-grid'));
|
23
|
+
var _excel_exporter = require('devextreme/excel_exporter');
|
24
|
+
var _exceljs = require('exceljs');
|
25
|
+
var _fileSaver = _interopRequireDefault(require('file-saver'));
|
26
|
+
var _localization = require('devextreme/localization');
|
27
|
+
function _interopRequireDefault(obj) {
|
28
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
29
|
+
}
|
30
|
+
function _getRequireWildcardCache(nodeInterop) {
|
31
|
+
if (typeof WeakMap !== 'function') return null;
|
32
|
+
var cacheBabelInterop = new WeakMap();
|
33
|
+
var cacheNodeInterop = new WeakMap();
|
34
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
|
35
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
36
|
+
})(nodeInterop);
|
37
|
+
}
|
38
|
+
function _interopRequireWildcard(obj, nodeInterop) {
|
39
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
40
|
+
return obj;
|
41
|
+
}
|
42
|
+
if (obj === null || (_typeof(obj) !== 'object' && typeof obj !== 'function')) {
|
43
|
+
return { default: obj };
|
44
|
+
}
|
45
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
46
|
+
if (cache && cache.has(obj)) {
|
47
|
+
return cache.get(obj);
|
48
|
+
}
|
49
|
+
var newObj = {};
|
50
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
51
|
+
for (var key in obj) {
|
52
|
+
if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) {
|
53
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
54
|
+
if (desc && (desc.get || desc.set)) {
|
55
|
+
Object.defineProperty(newObj, key, desc);
|
56
|
+
} else {
|
57
|
+
newObj[key] = obj[key];
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
newObj.default = obj;
|
62
|
+
if (cache) {
|
63
|
+
cache.set(obj, newObj);
|
64
|
+
}
|
65
|
+
return newObj;
|
66
|
+
}
|
67
|
+
function _toConsumableArray(arr) {
|
68
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
69
|
+
}
|
70
|
+
function _nonIterableSpread() {
|
71
|
+
throw new TypeError(
|
72
|
+
'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
|
73
|
+
);
|
74
|
+
}
|
75
|
+
function _iterableToArray(iter) {
|
76
|
+
if ((typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) || iter['@@iterator'] != null) return Array.from(iter);
|
77
|
+
}
|
78
|
+
function _arrayWithoutHoles(arr) {
|
79
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
80
|
+
}
|
81
|
+
function _slicedToArray(arr, i) {
|
82
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
83
|
+
}
|
84
|
+
function _nonIterableRest() {
|
85
|
+
throw new TypeError(
|
86
|
+
'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
|
87
|
+
);
|
88
|
+
}
|
89
|
+
function _unsupportedIterableToArray(o, minLen) {
|
90
|
+
if (!o) return;
|
91
|
+
if (typeof o === 'string') return _arrayLikeToArray(o, minLen);
|
92
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
93
|
+
if (n === 'Object' && o.constructor) n = o.constructor.name;
|
94
|
+
if (n === 'Map' || n === 'Set') return Array.from(o);
|
95
|
+
if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
96
|
+
}
|
97
|
+
function _arrayLikeToArray(arr, len) {
|
98
|
+
if (len == null || len > arr.length) len = arr.length;
|
99
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
100
|
+
arr2[i] = arr[i];
|
101
|
+
}
|
102
|
+
return arr2;
|
103
|
+
}
|
104
|
+
function _iterableToArrayLimit(arr, i) {
|
105
|
+
var _i = null == arr ? null : ('undefined' != typeof Symbol && arr[Symbol.iterator]) || arr['@@iterator'];
|
106
|
+
if (null != _i) {
|
107
|
+
var _s,
|
108
|
+
_e,
|
109
|
+
_x,
|
110
|
+
_r,
|
111
|
+
_arr = [],
|
112
|
+
_n = !0,
|
113
|
+
_d = !1;
|
114
|
+
try {
|
115
|
+
if (((_x = (_i = _i.call(arr)).next), 0 === i)) {
|
116
|
+
if (Object(_i) !== _i) return;
|
117
|
+
_n = !1;
|
118
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) {}
|
119
|
+
} catch (err) {
|
120
|
+
(_d = !0), (_e = err);
|
121
|
+
} finally {
|
122
|
+
try {
|
123
|
+
if (!_n && null != _i.return && ((_r = _i.return()), Object(_r) !== _r)) return;
|
124
|
+
} finally {
|
125
|
+
if (_d) throw _e;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
return _arr;
|
129
|
+
}
|
130
|
+
}
|
131
|
+
function _arrayWithHoles(arr) {
|
132
|
+
if (Array.isArray(arr)) return arr;
|
133
|
+
}
|
27
134
|
/**
|
28
135
|
* devextreme pivotgrid Configrations 중 사용 불가 항목 : id, width, height, showColumnGrandTotals, showColumnTotals, showRowGrandTotals, FieldChooser. fieldPanel,
|
29
136
|
* devextreme pivotgrid Configrations 중 사용 방법 변경 항목 : stateStoring, Export
|
@@ -36,7 +143,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
36
143
|
*/
|
37
144
|
|
38
145
|
var grandTotalCssNm = 'data-grand-total';
|
39
|
-
var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
146
|
+
var DxPlanitTreeGrid = /*#__PURE__*/ (0, _react.forwardRef)(function (props, ref) {
|
40
147
|
var children = props.children,
|
41
148
|
_props$id = props.id,
|
42
149
|
id = _props$id === void 0 ? 'dx-planit-vera-pivotgrid-id' : _props$id,
|
@@ -106,28 +213,38 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
106
213
|
_useState8 = _slicedToArray(_useState7, 2),
|
107
214
|
gridDataSource = _useState8[0],
|
108
215
|
setGridDataSource = _useState8[1];
|
216
|
+
var _useState9 = (0, _react.useState)(null),
|
217
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
218
|
+
oldDataSource = _useState10[0],
|
219
|
+
setOldDataSource = _useState10[1];
|
109
220
|
var $tableRef = (0, _react.useRef)(null);
|
110
221
|
var excelBorder = {
|
111
222
|
style: 'thin',
|
112
223
|
color: {
|
113
|
-
argb: 'FF7E7E7E'
|
114
|
-
}
|
224
|
+
argb: 'FF7E7E7E',
|
225
|
+
},
|
226
|
+
};
|
227
|
+
var korean = {
|
228
|
+
'ko': {
|
229
|
+
'dxPivotGrid-sortColumnBySummary': '"{0}" 을(를) 선택한 열 기준으로 정렬',
|
230
|
+
'dxPivotGrid-removeAllSorting': '정렬기능 모두 제거',
|
231
|
+
'dxPivotGrid-expandAll': '모두 펼치기',
|
232
|
+
'dxPivotGrid-collapseAll': '모두 접기',
|
233
|
+
'dxDataGrid-headerFilterOK': '확인',
|
234
|
+
'dxDataGrid-headerFilterCancel': '취소',
|
235
|
+
'dxList-selectAll': '모두 선택',
|
236
|
+
'Search': '검색',
|
237
|
+
},
|
115
238
|
};
|
239
|
+
|
240
|
+
/**
|
241
|
+
* devextreme 한국어 변환
|
242
|
+
* @param lang 설정한 language 정보
|
243
|
+
*/
|
116
244
|
var transferLanguage = function transferLanguage(lang) {
|
117
245
|
(0, _localization.locale)(lang);
|
118
246
|
if (lang === 'ko' || lang === 'ko-KR') {
|
119
|
-
(0, _localization.loadMessages)(
|
120
|
-
ko: {
|
121
|
-
'dxPivotGrid-sortColumnBySummary': '"{0}" 을(를) 선택한 열 기준으로 정렬',
|
122
|
-
'dxPivotGrid-removeAllSorting': '정렬기능 모두 제거',
|
123
|
-
'dxPivotGrid-expandAll': '모두 펼치기',
|
124
|
-
'dxPivotGrid-collapseAll': '모두 접기',
|
125
|
-
'dxDataGrid-headerFilterOK': '확인',
|
126
|
-
'dxDataGrid-headerFilterCancel': '취소',
|
127
|
-
'dxList-selectAll': '모두 선택',
|
128
|
-
'Search': '검색'
|
129
|
-
}
|
130
|
-
});
|
247
|
+
(0, _localization.loadMessages)(korean);
|
131
248
|
}
|
132
249
|
};
|
133
250
|
|
@@ -150,14 +267,18 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
150
267
|
if (child.type.OptionName.toLowerCase() === 'fieldpanel') {
|
151
268
|
var _child$props$visible, _child$props$allowFie, _child$props$showRowF;
|
152
269
|
warnDisableProps(child);
|
153
|
-
return /*#__PURE__*/_react.createElement(_pivotGrid.FieldPanel, {
|
270
|
+
return /*#__PURE__*/ _react.createElement(_pivotGrid.FieldPanel, {
|
154
271
|
key: 'FieldPanel' + index,
|
155
272
|
visible: (_child$props$visible = child.props.visible) !== null && _child$props$visible !== void 0 ? _child$props$visible : false,
|
156
|
-
allowFieldDragging:
|
273
|
+
allowFieldDragging:
|
274
|
+
(_child$props$allowFie = child.props.allowFieldDragging) !== null && _child$props$allowFie !== void 0
|
275
|
+
? _child$props$allowFie
|
276
|
+
: true,
|
157
277
|
showColumnFields: false,
|
158
278
|
showFilterFields: false,
|
159
279
|
showDataFields: false,
|
160
|
-
showRowFields:
|
280
|
+
showRowFields:
|
281
|
+
(_child$props$showRowF = child.props.showRowFields) !== null && _child$props$showRowF !== void 0 ? _child$props$showRowF : true,
|
161
282
|
});
|
162
283
|
}
|
163
284
|
return child;
|
@@ -171,16 +292,26 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
171
292
|
var _wrapper$clientWidth;
|
172
293
|
var wrapper = document.querySelector('.diag-table-wrapper');
|
173
294
|
var gap = 10;
|
174
|
-
setWidth(
|
295
|
+
setWidth(
|
296
|
+
(_wrapper$clientWidth = wrapper === null || wrapper === void 0 ? void 0 : wrapper.clientWidth) !== null &&
|
297
|
+
_wrapper$clientWidth !== void 0
|
298
|
+
? _wrapper$clientWidth
|
299
|
+
: 0
|
300
|
+
);
|
175
301
|
setHeight(wrapper ? wrapper.clientHeight - gap : 0);
|
176
302
|
window.addEventListener('resize', function () {
|
177
303
|
var _wrapper$clientWidth2;
|
178
|
-
setWidth(
|
304
|
+
setWidth(
|
305
|
+
(_wrapper$clientWidth2 = wrapper === null || wrapper === void 0 ? void 0 : wrapper.clientWidth) !== null &&
|
306
|
+
_wrapper$clientWidth2 !== void 0
|
307
|
+
? _wrapper$clientWidth2
|
308
|
+
: 0
|
309
|
+
);
|
179
310
|
setHeight(wrapper ? wrapper.clientHeight - gap : 0);
|
180
311
|
});
|
181
312
|
return {
|
182
313
|
width: width,
|
183
|
-
height: height
|
314
|
+
height: height,
|
184
315
|
};
|
185
316
|
};
|
186
317
|
|
@@ -196,7 +327,7 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
196
327
|
if (((_e$cell = e.cell) === null || _e$cell === void 0 ? void 0 : _e$cell.type) === 'T') {
|
197
328
|
var _e$cell$text;
|
198
329
|
var text = (_e$cell$text = e.cell.text) === null || _e$cell$text === void 0 ? void 0 : _e$cell$text.replace('Total', '합계');
|
199
|
-
e.cellElement.innerHTML =
|
330
|
+
e.cellElement.innerHTML = '<span>'.concat(text, '</span>');
|
200
331
|
}
|
201
332
|
};
|
202
333
|
|
@@ -223,7 +354,13 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
223
354
|
if (!convertZeroToHipen) {
|
224
355
|
return;
|
225
356
|
}
|
226
|
-
if (
|
357
|
+
if (
|
358
|
+
e.area === 'data' &&
|
359
|
+
(((_e$cell3 = e.cell) === null || _e$cell3 === void 0 ? void 0 : _e$cell3.text) === '0' ||
|
360
|
+
((_e$cell4 = e.cell) === null || _e$cell4 === void 0 ? void 0 : _e$cell4.text) === '0.0%' ||
|
361
|
+
((_e$cell5 = e.cell) === null || _e$cell5 === void 0 ? void 0 : _e$cell5.text) === '') &&
|
362
|
+
e.cellElement
|
363
|
+
) {
|
227
364
|
e.cellElement.innerHTML = '<span class="text-color">-</span>';
|
228
365
|
}
|
229
366
|
};
|
@@ -246,7 +383,7 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
246
383
|
} else if (!isLast && index === 0) {
|
247
384
|
td.setAttribute('style', 'border-bottom: 0');
|
248
385
|
}
|
249
|
-
td.innerHTML =
|
386
|
+
td.innerHTML = '<span>'.concat(text, '</span>');
|
250
387
|
return td;
|
251
388
|
};
|
252
389
|
|
@@ -257,13 +394,15 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
257
394
|
*/
|
258
395
|
var makeCheckGroupData = function makeCheckGroupData(groupField) {
|
259
396
|
var data = {};
|
260
|
-
groupField === null || groupField === void 0
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
397
|
+
groupField === null || groupField === void 0
|
398
|
+
? void 0
|
399
|
+
: groupField.forEach(function (group) {
|
400
|
+
if (data[group.depth]) {
|
401
|
+
data[group.depth] += group.colspan;
|
402
|
+
} else {
|
403
|
+
data[group.depth] = group.colspan;
|
404
|
+
}
|
405
|
+
});
|
267
406
|
return data;
|
268
407
|
};
|
269
408
|
|
@@ -289,7 +428,11 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
289
428
|
*/
|
290
429
|
var setTotalElementInfo = function setTotalElementInfo(e) {
|
291
430
|
var _e$cell6, _e$cell7, _e$cellElement;
|
292
|
-
if (
|
431
|
+
if (
|
432
|
+
!(groupField !== null && groupField !== void 0 && groupField.length) ||
|
433
|
+
((_e$cell6 = e.cell) === null || _e$cell6 === void 0 ? void 0 : _e$cell6.type) !== 'GT' ||
|
434
|
+
((_e$cell7 = e.cell) === null || _e$cell7 === void 0 ? void 0 : _e$cell7.text) !== 'Grand Total'
|
435
|
+
) {
|
293
436
|
return;
|
294
437
|
}
|
295
438
|
(_e$cellElement = e.cellElement) === null || _e$cellElement === void 0 ? void 0 : _e$cellElement.classList.add(grandTotalCssNm);
|
@@ -316,9 +459,11 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
316
459
|
*/
|
317
460
|
var getGroupDepth = function getGroupDepth(group, arr) {
|
318
461
|
var groupData = group.slice();
|
319
|
-
var set = new Set(
|
320
|
-
|
321
|
-
|
462
|
+
var set = new Set(
|
463
|
+
groupData.map(function (group) {
|
464
|
+
return group.depth;
|
465
|
+
})
|
466
|
+
);
|
322
467
|
return Array.from(set).sort(function compare(a, b) {
|
323
468
|
if (a > b) {
|
324
469
|
return arr === 'asc' ? -1 : 1;
|
@@ -363,7 +508,10 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
363
508
|
}
|
364
509
|
totalElement.innerHTML = '';
|
365
510
|
totalElement.setAttribute('style', 'padding: 0; border: 0');
|
366
|
-
var colgroup =
|
511
|
+
var colgroup =
|
512
|
+
(_thead$previousSiblin = thead.previousSibling) === null || _thead$previousSiblin === void 0
|
513
|
+
? void 0
|
514
|
+
: _thead$previousSiblin.cloneNode(true);
|
367
515
|
var groupData = groupField.slice();
|
368
516
|
var depth = getGroupDepth(groupData, 'asc');
|
369
517
|
var table = document.createElement('table');
|
@@ -394,7 +542,7 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
394
542
|
return {
|
395
543
|
colspan: group.colspan,
|
396
544
|
text: group.groupCaption,
|
397
|
-
type: 'GT'
|
545
|
+
type: 'GT',
|
398
546
|
};
|
399
547
|
});
|
400
548
|
});
|
@@ -408,7 +556,7 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
408
556
|
var makeSplitCondtion = function makeSplitCondtion(condition) {
|
409
557
|
var newCondition = {
|
410
558
|
standard: '',
|
411
|
-
condition: ''
|
559
|
+
condition: '',
|
412
560
|
};
|
413
561
|
_toConsumableArray(condition).forEach(function (cond) {
|
414
562
|
if (Number.isNaN(parseFloat(cond))) {
|
@@ -434,7 +582,14 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
434
582
|
if (e.cell.value === null) {
|
435
583
|
return;
|
436
584
|
}
|
437
|
-
if (
|
585
|
+
if (
|
586
|
+
((_e$cell8 = e.cell) === null || _e$cell8 === void 0
|
587
|
+
? void 0
|
588
|
+
: (_e$cell8$format = _e$cell8.format) === null || _e$cell8$format === void 0
|
589
|
+
? void 0
|
590
|
+
: _e$cell8$format.type) === color.format &&
|
591
|
+
!Number.isNaN(e.cell.value)
|
592
|
+
) {
|
438
593
|
var standardData = makeSplitCondtion(color.condition.replace(/(\s*)/g, ''));
|
439
594
|
var rate = color.format === 'percent' ? 0.01 : 1;
|
440
595
|
var condition = false;
|
@@ -465,7 +620,9 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
465
620
|
*/
|
466
621
|
var checkDataSource = function checkDataSource(dataSource) {
|
467
622
|
if (!dataSource._fields) {
|
468
|
-
throw Error(
|
623
|
+
throw Error(
|
624
|
+
'PivotGridDataSource 의 field 정보가 없습니다. 올바른 field 정보를 입력하세요. https://js.devexpress.com/Documentation/ApiReference/Data_Layer/PivotGridDataSource/Configuration/fields/'
|
625
|
+
);
|
469
626
|
}
|
470
627
|
var isColumns = dataSource._fields.findIndex(function (field) {
|
471
628
|
return field.area === 'column';
|
@@ -491,7 +648,10 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
491
648
|
var exportToExcel = function exportToExcel(fileName) {
|
492
649
|
setTimeout(function () {
|
493
650
|
var _$tableRef$current;
|
494
|
-
return exportToExcelAction(
|
651
|
+
return exportToExcelAction(
|
652
|
+
(_$tableRef$current = $tableRef.current) === null || _$tableRef$current === void 0 ? void 0 : _$tableRef$current.instance,
|
653
|
+
fileName
|
654
|
+
);
|
495
655
|
});
|
496
656
|
};
|
497
657
|
|
@@ -532,14 +692,17 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
532
692
|
bottom: borderStyle,
|
533
693
|
left: borderStyle,
|
534
694
|
right: borderStyle,
|
535
|
-
top: borderStyle
|
695
|
+
top: borderStyle,
|
536
696
|
};
|
537
|
-
}
|
697
|
+
},
|
538
698
|
}).then(function () {
|
539
699
|
workbook.xlsx.writeBuffer().then(function (buffer) {
|
540
|
-
(0, _fileSaver.default)(
|
541
|
-
|
542
|
-
|
700
|
+
(0, _fileSaver.default)(
|
701
|
+
new Blob([buffer], {
|
702
|
+
type: 'application/octet-stream',
|
703
|
+
}),
|
704
|
+
fileName + '.xlsx'
|
705
|
+
);
|
543
706
|
});
|
544
707
|
});
|
545
708
|
e.cancel = true;
|
@@ -579,6 +742,7 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
579
742
|
}
|
580
743
|
return null;
|
581
744
|
};
|
745
|
+
var compareDataSource = function compareDataSource() {};
|
582
746
|
|
583
747
|
/**
|
584
748
|
* 그리드 펼침 정보 세션스토리지 리셋
|
@@ -633,57 +797,80 @@ var DxPlanitTreeGrid = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
633
797
|
};
|
634
798
|
(0, _react.useImperativeHandle)(ref, function () {
|
635
799
|
return {
|
636
|
-
exportToExcel: exportToExcel
|
800
|
+
exportToExcel: exportToExcel,
|
637
801
|
};
|
638
802
|
});
|
639
|
-
(0, _react.useEffect)(
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
803
|
+
(0, _react.useEffect)(
|
804
|
+
function () {
|
805
|
+
if (Object.keys(dataSource).length) {
|
806
|
+
if (oldDataSource && oldDataSource._fields.length !== dataSource._fields.length) {
|
807
|
+
resetSession();
|
808
|
+
setOldDataSource(dataSource);
|
809
|
+
}
|
810
|
+
setGridDataSource(dataSource);
|
811
|
+
checkDataSource(dataSource);
|
812
|
+
}
|
813
|
+
},
|
814
|
+
[dataSource]
|
815
|
+
);
|
816
|
+
(0, _react.useEffect)(
|
817
|
+
function () {
|
818
|
+
transferLanguage(language);
|
819
|
+
},
|
820
|
+
[language]
|
821
|
+
);
|
822
|
+
return /*#__PURE__*/ _react.createElement(
|
823
|
+
_react.Fragment,
|
824
|
+
null,
|
825
|
+
Object.keys(gridDataSource).length &&
|
826
|
+
/*#__PURE__*/ _react.createElement(
|
827
|
+
'div',
|
828
|
+
null,
|
829
|
+
/*#__PURE__*/ _react.createElement(
|
830
|
+
_pivotGrid.default,
|
831
|
+
{
|
832
|
+
id: id,
|
833
|
+
ref: $tableRef,
|
834
|
+
dataSource: gridDataSource,
|
835
|
+
showColumnTotals: false,
|
836
|
+
showColumnGrandTotals: true,
|
837
|
+
showRowGrandTotals: false,
|
838
|
+
width: width,
|
839
|
+
height: height,
|
840
|
+
allowExpandAll: allowExpandAll,
|
841
|
+
allowFiltering: allowFiltering,
|
842
|
+
allowSorting: allowSorting,
|
843
|
+
allowSortingBySummary: allowSortingBySummary,
|
844
|
+
dataFieldArea: dataFieldArea,
|
845
|
+
disabled: disabled,
|
846
|
+
elementAttr: elementAttr,
|
847
|
+
encodeHtml: encodeHtml,
|
848
|
+
hideEmptySummaryCells: hideEmptySummaryCells,
|
849
|
+
hint: hint,
|
850
|
+
rowHeaderLayout: rowHeaderLayout,
|
851
|
+
rtlEnabled: rtlEnabled,
|
852
|
+
showBorders: showBorders,
|
853
|
+
showRowTotals: showRowTotals,
|
854
|
+
showTotalsPrior: showTotalsPrior,
|
855
|
+
tabIndex: tabIndex,
|
856
|
+
visible: visible,
|
857
|
+
wordWrapEnabled: wordWrapEnabled,
|
858
|
+
onCellClick: onCellClickChild,
|
859
|
+
onContentReady: onContentReadyChild,
|
860
|
+
onCellPrepared: onCellPreparedChild,
|
861
|
+
onContextMenuPreparing: onContextMenuPreparingChild,
|
862
|
+
onDisposing: onDisposingChild,
|
863
|
+
onExporting: onExportingChild,
|
864
|
+
onInitialized: onInitializedChild,
|
865
|
+
onOptionChanged: onOptionChangedChild,
|
866
|
+
},
|
867
|
+
convertChildren(children),
|
868
|
+
/*#__PURE__*/ _react.createElement(_pivotGrid.FieldChooser, {
|
869
|
+
enabled: false,
|
870
|
+
})
|
871
|
+
)
|
872
|
+
)
|
873
|
+
);
|
687
874
|
});
|
688
875
|
var _default = DxPlanitTreeGrid;
|
689
|
-
exports.default = _default;
|
876
|
+
exports.default = _default;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "devextreme-planit-treegrid-react",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.4",
|
4
4
|
"description": "Devextreme의 DxPivotGrid를 Tree Grid처럼 보여주는 Wrapper입니다.",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -43,7 +43,7 @@
|
|
43
43
|
],
|
44
44
|
"dependencies": {
|
45
45
|
"devextreme": "^22.1.6",
|
46
|
-
"devextreme-planit-treegrid-react": "^1.3.
|
46
|
+
"devextreme-planit-treegrid-react": "^1.3.3",
|
47
47
|
"devextreme-react": "^22.1.6",
|
48
48
|
"exceljs": "^4.3.0",
|
49
49
|
"file-saver": "^2.0.5",
|