ods-component-lib 1.17.66 → 1.17.68
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/index.js +61 -29
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +86 -54
- package/dist/index.modern.js.map +1 -1
- package/package.json +108 -108
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useRef } from 'react';
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import { AutoComplete, Button, Dropdown, Calendar, Card as Card$1, Checkbox, DatePicker, Divider, Input, Form, Image, InputNumber, List, Modal, notification, Radio, Rate, Select, Spin, Switch, Tabs, Table, Tag, Timeline, TimePicker, Typography } from 'antd';
|
|
3
3
|
import styled, { ThemeProvider } from 'styled-components';
|
|
4
4
|
import Card from 'antd/es/card/Card';
|
|
@@ -7,14 +7,15 @@ import 'react-phone-input-2/lib/style.css';
|
|
|
7
7
|
import PhoneInput from 'react-phone-input-2';
|
|
8
8
|
import message from 'antd/es/message';
|
|
9
9
|
import Parser from 'html-react-parser';
|
|
10
|
-
import {
|
|
10
|
+
import { locale, loadMessages } from 'devextreme/localization';
|
|
11
|
+
import { DataGrid, LoadPanel, Paging, Pager, SearchPanel, FilterRow, FilterPanel, RemoteOperations, HeaderFilter, ColumnChooser, Position, ColumnChooserSearch, ColumnChooserSelection, Selection, Editing, Popup, Form as Form$1, Scrolling, Export, Column, RequiredRule, Button as Button$1, Toolbar, Item as Item$1, Summary, TotalItem, StateStoring } from 'devextreme-react/data-grid';
|
|
12
|
+
import { Item } from 'devextreme-react/form';
|
|
11
13
|
import { exportDataGrid as exportDataGrid$1 } from 'devextreme/pdf_exporter';
|
|
12
14
|
import { exportDataGrid } from 'devextreme/excel_exporter';
|
|
13
15
|
import jsPDF from 'jspdf';
|
|
14
16
|
import { Workbook } from 'exceljs';
|
|
15
17
|
import { saveAs } from 'file-saver-es';
|
|
16
18
|
import moment from 'moment';
|
|
17
|
-
import { Item as Item$1 } from 'devextreme-react/form';
|
|
18
19
|
import { CheckBox, Lookup, TreeList } from 'devextreme-react';
|
|
19
20
|
import { createStore } from 'devextreme-aspnet-data-nojquery';
|
|
20
21
|
import { TreeView } from 'devextreme-react/tree-view';
|
|
@@ -1194,6 +1195,7 @@ var renderMenuItem = function renderMenuItem() {
|
|
|
1194
1195
|
};
|
|
1195
1196
|
function OdsDataGrid(props) {
|
|
1196
1197
|
var dataGridRef = useRef(null);
|
|
1198
|
+
console.log('deneme12: ', sessionStorage.getItem("locale"));
|
|
1197
1199
|
return grid(props, dataGridRef);
|
|
1198
1200
|
}
|
|
1199
1201
|
function grid(props, dataGridRef) {
|
|
@@ -1253,6 +1255,10 @@ function grid(props, dataGridRef) {
|
|
|
1253
1255
|
state.selectionFilter = [];
|
|
1254
1256
|
localStorage.setItem(props.exportFileName + "Storage", JSON.stringify(state));
|
|
1255
1257
|
};
|
|
1258
|
+
useEffect(function () {
|
|
1259
|
+
locale(sessionStorage.getItem("locale"));
|
|
1260
|
+
loadMessages(JSON.parse(sessionStorage.getItem("localTranslation")));
|
|
1261
|
+
}, []);
|
|
1256
1262
|
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
1257
1263
|
className: "odsDatagrid",
|
|
1258
1264
|
style: {
|
|
@@ -1269,15 +1275,7 @@ function grid(props, dataGridRef) {
|
|
|
1269
1275
|
onRowInserted: props.onRowInserted,
|
|
1270
1276
|
onRowUpdated: props.onRowUpdated,
|
|
1271
1277
|
onRowRemoved: props.onRowRemoved,
|
|
1272
|
-
onEditingStart: props.onEditingStart,
|
|
1273
|
-
onInitNewRow: props.onInitNewRow,
|
|
1274
|
-
onRowInserting: props.onRowInserting,
|
|
1275
|
-
onRowUpdating: props.onRowUpdating,
|
|
1276
|
-
onRowRemoving: props.onRowRemoving,
|
|
1277
1278
|
onSaving: props.onSaving,
|
|
1278
|
-
onSaved: props.onSaved,
|
|
1279
|
-
onEditCanceling: props.onEditCanceling,
|
|
1280
|
-
onEditCanceled: props.onEditCanceled,
|
|
1281
1279
|
allowColumnReordering: true,
|
|
1282
1280
|
showRowLines: true,
|
|
1283
1281
|
showBorders: true,
|
|
@@ -1285,6 +1283,7 @@ function grid(props, dataGridRef) {
|
|
|
1285
1283
|
focusedRowEnabled: false,
|
|
1286
1284
|
wordWrapEnabled: false,
|
|
1287
1285
|
noDataText: "No Data",
|
|
1286
|
+
onEditCanceling: props.onEditCanceling,
|
|
1288
1287
|
onExporting: onExporting,
|
|
1289
1288
|
height: window.innerHeight - 164,
|
|
1290
1289
|
repaintChangesOnly: true,
|
|
@@ -1338,7 +1337,24 @@ function grid(props, dataGridRef) {
|
|
|
1338
1337
|
allowDeleting: props.edit.allowDeleting,
|
|
1339
1338
|
allowAdding: props.edit.allowAdding,
|
|
1340
1339
|
useIcons: true
|
|
1341
|
-
}
|
|
1340
|
+
}, props.edit.mode === "popup" && React.createElement(Popup, {
|
|
1341
|
+
title: props.popupTitle,
|
|
1342
|
+
showTitle: true,
|
|
1343
|
+
width: 700,
|
|
1344
|
+
height: 300,
|
|
1345
|
+
showCloseButton: false
|
|
1346
|
+
}), React.createElement(Form$1, null, props.formItems.map(function (formItem) {
|
|
1347
|
+
return React.createElement(Item, {
|
|
1348
|
+
itemType: formItem.itemType,
|
|
1349
|
+
colCount: formItem.colCount,
|
|
1350
|
+
colSpan: formItem.colSpan
|
|
1351
|
+
}, formItem.items.map(function (subItem) {
|
|
1352
|
+
return React.createElement(Item, {
|
|
1353
|
+
key: subItem.dataField,
|
|
1354
|
+
dataField: subItem.dataField
|
|
1355
|
+
});
|
|
1356
|
+
}));
|
|
1357
|
+
}))), React.createElement(Scrolling, {
|
|
1342
1358
|
mode: props.scroll.mode,
|
|
1343
1359
|
showScrollbar: props.scroll.showScrollbar,
|
|
1344
1360
|
scrollByContent: props.scroll.scrollByContent,
|
|
@@ -1366,25 +1382,41 @@ function grid(props, dataGridRef) {
|
|
|
1366
1382
|
value: false
|
|
1367
1383
|
}]
|
|
1368
1384
|
}));
|
|
1369
|
-
}),
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1385
|
+
}), function () {
|
|
1386
|
+
if (props.customPopup !== undefined) {
|
|
1387
|
+
return React.createElement(Column, {
|
|
1388
|
+
dataField: "Actions",
|
|
1389
|
+
caption: "Actions",
|
|
1390
|
+
type: "buttons",
|
|
1391
|
+
width: 110,
|
|
1392
|
+
showInColumnChooser: false
|
|
1393
|
+
}, props.edit.allowUpdating && React.createElement(Button$1, {
|
|
1394
|
+
hint: "Edit",
|
|
1395
|
+
visible: true,
|
|
1396
|
+
disabled: false,
|
|
1397
|
+
icon: "edit",
|
|
1398
|
+
onClick: props.editButtonClick
|
|
1399
|
+
}), props.edit.allowDeleting && React.createElement(Button$1, {
|
|
1400
|
+
hint: "Delete",
|
|
1401
|
+
visible: true,
|
|
1402
|
+
disabled: false,
|
|
1403
|
+
icon: "trash",
|
|
1404
|
+
onClick: props.deleteButtonClick
|
|
1405
|
+
}));
|
|
1406
|
+
} else {
|
|
1407
|
+
return React.createElement(Column, {
|
|
1408
|
+
dataField: "Actions",
|
|
1409
|
+
caption: "Actions",
|
|
1410
|
+
type: "buttons",
|
|
1411
|
+
width: 110,
|
|
1412
|
+
showInColumnChooser: false
|
|
1413
|
+
}, React.createElement(React.Fragment, null, props.edit.allowUpdating && React.createElement(Button$1, {
|
|
1414
|
+
name: "edit"
|
|
1415
|
+
}), props.edit.allowDeleting && React.createElement(Button$1, {
|
|
1416
|
+
name: "delete"
|
|
1417
|
+
})));
|
|
1418
|
+
}
|
|
1419
|
+
}(), React.createElement(Toolbar, null, props.pageTitle && React.createElement(Item$1, {
|
|
1388
1420
|
location: "before"
|
|
1389
1421
|
}, React.createElement(Typography.Title, {
|
|
1390
1422
|
level: 5,
|
|
@@ -1395,7 +1427,7 @@ function grid(props, dataGridRef) {
|
|
|
1395
1427
|
gap: "4px",
|
|
1396
1428
|
alignSelf: "stretch"
|
|
1397
1429
|
}
|
|
1398
|
-
}, props.pageTitle)), React.createElement(Item, {
|
|
1430
|
+
}, props.pageTitle)), React.createElement(Item$1, {
|
|
1399
1431
|
location: "before"
|
|
1400
1432
|
}, React.createElement(OdsButton, {
|
|
1401
1433
|
type: "primary",
|
|
@@ -1403,15 +1435,15 @@ function grid(props, dataGridRef) {
|
|
|
1403
1435
|
style: {
|
|
1404
1436
|
marginBottom: "10px"
|
|
1405
1437
|
}
|
|
1406
|
-
}, "Add New")), React.createElement(Item, {
|
|
1438
|
+
}, "Add New")), React.createElement(Item$1, {
|
|
1407
1439
|
name: "searchPanel"
|
|
1408
|
-
}), React.createElement(Item, {
|
|
1440
|
+
}), React.createElement(Item$1, {
|
|
1409
1441
|
name: "applyFilterButton"
|
|
1410
|
-
}), React.createElement(Item, {
|
|
1442
|
+
}), React.createElement(Item$1, {
|
|
1411
1443
|
name: "columnChooserButton"
|
|
1412
|
-
}), React.createElement(Item, {
|
|
1444
|
+
}), React.createElement(Item$1, {
|
|
1413
1445
|
name: "exportButton"
|
|
1414
|
-
}), React.createElement(Item, {
|
|
1446
|
+
}), React.createElement(Item$1, {
|
|
1415
1447
|
menuItemRender: renderMenuItem
|
|
1416
1448
|
})), React.createElement(Summary, null, React.createElement(TotalItem, {
|
|
1417
1449
|
column: "Id",
|
|
@@ -1704,12 +1736,12 @@ function OdsProfDataGrid(props) {
|
|
|
1704
1736
|
height: 300,
|
|
1705
1737
|
showCloseButton: false
|
|
1706
1738
|
}), React.createElement(Form$1, null, props.formItems && props.formItems.map(function (formItem) {
|
|
1707
|
-
return React.createElement(Item
|
|
1739
|
+
return React.createElement(Item, {
|
|
1708
1740
|
itemType: formItem.itemType,
|
|
1709
1741
|
colCount: formItem.colCount,
|
|
1710
1742
|
colSpan: formItem.colSpan
|
|
1711
1743
|
}, formItem.items.map(function (subItem) {
|
|
1712
|
-
return React.createElement(Item
|
|
1744
|
+
return React.createElement(Item, {
|
|
1713
1745
|
key: subItem.dataField,
|
|
1714
1746
|
dataField: subItem.dataField
|
|
1715
1747
|
});
|
|
@@ -1766,25 +1798,25 @@ function OdsProfDataGrid(props) {
|
|
|
1766
1798
|
name: "delete"
|
|
1767
1799
|
})));
|
|
1768
1800
|
}
|
|
1769
|
-
}(), React.createElement(Toolbar, null, React.createElement(Item, {
|
|
1801
|
+
}(), React.createElement(Toolbar, null, React.createElement(Item$1, {
|
|
1770
1802
|
location: "after"
|
|
1771
1803
|
}, React.createElement(Button$1, {
|
|
1772
1804
|
onClick: props.onAddButton
|
|
1773
|
-
}, "Add New")), React.createElement(Item, {
|
|
1805
|
+
}, "Add New")), React.createElement(Item$1, {
|
|
1774
1806
|
location: "after"
|
|
1775
1807
|
}, React.createElement(CheckBox, {
|
|
1776
1808
|
id: 'showPageSizes',
|
|
1777
1809
|
text: 'Show Page Size',
|
|
1778
1810
|
value: showPageSizeSelector,
|
|
1779
1811
|
onValueChanged: handleCheckboxChange
|
|
1780
|
-
})), React.createElement(Item, {
|
|
1812
|
+
})), React.createElement(Item$1, {
|
|
1781
1813
|
location: "after"
|
|
1782
1814
|
}, React.createElement(CheckBox, {
|
|
1783
1815
|
id: 'showPages',
|
|
1784
1816
|
text: 'Enable Paging',
|
|
1785
1817
|
value: enablePaging,
|
|
1786
1818
|
onValueChanged: onEnablePagingChange
|
|
1787
|
-
})), React.createElement(Item, {
|
|
1819
|
+
})), React.createElement(Item$1, {
|
|
1788
1820
|
location: "after"
|
|
1789
1821
|
}, React.createElement(Lookup, {
|
|
1790
1822
|
value: scrollingType,
|
|
@@ -1799,13 +1831,13 @@ function OdsProfDataGrid(props) {
|
|
|
1799
1831
|
label: "infinite"
|
|
1800
1832
|
}],
|
|
1801
1833
|
onValueChange: handleScrollingTypeChange
|
|
1802
|
-
})), React.createElement(Item, {
|
|
1834
|
+
})), React.createElement(Item$1, {
|
|
1803
1835
|
name: "columnChooserButton"
|
|
1804
|
-
}), React.createElement(Item, {
|
|
1836
|
+
}), React.createElement(Item$1, {
|
|
1805
1837
|
name: "searchPanel"
|
|
1806
|
-
}), React.createElement(Item, {
|
|
1838
|
+
}), React.createElement(Item$1, {
|
|
1807
1839
|
name: "exportButton"
|
|
1808
|
-
}), React.createElement(Item, {
|
|
1840
|
+
}), React.createElement(Item$1, {
|
|
1809
1841
|
menuItemRender: renderMenuItem$1
|
|
1810
1842
|
})))));
|
|
1811
1843
|
}
|
|
@@ -1956,12 +1988,12 @@ function grid$2(props) {
|
|
|
1956
1988
|
height: 300,
|
|
1957
1989
|
showCloseButton: false
|
|
1958
1990
|
}), React.createElement(Form$1, null, props.formItems.map(function (formItem) {
|
|
1959
|
-
return React.createElement(Item
|
|
1991
|
+
return React.createElement(Item, {
|
|
1960
1992
|
itemType: formItem.itemType,
|
|
1961
1993
|
colCount: formItem.colCount,
|
|
1962
1994
|
colSpan: formItem.colSpan
|
|
1963
1995
|
}, formItem.items.map(function (subItem) {
|
|
1964
|
-
return React.createElement(Item
|
|
1996
|
+
return React.createElement(Item, {
|
|
1965
1997
|
key: subItem.dataField,
|
|
1966
1998
|
dataField: subItem.dataField
|
|
1967
1999
|
});
|
|
@@ -1986,18 +2018,18 @@ function grid$2(props) {
|
|
|
1986
2018
|
value: false
|
|
1987
2019
|
}]
|
|
1988
2020
|
}));
|
|
1989
|
-
}), React.createElement(Toolbar, null, React.createElement(Item, {
|
|
2021
|
+
}), React.createElement(Toolbar, null, React.createElement(Item$1, {
|
|
1990
2022
|
location: "after"
|
|
1991
2023
|
}, React.createElement(OdsButton, {
|
|
1992
2024
|
type: "primary",
|
|
1993
2025
|
onClick: props.onAddButton
|
|
1994
|
-
}, "Add New")), React.createElement(Item, {
|
|
2026
|
+
}, "Add New")), React.createElement(Item$1, {
|
|
1995
2027
|
name: "searchPanel"
|
|
1996
|
-
}), React.createElement(Item, {
|
|
2028
|
+
}), React.createElement(Item$1, {
|
|
1997
2029
|
name: "columnChooserButton"
|
|
1998
|
-
}), React.createElement(Item, {
|
|
2030
|
+
}), React.createElement(Item$1, {
|
|
1999
2031
|
name: "exportButton"
|
|
2000
|
-
}), React.createElement(Item, {
|
|
2032
|
+
}), React.createElement(Item$1, {
|
|
2001
2033
|
menuItemRender: renderMenuItem$2
|
|
2002
2034
|
})), React.createElement(Summary, null, React.createElement(TotalItem, {
|
|
2003
2035
|
column: "Id",
|